84 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-06-27 00:28:54 +00:00
// import type { MetaFunction } from "@vercel/remix"
2023-06-23 03:59:14 +00:00
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
2023-07-15 08:08:36 +00:00
ScrollRestoration,
} from "@remix-run/react"
import { Analytics } from "@vercel/analytics/react"
2023-06-23 03:59:14 +00:00
2023-07-15 08:08:36 +00:00
import { Main } from "./components/Layout/Main"
2023-07-21 13:33:47 +00:00
import { useIcons } from "./hooks/useIcons"
2023-07-15 08:08:36 +00:00
import { ChakraWrapper } from "./Providers/Chakra/ChakraWrapper"
import { ThingtimeProvider } from "./Providers/ThingtimeProvider"
function Document({
children,
2023-07-15 08:08:36 +00:00
title = "Thingtime",
}: {
children: React.ReactNode
title?: string
}) {
2023-06-23 03:59:14 +00:00
return (
2023-07-15 08:08:36 +00:00
<html lang="en">
2023-06-23 03:59:14 +00:00
<head>
2023-07-15 08:08:36 +00:00
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
2023-06-23 03:59:14 +00:00
<Meta />
<title>{title}</title>
2023-06-23 03:59:14 +00:00
<Links />
</head>
<body>
{children}
2023-06-23 03:59:14 +00:00
<ScrollRestoration />
<Scripts />
<LiveReload />
2023-06-23 03:59:14 +00:00
<Analytics />
</body>
</html>
)
}
2023-07-15 08:08:36 +00:00
export default function App() {
2023-07-21 13:33:47 +00:00
useIcons()
return (
<Document>
<ChakraWrapper>
<ThingtimeProvider>
<Main>
<Outlet />
</Main>
</ThingtimeProvider>
</ChakraWrapper>
</Document>
)
2023-06-23 03:59:14 +00:00
}
2023-06-29 11:06:58 +00:00
// limiter
2023-07-15 08:08:36 +00:00
const setThingtime = (glob) => {
try {
glob.meta = {
tmp: {},
2023-06-30 00:06:07 +00:00
subscribers: {},
state: {},
things: {
db: {},
limit: 9999,
maxDepth: 10,
2023-07-15 08:08:36 +00:00
count: 0,
},
2023-06-29 11:06:58 +00:00
}
} catch (err) {
// will error on server
2023-06-29 11:06:58 +00:00
}
}
try {
setThingtime(window)
} catch {
setThingtime(globalThis)
}