2022-04-17 11:50:39 -04:00

49 lines
962 B
TypeScript

import type { MetaFunction } from "@remix-run/node";
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import { createTheme, NextUIProvider } from "@nextui-org/react";
import useDarkMode from "use-dark-mode";
const lightTheme = createTheme({
type: "light",
theme: {},
});
const darkTheme = createTheme({
type: "dark",
theme: {},
});
export const meta: MetaFunction = () => ({
charset: "utf-8",
title: "Remix with NextUI",
viewport: "width=device-width,initial-scale=1",
});
export default function App() {
const darkMode = useDarkMode(false);
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<body>
<NextUIProvider theme={darkMode.value ? darkTheme : lightTheme}>
<Outlet />
<ScrollRestoration />
<Scripts />
<LiveReload />
</NextUIProvider>
</body>
</html>
);
}