This commit is contained in:
Atridad Lahiji 2023-11-27 18:32:31 -07:00
parent d5a53dbe35
commit fd3b1234e8
No known key found for this signature in database
3 changed files with 74 additions and 70 deletions

View file

@ -7,69 +7,71 @@ export default function FourOhFour() {
if (isRouteErrorResponse(error)) {
return (
<span className="text-center">
<h1 className="text-5xl font-bold m-2">Error {error.status}</h1>
<h1 className="text-5xl font-bold m-2">{error.statusText}</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
<h1 className="text-5xl font-bold m-2">Error {error.status}</h1>
<h1 className="text-5xl font-bold m-2">{error.data}</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
Back to Home
</Link>
</span>
Back to Home
</Link>
</span>
);
} else if (error instanceof Error) {
return (
<span className="text-center">
<h1 className="text-5xl font-bold m-2">Error 500</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
<span className="text-center">
<h1 className="text-5xl font-bold m-2">Error {error.name}</h1>
<h1 className="text-3xl font-bold m-2">Error {error.message}</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
Back to Home
</Link>
</span>
Back to Home
</Link>
</span>
);
} else {
return(
<span className="text-center">
<h1 className="text-5xl font-bold m-2">Error {error.status}</h1>
<h1 className="text-5xl font-bold m-2">{error.statusText}</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
return (
<span className="text-center">
<h1 className="text-5xl font-bold m-2">Error 500</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a
href="https://github.com/atridadl/sprintpadawan/issues/new"
className="link link-secondary"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
here
</a>
</h2>
<Link
about="Back to home."
to="/"
className="btn btn-secondary normal-case text-xl m-2"
>
Back to Home
</Link>
</span>)
Back to Home
</Link>
</span>
);
}
}

View file

@ -27,7 +27,6 @@ import { useUser } from "@clerk/remix";
import { db } from "~/services/db.server";
import { rooms } from "~/services/schema";
import { eq } from "drizzle-orm";
import { shitList } from "~/services/consts.server";
import FourOhFour from "~/components/FourOhFour";
import { isShit } from "~/services/helpers.server";
@ -44,21 +43,25 @@ export const loader: LoaderFunction = async (args) => {
});
if (!room) {
throw new Response(null, {
status: 404,
statusText:
"Oops! This room does not appear to exist, or may have been deleted!",
});
throw new Response(
"Oops! This room does not appear to exist, or may have been deleted!",
{
status: 404,
statusText: "NOT FOUND",
}
);
}
const email = sessionClaims.email as string;
if (isShit(email)) {
throw new Response(null, {
status: 404,
statusText:
"Wowee zowee! I'm sure I put that room around here somewhere...",
});
const shit = isShit(email);
if (shit) {
throw new Response(
"Wowee zowee! I'm sure I put that room around here somewhere...",
{
status: 404,
statusText: "NOT FOUND",
}
);
}
return {};

View file

@ -1 +0,0 @@
export const shitList = ["ama.ab.ca"];