Files
artcraft/app/root.tsx
T
2024-03-21 21:55:11 -04:00

57 lines
1.3 KiB
TypeScript

import { useState } from 'react';
import { LinksFunction } from "@remix-run/deno";
import {
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import normalizeCss from "./styles/normalize.css?url";
import tailwindCss from "./styles/tailwind.css?url";
import baseCss from "./styles/base.css?url";
import { TopBar } from "./modules/TopBar";
import { TopBarInnerContext } from '~/contexts/TopBarInner';
export const links : LinksFunction = () => [{
rel: "stylesheet",
href: normalizeCss,
},{
rel: "stylesheet",
href: tailwindCss,
},{
rel: "stylesheet",
href: baseCss,
}];
export default function App() {
const [topBarInnerComponent, setTopBarInnerComponent] = useState<JSX.Element | null>(null);
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>
<body className="bg-ui-background">
<TopBarInnerContext.Provider value={{
TopBarInner: topBarInnerComponent,
setTopBarInner: setTopBarInnerComponent
}}>
<div className="topbar-spacer"/>
<Outlet />
<TopBar />
</TopBarInnerContext.Provider>
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}