Start work on general workflow.
This commit is contained in:
parent
b65740e214
commit
0677419d40
1 changed files with 32 additions and 0 deletions
|
@ -8,6 +8,38 @@ import './App.css';
|
||||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||||
|
|
||||||
function App() {
|
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 (
|
||||||
|
<Container>
|
||||||
|
{user === "" ?
|
||||||
|
<NoUserView setUser={setUser} />
|
||||||
|
:
|
||||||
|
<UserView user={user} />}
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function NoUserView({setUser}) {
|
||||||
|
return <p>No user!</p>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function UserView({user}) {
|
||||||
|
return <p>User={user}</p>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function BarItemScanner() {
|
||||||
const [reqAccount, setReqAccount] = useState('');
|
const [reqAccount, setReqAccount] = useState('');
|
||||||
const [actAccount, setActAccount] = useState('');
|
const [actAccount, setActAccount] = useState('');
|
||||||
const [balance, setBalance] = useState(-1);
|
const [balance, setBalance] = useState(-1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue