V2 future stuff

This commit is contained in:
regalijan 2023-10-19 16:49:36 -04:00
parent c611253c4a
commit cdaef74d37
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520
10 changed files with 69 additions and 28 deletions

View File

@ -11,6 +11,7 @@ import fontStyle from "@fontsource/plus-jakarta-sans/index.css";
import Forbidden from "../components/Forbidden.js"; import Forbidden from "../components/Forbidden.js";
import globalStyles from "../index.css"; import globalStyles from "../index.css";
import { import {
isRouteErrorResponse,
Links, Links,
LiveReload, LiveReload,
Meta, Meta,
@ -18,7 +19,9 @@ import {
Scripts, Scripts,
useCatch, useCatch,
useLoaderData, useLoaderData,
useRouteError,
} from "@remix-run/react"; } from "@remix-run/react";
import { type ErrorResponse } from "@remix-run/router";
import { LinksFunction } from "@remix-run/cloudflare"; import { LinksFunction } from "@remix-run/cloudflare";
import Login from "../components/Login.js"; import Login from "../components/Login.js";
import Navigation from "../components/Navigation.js"; import Navigation from "../components/Navigation.js";
@ -28,7 +31,28 @@ import theme from "../theme.js";
import { withEmotionCache } from "@emotion/react"; import { withEmotionCache } from "@emotion/react";
export function CatchBoundary() { 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) { switch (status) {
case 303: case 303:
@ -98,9 +122,7 @@ export async function loader({
} }
export function meta() { export function meta() {
return { return [{ title: "Car Crushers" }];
title: "Car Crushers",
};
} }
function getMarkup( function getMarkup(

View File

@ -9,9 +9,11 @@ import {
} from "@chakra-ui/react"; } from "@chakra-ui/react";
export function meta() { export function meta() {
return { return [
{
title: "Admin Application - Car Crushers", title: "Admin Application - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -53,9 +53,11 @@ export async function loader({ context }: { context: RequestContext }) {
} }
export function meta() { export function meta() {
return { return [
{
title: "Appeals - Car Crushers", title: "Appeals - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -78,9 +78,11 @@ export async function loader({ context }: { context: RequestContext }) {
} }
export function meta() { export function meta() {
return { return [
{
title: "Moderation Queue - Car Crushers", title: "Moderation Queue - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -1,9 +1,11 @@
import { Container, Heading, Link, Text } from "@chakra-ui/react"; import { Container, Heading, Link, Text } from "@chakra-ui/react";
export function meta() { export function meta() {
return { return [
title: "Privacy Police - Car Crushers", {
}; title: "Privacy Policy - Car Crushers",
},
];
} }
export default function () { export default function () {

View File

@ -28,9 +28,11 @@ export async function loader({
} }
export function meta() { export function meta() {
return { return [
{
title: "Report an Exploiter - Car Crushers", title: "Report an Exploiter - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -13,9 +13,11 @@ import {
} from "@chakra-ui/react"; } from "@chakra-ui/react";
export function meta() { export function meta() {
return { return [
{
title: "Support - Car Crushers", title: "Support - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -12,9 +12,11 @@ import {
import team from "../../data/team.json"; import team from "../../data/team.json";
export function meta() { export function meta() {
return { return [
{
title: "Our Team - Car Crushers", title: "Our Team - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -1,9 +1,11 @@
import { Container, Heading, Link, Text } from "@chakra-ui/react"; import { Container, Heading, Link, Text } from "@chakra-ui/react";
export function meta() { export function meta() {
return { return [
{
title: "Terms and Conditions - Car Crushers", title: "Terms and Conditions - Car Crushers",
}; },
];
} }
export default function () { export default function () {

View File

@ -1,5 +1,8 @@
export default { export default {
future: { future: {
v2_errorBoundary: true,
v2_meta: true,
v2_normalizeFormMethod: true,
v2_routeConvention: true, v2_routeConvention: true,
}, },
server: "./server.ts", server: "./server.ts",