404 error boundary fixes
This commit is contained in:
parent
0ade9d7208
commit
1f1b9dc31f
4 changed files with 14 additions and 18 deletions
|
@ -1,12 +1,16 @@
|
||||||
import { Link } from "@remix-run/react";
|
import { Link, isRouteErrorResponse, useRouteError } from "@remix-run/react";
|
||||||
|
|
||||||
export default function FourOhFour() {
|
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 (
|
return (
|
||||||
<span className="text-center">
|
<span className="text-center">
|
||||||
<h1 className="text-5xl font-bold m-2">4️⃣0️⃣4️⃣</h1>
|
<h1 className="text-5xl font-bold m-2">4️⃣0️⃣4️⃣</h1>
|
||||||
<h1 className="text-5xl font-bold m-2">
|
<h1 className="text-5xl font-bold m-2">{message}</h1>
|
||||||
Oops! This room does not appear to exist, or may have been deleted! 😢
|
|
||||||
</h1>
|
|
||||||
<h2 className="text-2xl font-bold m-2">
|
<h2 className="text-2xl font-bold m-2">
|
||||||
If you believe you reached this page in error, please file an issue{" "}
|
If you believe you reached this page in error, please file an issue{" "}
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -45,7 +45,8 @@ export const loader: LoaderFunction = async (args) => {
|
||||||
if (!room) {
|
if (!room) {
|
||||||
throw new Response(null, {
|
throw new Response(null, {
|
||||||
status: 404,
|
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) {
|
if (isShit) {
|
||||||
throw new Response(null, {
|
throw new Response(null, {
|
||||||
status: 404,
|
status: 404,
|
||||||
statusText: "Not Found",
|
statusText:
|
||||||
|
"Wowee zowee! This wasn't supposed to happen! Maybe try refreshing the page... 🤔🧐",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
import { SignIn } from "@clerk/remix";
|
import { SignIn } from "@clerk/remix";
|
||||||
|
|
||||||
export default function SignInPage() {
|
export default function SignInPage() {
|
||||||
return (
|
return <SignIn />;
|
||||||
<div>
|
|
||||||
<h1>Sign In route</h1>
|
|
||||||
<SignIn />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
import { SignUp } from "@clerk/remix";
|
import { SignUp } from "@clerk/remix";
|
||||||
|
|
||||||
export default function SignUpPage() {
|
export default function SignUpPage() {
|
||||||
return (
|
return <SignUp />;
|
||||||
<div>
|
|
||||||
<h1>Sign Up route</h1>
|
|
||||||
<SignUp />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue