-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.tsx
67 lines (63 loc) · 1.74 KB
/
root.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { useEffect } from "react";
import {
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import Navbar from "./components/Navbar.client";
// @ts-ignore
import styles from "./index.css?url";
import ScrollToHashElement from "./components/ScrollToHashElement";
import LinkToMain from "./components/layout/LinkToMain";
import { ClientOnly } from "remix-utils/client-only";
import Banner from "./components/layout/Banner";
import type { LinksFunction, MetaFunction } from "@remix-run/node";
import Analytics from "./components/Analytics";
export const meta: MetaFunction = () => {
return [
{ charset: "utf-8" },
{ title: "Data By Design" },
{ name: "viewport", content: "width=device-width,initial-scale=1" },
];
};
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];
};
export default function App() {
useEffect(() => {
if (process.env.NODE_ENV == "production") {
// @ts-ignore
window.hypothesisConfig = function () {
return {
openSidebar: false,
showHighlights: false,
};
};
const head = document.querySelector("head");
const script = document.createElement("script");
script.setAttribute("src", "https://hypothes.is/embed.js");
script.async = true;
head?.appendChild(script);
}
}, []);
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<body className="overflow-x-hidden">
<ScrollToHashElement />
<LinkToMain />
<ClientOnly>{() => <Navbar />}</ClientOnly>
<Banner>Public Beta</Banner>
<Outlet />
<Analytics />
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}