76 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-06-27 00:28:54 +00:00
import { ChakraProvider } from '@chakra-ui/react'
// import type { MetaFunction } from "@vercel/remix"
2023-06-23 03:59:14 +00:00
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
2023-06-27 00:28:54 +00:00
ScrollRestoration
} from '@remix-run/react'
import { Analytics } from '@vercel/analytics/react'
2023-06-28 01:12:17 +00:00
import { Main } from './components/Layout/Main'
2023-06-23 03:59:14 +00:00
2023-06-27 00:28:54 +00:00
function Document ({
children,
2023-06-27 01:32:30 +00:00
title = 'Thingtime'
}: {
children: React.ReactNode
title?: string
}) {
2023-06-23 03:59:14 +00:00
return (
2023-06-27 00:28:54 +00:00
<html lang='en'>
2023-06-23 03:59:14 +00:00
<head>
2023-06-27 01:44:00 +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>
2023-06-28 01:12:17 +00:00
<Main>{children}</Main>
2023-06-23 03:59:14 +00:00
<ScrollRestoration />
<Scripts />
<LiveReload />
2023-06-23 03:59:14 +00:00
<Analytics />
</body>
</html>
)
}
2023-06-27 00:28:54 +00:00
export default function App () {
return (
<Document>
<ChakraProvider>
<Outlet />
</ChakraProvider>
</Document>
)
2023-06-23 03:59:14 +00:00
}
2023-06-29 11:06:58 +00:00
// limiter
const setThingtime = glob => {
try {
glob.thingtime = {
tmp: {},
2023-06-30 00:06:07 +00:00
subscribers: {},
state: {},
things: {
db: {},
limit: 9999,
maxDepth: 10,
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)
}