diff --git a/src/App.js b/src/App.js
index 9e421f1..2bdc93c 100644
--- a/src/App.js
+++ b/src/App.js
@@ -18,7 +18,7 @@ const existingToken = localStorage.getItem('token');
// const existingUser = JSON.parse(localStorage.getItem('user'));
export default function App() {
- const [authToken, setAuthToken] = useState(existingToken);
+ const [authToken, setAuthToken] = useState(existingToken || '');
const setToken = (data) => {
localStorage.setItem('token', JSON.stringify(data));
diff --git a/src/screens/Dashboard.js b/src/screens/Dashboard.js
index dbbe93d..777700f 100644
--- a/src/screens/Dashboard.js
+++ b/src/screens/Dashboard.js
@@ -1,14 +1,23 @@
import React from 'react';
import { Panel } from 'rsuite';
+import { useAuth } from '../helpers/authContext';
+import NavBar from '../components/Navbar/NavBar';
+
const boxStyle = {
margin: '50px 10px',
};
export default function Dashboard() {
+ const { authToken } = useAuth();
+
return (
- Dashboard} bordered style={boxStyle}>
- This is just experimenting with stuff.
-
+ <>
+
+ Dashboard} bordered style={boxStyle}>
+ This is just experimenting with stuff.
+ {authToken}
+
+ >
);
}
diff --git a/src/screens/Home.js b/src/screens/Home.js
index 7a48f1a..7263252 100644
--- a/src/screens/Home.js
+++ b/src/screens/Home.js
@@ -1,6 +1,7 @@
import React from 'react';
import { Panel } from 'rsuite';
+import { useAuth } from '../helpers/authContext';
import NavBar from '../components/Navbar/NavBar';
const boxStyle = {
@@ -8,11 +9,13 @@ const boxStyle = {
};
export default function Home() {
+ const { authToken } = useAuth();
return (
<>
Home} bordered style={boxStyle}>
This will be the home page
+ {authToken}
>
);