404 error boundary fixes

This commit is contained in:
Atridad Lahiji 2023-11-27 11:49:46 -07:00
parent 861f497608
commit 11897d44a7
No known key found for this signature in database
4 changed files with 14 additions and 18 deletions

View file

@ -1,12 +1,16 @@
import { Link } from "@remix-run/react";
import { Link, isRouteErrorResponse, useRouteError } from "@remix-run/react";
export default function FourOhFour() {
const error = useRouteError();
let message =
"Oops! This room does not appear to exist, or may have been deleted! 😢";
if (isRouteErrorResponse(error)) {
message = error.statusText;
}
return (
<span className="text-center">
<h1 className="text-5xl font-bold m-2">404</h1>
<h1 className="text-5xl font-bold m-2">
Oops! This room does not appear to exist, or may have been deleted! 😢
</h1>
<h1 className="text-5xl font-bold m-2">{message}</h1>
<h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "}
<a

View file

@ -45,7 +45,8 @@ export const loader: LoaderFunction = async (args) => {
if (!room) {
throw new Response(null, {
status: 404,
statusText: "Not Found",
statusText:
"Oops! This room does not appear to exist, or may have been deleted! 😢",
});
}
@ -61,7 +62,8 @@ export const loader: LoaderFunction = async (args) => {
if (isShit) {
throw new Response(null, {
status: 404,
statusText: "Not Found",
statusText:
"Wowee zowee! This wasn't supposed to happen! Maybe try refreshing the page... 🤔🧐",
});
}

View file

@ -1,10 +1,5 @@
import { SignIn } from "@clerk/remix";
export default function SignInPage() {
return (
<div>
<h1>Sign In route</h1>
<SignIn />
</div>
);
return <SignIn />;
}

View file

@ -1,10 +1,5 @@
import { SignUp } from "@clerk/remix";
export default function SignUpPage() {
return (
<div>
<h1>Sign Up route</h1>
<SignUp />
</div>
);
return <SignUp />;
}