45 |
46 |
47 | {isLoggedIn && (
48 |
55 | )}
56 | {authState.matches("unauthorized") && (
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
70 |
71 |
72 | )}
73 |
74 |
75 | );
76 | };
77 |
78 | export default App;
79 |
--------------------------------------------------------------------------------
/src/containers/BankAccountsContainer.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from "react";
2 | import { useService } from "@xstate/react";
3 | import { Interpreter } from "xstate";
4 | import { Link as RouterLink, useRouteMatch } from "react-router-dom";
5 | import { makeStyles, Grid, Button, Paper, Typography } from "@material-ui/core";
6 |
7 | import { AuthMachineContext, AuthMachineEvents } from "../machines/authMachine";
8 | import { DataContext, DataEvents } from "../machines/dataMachine";
9 | import BankAccountForm from "../components/BankAccountForm";
10 | import BankAccountList from "../components/BankAccountList";
11 |
12 | export interface Props {
13 | authService: Interpreter