2022-10-18 19:28:37 +00:00
|
|
|
import type { LinksFunction, LoaderArgs, MetaFunction } from "@remix-run/node";
|
|
|
|
import {
|
|
|
|
Links,
|
|
|
|
LiveReload,
|
|
|
|
Meta,
|
|
|
|
Outlet,
|
|
|
|
Scripts,
|
|
|
|
ScrollRestoration,
|
|
|
|
useLoaderData,
|
|
|
|
} from "@remix-run/react";
|
|
|
|
import { Layout } from "./components/Layout";
|
|
|
|
import styles from "./styles/dark.css";
|
2023-08-06 16:10:55 +00:00
|
|
|
import global from "./styles/style.css";
|
2022-10-18 19:28:37 +00:00
|
|
|
|
|
|
|
export const links: LinksFunction = () => {
|
|
|
|
return [
|
|
|
|
{ rel: "stylesheet", href: styles },
|
|
|
|
{ rel: "stylesheet", href: global },
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
export const meta: MetaFunction = () => ({
|
|
|
|
charset: "utf-8",
|
|
|
|
title: "Tubearchivist",
|
|
|
|
viewport: "width=device-width,initial-scale=1",
|
|
|
|
});
|
|
|
|
|
|
|
|
export async function loader({ request }: LoaderArgs) {
|
|
|
|
return {
|
|
|
|
ENV: {
|
2022-10-18 20:08:59 +00:00
|
|
|
PUBLIC_API_URL: process.env.PUBLIC_API_URL,
|
2022-10-18 19:28:37 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function App() {
|
2023-08-06 16:10:55 +00:00
|
|
|
const data = useLoaderData<typeof loader>();
|
2022-10-18 19:28:37 +00:00
|
|
|
return (
|
2023-08-06 16:10:55 +00:00
|
|
|
<html lang="en">
|
2022-10-18 19:28:37 +00:00
|
|
|
<head>
|
|
|
|
<Meta />
|
|
|
|
<Links />
|
|
|
|
</head>
|
2023-08-06 16:10:55 +00:00
|
|
|
<body>
|
2022-10-18 19:28:37 +00:00
|
|
|
<Layout>
|
|
|
|
<Outlet />
|
|
|
|
</Layout>
|
|
|
|
<script
|
|
|
|
dangerouslySetInnerHTML={{
|
|
|
|
__html: `window.ENV = ${JSON.stringify(data.ENV)}`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<ScrollRestoration />
|
|
|
|
<Scripts />
|
|
|
|
<LiveReload />
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
);
|
|
|
|
}
|