From 3762f3458d92885566e71a4199eb04e9c7561fea Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 9 Jan 2020 09:15:01 +0000 Subject: [PATCH] Deal with missing pages --- webclient/src/App.js | 95 ++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 39 deletions(-) diff --git a/webclient/src/App.js b/webclient/src/App.js index e3cd374..996b07a 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -409,47 +409,50 @@ function TransactionDetail(props) { const t = user.transactions.find(x => x.id == id); return ( - -
Transaction Receipt
+ t ? + +
Transaction Receipt
- - - - Date: - {t.date} - - - ID: - {t.id} - - - Amount: - ${t.amount} - - - Category: - {t.category} - - - Account: - {t.account} - - - Info Source: - {t.info_source} - - - Reference: - {t.reference_number} - - - Memo: - {t.memo} - - -
+ + + + Date: + {t.date} + + + ID: + {t.id} + + + Amount: + ${t.amount} + + + Category: + {t.category} + + + Account: + {t.account} + + + Info Source: + {t.info_source} + + + Reference: + {t.reference_number} + + + Memo: + {t.memo} + + +
-
+
+ : + ); } @@ -464,6 +467,17 @@ function PleaseLogin() { ); }; +function NotFound() { + return ( + + + The page you requested can't be found! +

Visit our home page if you are lost.

+
+
+ ); +}; + function App() { const [token, setToken] = useState(localStorage.getItem('token', '')); const [user, setUser] = useState(JSON.parse(localStorage.getItem('user', 'false'))); @@ -563,6 +577,9 @@ function App() { + + + :