diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 2f4a741..ce437fb 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -8,6 +8,38 @@ import './App.css'; import 'bootstrap/dist/css/bootstrap.min.css'; function App() { + // Ensure we have persistent (informal) user information + const [user, setUser] = useState(""); + useEffect(() => { + localStorage.setItem('user', user); + }, [user]); + useEffect(() => { + const user = localStorage.getItem('user'); + if (user) { + setUser(user); + } + }, []); + + // If no user, must be scanned/set otherwise + return ( + + {user === "" ? + + : + } + + ); +} + +function NoUserView({setUser}) { + return

No user!

; +} + +function UserView({user}) { + return

User={user}

; +} + +function BarItemScanner() { const [reqAccount, setReqAccount] = useState(''); const [actAccount, setActAccount] = useState(''); const [balance, setBalance] = useState(-1);