diff --git a/.env b/.env index eb0d86e..23d4457 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -REACT_APP_API_URL=http://10.0.0.16:8080 +REACT_APP_API_URL=http://127.0.0.1:8080 diff --git a/src/App.js b/src/App.js index 29128ce..e101522 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ // src/App.js -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; import { useParams } from 'react-router-dom'; import Login from './components/Login'; @@ -9,8 +9,12 @@ import Navbar from './components/Navbar'; // Correct import here import './styles.css' function App() { - const [token, setToken] = useState(null); - + const [token, setToken] = useState(localStorage.getItem('token')); + useEffect(() => { + if (token) { + localStorage.setItem('token', token); + } + }, [token]); return ( diff --git a/src/components/ItemDetails.js b/src/components/ItemDetails.js index 8d23daa..575711e 100644 --- a/src/components/ItemDetails.js +++ b/src/components/ItemDetails.js @@ -182,7 +182,7 @@ export default function ItemDetails({ item, token, onSave, onClose, boxId }) { - + ); } \ No newline at end of file diff --git a/src/components/Items.js b/src/components/Items.js index 4bbf31b..aa1a982 100644 --- a/src/components/Items.js +++ b/src/components/Items.js @@ -247,9 +247,6 @@ export default function Items({ token }) { id="newItemImageUpload" // Unique ID /> -