refactor: code refactor
This commit is contained in:
98
app/root.tsx
98
app/root.tsx
@@ -1,5 +1,5 @@
|
||||
import codeHikeStyle from "@code-hike/mdx/dist/index.css";
|
||||
import type { LinksFunction, MetaFunction } from "@remix-run/node";
|
||||
import type { LinksFunction, V2_MetaFunction } from "@remix-run/node";
|
||||
import {
|
||||
Link,
|
||||
Links,
|
||||
@@ -8,19 +8,31 @@ import {
|
||||
Outlet,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
isRouteErrorResponse,
|
||||
useRouteError,
|
||||
} from "@remix-run/react";
|
||||
import stylesheet from "~/tailwind.css";
|
||||
import { Body } from "./components/Body";
|
||||
import { LinkWrapper } from "./components/LinkWrapper";
|
||||
import { Notbyai } from "./components/Notbyai";
|
||||
|
||||
export const links: LinksFunction = () => [
|
||||
{ rel: "stylesheet", href: stylesheet },
|
||||
{ rel: "stylesheet", href: codeHikeStyle },
|
||||
];
|
||||
|
||||
export const meta: MetaFunction = () => ({
|
||||
charset: "utf-8",
|
||||
title: "nullndr",
|
||||
viewport: "width=device-width,initial-scale=1",
|
||||
});
|
||||
export const meta: V2_MetaFunction = () => [
|
||||
{
|
||||
charSet: "utf-8",
|
||||
},
|
||||
{
|
||||
title: "nullndr",
|
||||
},
|
||||
{
|
||||
property: "viewport",
|
||||
content: "width=device-width,initial-scale=1",
|
||||
},
|
||||
];
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -29,70 +41,68 @@ export default function App() {
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<body className="bg-[#202020] text-[#d6d6d6] font-['monospace']">
|
||||
<div className="static sm:relative">
|
||||
<Body>
|
||||
<div className="relative">
|
||||
<Outlet />
|
||||
<div className="fixed m-3 bottom-0 right-0">
|
||||
<a href="https://notbyai.fyi/" target="_blank">
|
||||
<img src="https://user-images.githubusercontent.com/62137266/225653923-a69103f5-b318-4e52-9ea1-95b61d388366.svg" />
|
||||
</a>
|
||||
</div>
|
||||
<Notbyai />
|
||||
</div>
|
||||
<ScrollRestoration />
|
||||
<Scripts />
|
||||
<LiveReload />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
export function CatchBoundary() {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<body className="bg-[#202020] text-[#d6d6d6] font-['monospace']">
|
||||
<div className="flex flex-col items-center justify-around h-[100vh]">
|
||||
<div>
|
||||
<div className="text-center text-[#ffff00] text-[10vw] font-bold">
|
||||
404
|
||||
</div>
|
||||
<div className="font-bold">Where do you think you are going?</div>
|
||||
<div className="text-center">
|
||||
<div className="mt-5 hover:text-[#e6c2bf] lg:text-xl font-bold">
|
||||
<Link to="/">Home</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</Body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
export function ErrorBoundary() {
|
||||
const error = useRouteError();
|
||||
|
||||
if (isRouteErrorResponse(error)) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<Body>
|
||||
<div className="flex flex-col items-center justify-around h-[100vh]">
|
||||
<div>
|
||||
<div className="text-center text-[#ffff00] text-[10vw] font-bold">
|
||||
404
|
||||
</div>
|
||||
<div className="font-bold">Where do you think you are going?</div>
|
||||
<div className="text-center">
|
||||
<LinkWrapper>
|
||||
<Link to="/">Home</Link>
|
||||
</LinkWrapper>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<body className="bg-[#202020] text-[#d6d6d6] font-['monospace']">
|
||||
<Body>
|
||||
<div className="flex flex-col items-center justify-around h-[100vh]">
|
||||
<div>
|
||||
<div className="text-center text-[#ffff00] text-[6vw] font-bold">
|
||||
Something bad happened
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<div className="mt-5 hover:text-[#e6c2bf] lg:text-xl font-bold">
|
||||
<LinkWrapper>
|
||||
<Link to="/">Home</Link>
|
||||
</div>
|
||||
</LinkWrapper>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</Body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user