Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
V2 future stuff
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent c611253 commit cdaef74
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 28 deletions.
30 changes: 26 additions & 4 deletions app/root.tsx
Expand Up @@ -11,14 +11,17 @@ import fontStyle from "@fontsource/plus-jakarta-sans/index.css";
import Forbidden from "../components/Forbidden.js";
import globalStyles from "../index.css";
import {
isRouteErrorResponse,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
useCatch,
useLoaderData,
useRouteError,
} from "@remix-run/react";
import { type ErrorResponse } from "@remix-run/router";
import { LinksFunction } from "@remix-run/cloudflare";
import Login from "../components/Login.js";
import Navigation from "../components/Navigation.js";
Expand All @@ -28,7 +31,28 @@ import theme from "../theme.js";
import { withEmotionCache } from "@emotion/react";

export function CatchBoundary() {
const { status } = useCatch();
const error = useRouteError() as ErrorResponse;

if (!isRouteErrorResponse(error))
return getMarkup(
{ hide: true },
<Container maxW="container.lg" pt="8vh" textAlign="left">
<Heading size="4xl">???</Heading>
<br />
<Text fontSize="xl">Something bad happened!</Text>
<br />
<br />
<br />
<Text>Details: {error}</Text>
<br />
<br />
<Link color="#646cff" onClick={location.reload}>
Refresh
</Link>
</Container>
);

const { status } = error;

switch (status) {
case 303:
Expand Down Expand Up @@ -98,9 +122,7 @@ export async function loader({
}

export function meta() {
return {
title: "Car Crushers",
};
return [{ title: "Car Crushers" }];
}

function getMarkup(
Expand Down
8 changes: 5 additions & 3 deletions app/routes/admin-application.tsx
Expand Up @@ -9,9 +9,11 @@ import {
} from "@chakra-ui/react";

export function meta() {
return {
title: "Admin Application - Car Crushers",
};
return [
{
title: "Admin Application - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/appeals.tsx
Expand Up @@ -53,9 +53,11 @@ export async function loader({ context }: { context: RequestContext }) {
}

export function meta() {
return {
title: "Appeals - Car Crushers",
};
return [
{
title: "Appeals - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/mod-queue.tsx
Expand Up @@ -78,9 +78,11 @@ export async function loader({ context }: { context: RequestContext }) {
}

export function meta() {
return {
title: "Moderation Queue - Car Crushers",
};
return [
{
title: "Moderation Queue - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/privacy.tsx
@@ -1,9 +1,11 @@
import { Container, Heading, Link, Text } from "@chakra-ui/react";

export function meta() {
return {
title: "Privacy Police - Car Crushers",
};
return [
{
title: "Privacy Policy - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/report.tsx
Expand Up @@ -28,9 +28,11 @@ export async function loader({
}

export function meta() {
return {
title: "Report an Exploiter - Car Crushers",
};
return [
{
title: "Report an Exploiter - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/support.tsx
Expand Up @@ -13,9 +13,11 @@ import {
} from "@chakra-ui/react";

export function meta() {
return {
title: "Support - Car Crushers",
};
return [
{
title: "Support - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/team.tsx
Expand Up @@ -12,9 +12,11 @@ import {
import team from "../../data/team.json";

export function meta() {
return {
title: "Our Team - Car Crushers",
};
return [
{
title: "Our Team - Car Crushers",
},
];
}

export default function () {
Expand Down
8 changes: 5 additions & 3 deletions app/routes/terms.tsx
@@ -1,9 +1,11 @@
import { Container, Heading, Link, Text } from "@chakra-ui/react";

export function meta() {
return {
title: "Terms and Conditions - Car Crushers",
};
return [
{
title: "Terms and Conditions - Car Crushers",
},
];
}

export default function () {
Expand Down
3 changes: 3 additions & 0 deletions remix.config.js
@@ -1,5 +1,8 @@
export default {
future: {
v2_errorBoundary: true,
v2_meta: true,
v2_normalizeFormMethod: true,
v2_routeConvention: true,
},
server: "./server.ts",
Expand Down

0 comments on commit cdaef74

Please sign in to comment.