From 8d0b32f8dfe45291426e58f6bf20cffac8dab6e7 Mon Sep 17 00:00:00 2001 From: Joseph Ditton Date: Tue, 23 Nov 2021 14:04:12 -0700 Subject: adds api, guard, tailwind --- client/components/router.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/components/router.jsx') diff --git a/client/components/router.jsx b/client/components/router.jsx index 59ea7c3..fa552fc 100644 --- a/client/components/router.jsx +++ b/client/components/router.jsx @@ -1,18 +1,18 @@ import { useContext } from 'react'; import { Routes, Route, Navigate } from 'react-router-dom'; import { Home } from './home/_home'; -import { SettingsContext } from '../utils/settings_context'; +import { AuthContext } from '../utils/auth_context'; import { SignIn } from './sign_in/_sign_in'; import { SignUp } from './sign_up/_sign_up'; export const Router = () => { - const [settings] = useContext(SettingsContext); - const { jwt } = settings; + const [authToken] = useContext(AuthContext); + return ( : } // no jwt means not logged in + element={authToken ? : } // no jwt means not logged in /> } /> } /> -- cgit v1.2.3-70-g09d2