mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-08 13:41:51 +02:00
🐛 Link to support page on 404
This commit is contained in:
parent
afdbd1f3a1
commit
149e5bbe5e
2 changed files with 17 additions and 13 deletions
|
@ -3,12 +3,8 @@ import Link from "next/link";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { Button } from "@/components/button";
|
|
||||||
import Chat from "@/components/icons/chat.svg";
|
|
||||||
import EmojiSad from "@/components/icons/emoji-sad.svg";
|
import EmojiSad from "@/components/icons/emoji-sad.svg";
|
||||||
|
|
||||||
import { showCrispChat } from "./crisp-chat";
|
|
||||||
|
|
||||||
export interface ComponentProps {
|
export interface ComponentProps {
|
||||||
icon?: React.ComponentType<{ className?: string }>;
|
icon?: React.ComponentType<{ className?: string }>;
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -20,7 +16,7 @@ const ErrorPage: React.FunctionComponent<ComponentProps> = ({
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation("errors");
|
const { t } = useTranslation(["common", "errors"]);
|
||||||
return (
|
return (
|
||||||
<div className="flex h-[calc(100vh-100px)] w-full items-center justify-center">
|
<div className="flex h-[calc(100vh-100px)] w-full items-center justify-center">
|
||||||
<Head>
|
<Head>
|
||||||
|
@ -35,12 +31,16 @@ const ErrorPage: React.FunctionComponent<ComponentProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<p>{description}</p>
|
<p>{description}</p>
|
||||||
<div className="flex justify-center space-x-3">
|
<div className="flex justify-center space-x-3">
|
||||||
<Link href="/" passHref={true} className="btn-default">
|
<Link href="/" className="btn-primary">
|
||||||
{t("goToHome")}
|
{t("errors:goToHome")}
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="https://support.rallly.co"
|
||||||
|
passHref={true}
|
||||||
|
className="btn-default"
|
||||||
|
>
|
||||||
|
{t("support")}
|
||||||
</Link>
|
</Link>
|
||||||
<Button icon={<Chat />} onClick={showCrispChat}>
|
|
||||||
{t("startChat")}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
import { GetStaticProps, NextPage } from "next";
|
import { GetStaticProps } from "next";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import ErrorPage from "@/components/error-page";
|
import ErrorPage from "@/components/error-page";
|
||||||
import DocumentSearch from "@/components/icons/document-search.svg";
|
import DocumentSearch from "@/components/icons/document-search.svg";
|
||||||
|
import { getStandardLayout } from "@/components/layouts/standard-layout";
|
||||||
|
import { NextPageWithLayout } from "@/types";
|
||||||
|
|
||||||
const Custom404: NextPage = () => {
|
const Custom404: NextPageWithLayout = () => {
|
||||||
const { t } = useTranslation("errors");
|
const { t } = useTranslation("errors");
|
||||||
return (
|
return (
|
||||||
<ErrorPage
|
<ErrorPage
|
||||||
|
@ -17,10 +19,12 @@ const Custom404: NextPage = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Custom404.getLayout = getStandardLayout;
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
export const getStaticProps: GetStaticProps = async ({ locale = "en" }) => {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
...(await serverSideTranslations(locale, ["errors"])),
|
...(await serverSideTranslations(locale, ["common", "errors"])),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue