|
|
@ -3,7 +3,6 @@ import { ThemeProvider } from '@mui/material/styles'; |
|
|
|
import CssBaseline from '@mui/material/CssBaseline'; |
|
|
|
import CssBaseline from '@mui/material/CssBaseline'; |
|
|
|
import { OnboardingProvider } from '@/contexts/OnboardingContext'; |
|
|
|
import { OnboardingProvider } from '@/contexts/OnboardingContext'; |
|
|
|
import { BrowserNGLdoProvider, useNextGraphAuth } from '@/lib/nextgraph'; |
|
|
|
import { BrowserNGLdoProvider, useNextGraphAuth } from '@/lib/nextgraph'; |
|
|
|
import type { NextGraphAuth } from '@/types/nextgraph'; |
|
|
|
|
|
|
|
import DashboardLayout from '@/components/layout/DashboardLayout'; |
|
|
|
import DashboardLayout from '@/components/layout/DashboardLayout'; |
|
|
|
import SocialContractPage from '@/pages/SocialContractPage'; |
|
|
|
import SocialContractPage from '@/pages/SocialContractPage'; |
|
|
|
import GroupJoinPage from '@/pages/GroupJoinPage'; |
|
|
|
import GroupJoinPage from '@/pages/GroupJoinPage'; |
|
|
@ -22,10 +21,11 @@ import AccountPage from '@/pages/AccountPage'; |
|
|
|
import NotificationsPage from '@/pages/NotificationsPage'; |
|
|
|
import NotificationsPage from '@/pages/NotificationsPage'; |
|
|
|
import { createAppTheme } from '@/theme/theme'; |
|
|
|
import { createAppTheme } from '@/theme/theme'; |
|
|
|
import { Container, Box, Typography, Button } from '@mui/material'; |
|
|
|
import { Container, Box, Typography, Button } from '@mui/material'; |
|
|
|
|
|
|
|
import { isNextGraphEnabled } from '@/utils/featureFlags'; |
|
|
|
|
|
|
|
|
|
|
|
const theme = createAppTheme('light'); |
|
|
|
const theme = createAppTheme('light'); |
|
|
|
|
|
|
|
|
|
|
|
const AppContent = () => { |
|
|
|
const NextGraphAppContent = () => { |
|
|
|
const nextGraphAuth = useNextGraphAuth(); |
|
|
|
const nextGraphAuth = useNextGraphAuth(); |
|
|
|
const { session, login, logout } = nextGraphAuth || {}; |
|
|
|
const { session, login, logout } = nextGraphAuth || {}; |
|
|
|
|
|
|
|
|
|
|
@ -86,37 +86,53 @@ const AppContent = () => { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return <AppRoutes />; |
|
|
|
<OnboardingProvider> |
|
|
|
}; |
|
|
|
<Router> |
|
|
|
|
|
|
|
<Routes> |
|
|
|
const MockAppContent = () => { |
|
|
|
<Route path="/onboarding" element={<SocialContractPage />} /> |
|
|
|
return <AppRoutes />; |
|
|
|
<Route path="/join-group" element={<GroupJoinPage />} /> |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
<Route path="/*" element={ |
|
|
|
const AppRoutes = () => ( |
|
|
|
<DashboardLayout> |
|
|
|
<OnboardingProvider> |
|
|
|
<Routes> |
|
|
|
<Router> |
|
|
|
<Route path="/" element={<FeedPage />} /> |
|
|
|
<Routes> |
|
|
|
<Route path="/feed" element={<FeedPage />} /> |
|
|
|
<Route path="/onboarding" element={<SocialContractPage />} /> |
|
|
|
<Route path="/import" element={<ImportPage />} /> |
|
|
|
<Route path="/join-group" element={<GroupJoinPage />} /> |
|
|
|
<Route path="/contacts" element={<ContactListPage />} /> |
|
|
|
|
|
|
|
<Route path="/contacts/:id" element={<ContactViewPage />} /> |
|
|
|
<Route path="/*" element={ |
|
|
|
<Route path="/groups" element={<GroupPage />} /> |
|
|
|
<DashboardLayout> |
|
|
|
<Route path="/groups/:groupId" element={<GroupDetailPage />} /> |
|
|
|
<Routes> |
|
|
|
<Route path="/groups/:groupId/info" element={<GroupInfoPage />} /> |
|
|
|
<Route path="/" element={<FeedPage />} /> |
|
|
|
<Route path="/posts" element={<PostsOffersPage />} /> |
|
|
|
<Route path="/feed" element={<FeedPage />} /> |
|
|
|
<Route path="/messages" element={<MessagesPage />} /> |
|
|
|
<Route path="/import" element={<ImportPage />} /> |
|
|
|
<Route path="/notifications" element={<NotificationsPage />} /> |
|
|
|
<Route path="/contacts" element={<ContactListPage />} /> |
|
|
|
<Route path="/account" element={<AccountPage />} /> |
|
|
|
<Route path="/contacts/:id" element={<ContactViewPage />} /> |
|
|
|
<Route path="/invite" element={<InvitationPage />} /> |
|
|
|
<Route path="/groups" element={<GroupPage />} /> |
|
|
|
<Route path="/onboarding/setup" element={<OnboardingPage />} /> |
|
|
|
<Route path="/groups/:groupId" element={<GroupDetailPage />} /> |
|
|
|
</Routes> |
|
|
|
<Route path="/groups/:groupId/info" element={<GroupInfoPage />} /> |
|
|
|
</DashboardLayout> |
|
|
|
<Route path="/posts" element={<PostsOffersPage />} /> |
|
|
|
} /> |
|
|
|
<Route path="/messages" element={<MessagesPage />} /> |
|
|
|
</Routes> |
|
|
|
<Route path="/notifications" element={<NotificationsPage />} /> |
|
|
|
</Router> |
|
|
|
<Route path="/account" element={<AccountPage />} /> |
|
|
|
</OnboardingProvider> |
|
|
|
<Route path="/invite" element={<InvitationPage />} /> |
|
|
|
); |
|
|
|
<Route path="/onboarding/setup" element={<OnboardingPage />} /> |
|
|
|
|
|
|
|
</Routes> |
|
|
|
|
|
|
|
</DashboardLayout> |
|
|
|
|
|
|
|
} /> |
|
|
|
|
|
|
|
</Routes> |
|
|
|
|
|
|
|
</Router> |
|
|
|
|
|
|
|
</OnboardingProvider> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AppContent = () => { |
|
|
|
|
|
|
|
const useNextGraph = isNextGraphEnabled(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (useNextGraph) { |
|
|
|
|
|
|
|
return <NextGraphAppContent />; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <MockAppContent />; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function App() { |
|
|
|
function App() { |
|
|
@ -124,9 +140,13 @@ function App() { |
|
|
|
<ThemeProvider theme={theme}> |
|
|
|
<ThemeProvider theme={theme}> |
|
|
|
<CssBaseline /> |
|
|
|
<CssBaseline /> |
|
|
|
<Container maxWidth="lg"> |
|
|
|
<Container maxWidth="lg"> |
|
|
|
<BrowserNGLdoProvider> |
|
|
|
{isNextGraphEnabled() ? ( |
|
|
|
|
|
|
|
<BrowserNGLdoProvider> |
|
|
|
|
|
|
|
<AppContent /> |
|
|
|
|
|
|
|
</BrowserNGLdoProvider> |
|
|
|
|
|
|
|
) : ( |
|
|
|
<AppContent /> |
|
|
|
<AppContent /> |
|
|
|
</BrowserNGLdoProvider> |
|
|
|
)} |
|
|
|
</Container> |
|
|
|
</Container> |
|
|
|
</ThemeProvider> |
|
|
|
</ThemeProvider> |
|
|
|
); |
|
|
|
); |
|
|
|