Skip to content

Commit 9bc641d

Browse files
authored
An improved 404 page design (#1427)
* WIP improving the 404 page * Improved 404 page layout * Added a shortcut key * Removed old assets and code
1 parent a790759 commit 9bc641d

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

apps/webapp/app/components/ErrorDisplay.tsx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import { HomeIcon } from "@heroicons/react/20/solid";
12
import { isRouteErrorResponse, useRouteError } from "@remix-run/react";
2-
import { LinkButton } from "./primitives/Buttons";
3-
import { Header1, Header3 } from "./primitives/Headers";
3+
import { motion } from "framer-motion";
44
import { friendlyErrorDisplay } from "~/utils/httpErrors";
5+
import { LinkButton } from "./primitives/Buttons";
6+
import { Header1 } from "./primitives/Headers";
7+
import { Paragraph } from "./primitives/Paragraph";
58

69
type ErrorDisplayOptions = {
710
button?: {
@@ -39,12 +42,32 @@ type DisplayOptionsProps = {
3942

4043
export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
4144
return (
42-
<div className="p-4">
43-
<Header1 className="mb-4 border-b border-charcoal-800 pb-4">{title}</Header1>
44-
{message && <Header3>{message}</Header3>}
45-
<LinkButton to={button ? button.to : "/"} variant="primary/medium" className="mt-8">
46-
{button ? button.title : "Home"}
47-
</LinkButton>
45+
<div className="relative flex min-h-screen flex-col items-center justify-center bg-[#16181C]">
46+
<div className="z-10 mt-[30vh] flex flex-col items-center gap-8">
47+
<Header1>{title}</Header1>
48+
{message && <Paragraph>{message}</Paragraph>}
49+
<LinkButton
50+
to={button ? button.to : "/"}
51+
shortcut={{ modifiers: ["meta"], key: "g" }}
52+
variant="primary/medium"
53+
LeadingIcon={HomeIcon}
54+
>
55+
{button ? button.title : "Go to homepage"}
56+
</LinkButton>
57+
</div>
58+
<div className="pointer-events-none absolute bottom-4 right-4 z-10 h-[70px] w-[200px] bg-[rgb(24,26,30)]" />
59+
<motion.div
60+
className="pointer-events-none absolute inset-0 overflow-hidden"
61+
initial={{ opacity: 0 }}
62+
animate={{ opacity: 1 }}
63+
transition={{ delay: 0.5, duration: 2, ease: "easeOut" }}
64+
>
65+
<iframe
66+
src="https://my.spline.design/untitled-a6f70b5ebc46bdb2dcc0f21d5397e8ac/"
67+
className="pointer-events-none absolute inset-0 h-full w-full object-cover"
68+
style={{ border: "none" }}
69+
/>
70+
</motion.div>
4871
</div>
4972
);
5073
}

apps/webapp/app/routes/_app.orgs.$organizationSlug/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ export function ErrorBoundary() {
127127
return org ? (
128128
<RouteErrorDisplay button={{ title: org.title, to: organizationPath(org) }} />
129129
) : (
130-
<RouteErrorDisplay button={{ title: "Home", to: "/" }} />
130+
<RouteErrorDisplay button={{ title: "Go to homepage", to: "/" }} />
131131
);
132132
}

0 commit comments

Comments
 (0)