-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from ClioDynamics/tos_page
Tos page [WIP]
- Loading branch information
Showing
3 changed files
with
458 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,125 @@ | ||
import { MantineProvider } from "@mantine/core" | ||
import { ModalsProvider } from "@mantine/modals" | ||
import { Notifications } from "@mantine/notifications" | ||
import { SessionContextProvider } from "@supabase/auth-helpers-react" | ||
import { createClient } from "@supabase/supabase-js" | ||
import { PostHogProvider } from "posthog-js/react" | ||
import React from "react" | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom" | ||
import "./App.css" | ||
import LoadingOverlay from "./components/LoadingOverlay/LoadingOverlay" | ||
import OAuthUser from "./components/OAuthUser" | ||
import constants from "./constants/constants" | ||
import Error404 from "./pages/404/Error404" | ||
import FriendProfile from "./pages/app/FriendProfile" | ||
import RoomLayout from "./pages/app/Room/index" | ||
import Root from "./pages/app/root" | ||
import UserPreferences from "./pages/app/UserPreferences/UserPreferences" | ||
import UserProfile from "./pages/app/UserProfile" | ||
import { MantineProvider } from "@mantine/core"; | ||
import { ModalsProvider } from "@mantine/modals"; | ||
import { Notifications } from "@mantine/notifications"; | ||
import { SessionContextProvider } from "@supabase/auth-helpers-react"; | ||
import { createClient } from "@supabase/supabase-js"; | ||
import { PostHogProvider } from "posthog-js/react"; | ||
import React from "react"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
import "./App.css"; | ||
import LoadingOverlay from "./components/LoadingOverlay/LoadingOverlay"; | ||
import OAuthUser from "./components/OAuthUser"; | ||
import constants from "./constants/constants"; | ||
import Error404 from "./pages/404/Error404"; | ||
import FriendProfile from "./pages/app/FriendProfile"; | ||
import RoomLayout from "./pages/app/Room/index"; | ||
import Root from "./pages/app/root"; | ||
import UserPreferences from "./pages/app/UserPreferences/UserPreferences"; | ||
import UserProfile from "./pages/app/UserProfile"; | ||
import Tos from "./pages/app/Tos"; | ||
|
||
const supabase = createClient( | ||
constants.supabaseUrl || "", | ||
constants.supabaseAnonKey || "" | ||
) | ||
constants.supabaseUrl || "", | ||
constants.supabaseAnonKey || "" | ||
); | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Root />, | ||
errorElement: <Error404 />, | ||
children: [ | ||
{ | ||
path: "/chat/:roomId", | ||
element: <RoomLayout /> | ||
}, | ||
{ | ||
path: "/account", | ||
element: <UserPreferences /> | ||
}, | ||
{ | ||
path: "/profile", | ||
element: <UserProfile /> | ||
}, | ||
{ | ||
path: "/friend", | ||
element: <FriendProfile /> | ||
} | ||
] | ||
}, | ||
{ | ||
path: "/login", | ||
element: <OAuthUser /> | ||
} | ||
]) | ||
{ | ||
path: "/", | ||
element: <Root />, | ||
errorElement: <Error404 />, | ||
children: [ | ||
{ | ||
path: "/chat/:roomId", | ||
element: <RoomLayout />, | ||
}, | ||
{ | ||
path: "/account", | ||
element: <UserPreferences />, | ||
}, | ||
{ | ||
path: "/profile", | ||
element: <UserProfile />, | ||
}, | ||
{ | ||
path: "/friend", | ||
element: <FriendProfile />, | ||
}, | ||
], | ||
}, | ||
{ | ||
path: "/tos", | ||
element: <Tos />, | ||
}, | ||
{ | ||
path: "/login", | ||
element: <OAuthUser />, | ||
}, | ||
]); | ||
|
||
const App = (): JSX.Element => { | ||
return ( | ||
<SessionContextProvider supabaseClient={supabase}> | ||
<MantineProvider | ||
theme={{ | ||
colorScheme: "dark", | ||
primaryColor: "blue", | ||
defaultRadius: "md", | ||
colors: { | ||
// override dark colors to change them for all components | ||
dark: [ | ||
"#c2c2c2", | ||
"#a7a7a7", | ||
"#7e7e7e", | ||
"#636363", | ||
"#474747", | ||
"#3f3f3f", | ||
"#202020", | ||
"#1a1a1a", | ||
"#141414", | ||
"#111111" | ||
] | ||
}, | ||
components: { | ||
Button: { | ||
defaultProps: { | ||
size: "xs", | ||
color: "blue" | ||
} | ||
} | ||
}, | ||
fontSizes: { | ||
xxl: "1.75rem", | ||
"2xl": "2.25rem" | ||
}, | ||
spacing: { | ||
xxl: "1.75rem", | ||
"2xl": "2rem", | ||
"3xl": "3rem", | ||
"4xl": "4rem", | ||
"5xl": "5rem", | ||
"6xl": "6rem", | ||
"7xl": "7rem", | ||
"8xl": "8rem" | ||
} | ||
}} | ||
withGlobalStyles | ||
> | ||
<PostHogProvider | ||
apiKey={constants.posthogApiKey} | ||
options={{ | ||
api_host: "https://app.posthog.com" | ||
}} | ||
> | ||
<Notifications /> | ||
<ModalsProvider> | ||
<RouterProvider router={router} /> | ||
<LoadingOverlay /> | ||
</ModalsProvider> | ||
</PostHogProvider> | ||
</MantineProvider> | ||
</SessionContextProvider> | ||
) | ||
} | ||
return ( | ||
<SessionContextProvider supabaseClient={supabase}> | ||
<MantineProvider | ||
theme={{ | ||
colorScheme: "dark", | ||
primaryColor: "blue", | ||
defaultRadius: "md", | ||
colors: { | ||
// override dark colors to change them for all components | ||
dark: [ | ||
"#c2c2c2", | ||
"#a7a7a7", | ||
"#7e7e7e", | ||
"#636363", | ||
"#474747", | ||
"#3f3f3f", | ||
"#202020", | ||
"#1a1a1a", | ||
"#141414", | ||
"#111111", | ||
], | ||
}, | ||
components: { | ||
Button: { | ||
defaultProps: { | ||
size: "xs", | ||
color: "blue", | ||
}, | ||
}, | ||
}, | ||
fontSizes: { | ||
xxl: "1.75rem", | ||
"2xl": "2.25rem", | ||
}, | ||
spacing: { | ||
xxl: "1.75rem", | ||
"2xl": "2rem", | ||
"3xl": "3rem", | ||
"4xl": "4rem", | ||
"5xl": "5rem", | ||
"6xl": "6rem", | ||
"7xl": "7rem", | ||
"8xl": "8rem", | ||
}, | ||
}} | ||
withGlobalStyles | ||
> | ||
<PostHogProvider | ||
apiKey={constants.posthogApiKey} | ||
options={{ | ||
api_host: "https://app.posthog.com", | ||
}} | ||
> | ||
<Notifications /> | ||
<ModalsProvider> | ||
<RouterProvider router={router} /> | ||
<LoadingOverlay /> | ||
</ModalsProvider> | ||
</PostHogProvider> | ||
</MantineProvider> | ||
</SessionContextProvider> | ||
); | ||
}; | ||
|
||
export default App | ||
export default App; |
Oops, something went wrong.