-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
46 changed files
with
257 additions
and
2,811 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
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,41 +1,7 @@ | ||
import { FluentProvider } from "@fluentui/react-components"; | ||
import React, { useMemo } from "react"; | ||
import { HashRouter, Route, Routes } from "react-router-dom"; | ||
import { useAppContext } from "./context/ApplicationStateProvider"; | ||
import { MainPage } from "./main-page"; | ||
import { PageNotFound } from "./routing/page-not-found"; | ||
import { getRouteByGroup, RouteGroup } from "./routing/route-map"; | ||
import { routes } from "./routing/routes"; | ||
import { useScrollStaticStyles } from "@axiscommunications/fluent-styles"; | ||
import { WelcomePage } from "./landingpage"; | ||
|
||
import React from "react"; | ||
export const App = () => { | ||
useScrollStaticStyles(); | ||
const theme = useAppContext((context) => context.theme); | ||
const dir = useAppContext((context) => context.dir); | ||
|
||
const storyRoutes = getRouteByGroup(RouteGroup.STORY); | ||
|
||
const renderStoryRoutes = useMemo( | ||
() => | ||
Array.from(storyRoutes.entries()).map((entry) => { | ||
const [key, [route, routeData]] = entry; | ||
return <Route key={key} path={route} element={routeData.element} />; | ||
}), | ||
[storyRoutes] | ||
); | ||
|
||
return ( | ||
<FluentProvider theme={theme} dir={dir}> | ||
<HashRouter> | ||
<Routes> | ||
<Route path={routes.Home} element={<MainPage />}> | ||
<Route index element={<WelcomePage />} /> | ||
{renderStoryRoutes} | ||
<Route path="*" element={<PageNotFound />} /> | ||
</Route> | ||
</Routes> | ||
</HashRouter> | ||
</FluentProvider> | ||
<p>Denna sida är under debugging :D</p> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.