From c686261d43ba2af9d505caf1d375e81878f7f63d Mon Sep 17 00:00:00 2001 From: Christopher Maujean Date: Wed, 30 Jul 2025 09:30:18 -0700 Subject: [PATCH] implement hashrouter instead of browserrouter, add nextgraphauth logout to logout button --- src/App.tsx | 2 +- src/components/layout/DashboardLayout.tsx | 1 + src/pages/AccountPage.tsx | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4a0a38c..147493c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { HashRouter as Router, Routes, Route } from 'react-router-dom'; import { ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; import { OnboardingProvider } from '@/contexts/OnboardingContext'; diff --git a/src/components/layout/DashboardLayout.tsx b/src/components/layout/DashboardLayout.tsx index 113f787..455493f 100644 --- a/src/components/layout/DashboardLayout.tsx +++ b/src/components/layout/DashboardLayout.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from 'react'; import type { ReactNode } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; +import { useNextGraphAuth } from '@/lib/nextgraph'; import { Box, Drawer, diff --git a/src/pages/AccountPage.tsx b/src/pages/AccountPage.tsx index a0d4319..808b04a 100644 --- a/src/pages/AccountPage.tsx +++ b/src/pages/AccountPage.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import { useSearchParams } from 'react-router-dom'; +import { useNextGraphAuth } from '@/lib/nextgraph'; import { Typography, Box, @@ -59,6 +60,7 @@ const TabPanel = ({ children, value, index }: TabPanelProps) => { const AccountPage = () => { const theme = useTheme(); const [searchParams] = useSearchParams(); + const nextGraphAuth = useNextGraphAuth(); // Initialize tab from URL parameter const initialTab = parseInt(searchParams.get('tab') || '0', 10); @@ -599,9 +601,20 @@ const AccountPage = () => {