mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
26 lines
805 B
TypeScript
26 lines
805 B
TypeScript
import { SessionConsumer } from "contexts/session";
|
|
import type { FeatureBundle } from "framer-motion";
|
|
import { LazyMotion } from "framer-motion";
|
|
import { ThemeProvider } from "styled-components";
|
|
import GlobalStyle from "styles/GlobalStyle";
|
|
import themes from "styles/themes";
|
|
import { DEFAULT_THEME } from "utils/constants";
|
|
|
|
const motionFeatures = async (): Promise<FeatureBundle> =>
|
|
(await import("styles/motionFeatures")).default;
|
|
|
|
const StyledApp: FC = ({ children }) => (
|
|
<SessionConsumer>
|
|
{({ themeName }) => (
|
|
<ThemeProvider theme={themes[themeName] || themes[DEFAULT_THEME]}>
|
|
<GlobalStyle />
|
|
<LazyMotion features={motionFeatures} strict>
|
|
{children}
|
|
</LazyMotion>
|
|
</ThemeProvider>
|
|
)}
|
|
</SessionConsumer>
|
|
);
|
|
|
|
export default StyledApp;
|