Skip to content

Commit

Permalink
fix(client): custom 404 page, prodrg force fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo committed Apr 21, 2023
1 parent 5246a43 commit c7ed6b1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/client/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ module.exports = {
defaultLocale: "en-US",
locales: ["en-US", "pt-BR"],
reloadOnPrerender: process.env.NODE_ENV === "development"
}
},
react: { useSuspense: false }
};
6 changes: 6 additions & 0 deletions apps/client/public/locales/en-US/common.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"errors": {
"404": {
"description": "Seems like you found something that can't be found. Just so you know, we recommend you to go back the way you came.",
"back-to-home": "Go back to Home"
}
},
"loading": "Loading..."
}
11 changes: 9 additions & 2 deletions apps/client/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import { ArrowLeft } from "lucide-react";
import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";

import { Button } from "@app/components/Button";
import { PageLayout } from "@app/components/Layout/Page";
import { withSSRTranslations } from "@app/hocs/withSSRTranslations";

export const getStaticProps = withSSRTranslations(undefined, {
namespaces: ["common"]
});

export default function Custom404() {
const router = useRouter();
const { t } = useTranslation(["common"]);

return (
<PageLayout title="common:errors.404.title">
<div className="m-auto flex flex-col gap-y-2">
<h1 className="text-[8rem] font-bold font-grotesk text-center">404</h1>
<p className="text-xl font-medium font-grotesk text-center">
common:errors.404.description
{t("common:errors.404.description")}
</p>
<Button
LeftIcon={ArrowLeft}
onClick={() => router.replace("/")}
>
common:errors.404.back-to-home
{t("common:errors.404.back-to-home")}
</Button>
</div>
</PageLayout>
Expand Down
7 changes: 6 additions & 1 deletion apps/client/src/utils/force-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@ export const acpypeForceFields = {
};

export const prodrgForceFields = {
gromos53a5: "GROMOS96 53a5 force field"
gromos43a1: "GROMOS96 43a1 force field",
gromos43a2: "GROMOS96 43a2 force field",
gromos45a3: "GROMOS96 45a3 force field",
gromos53a5: "GROMOS96 53a5 force field",
gromos53a6: "GROMOS96 53a6 force field",
gromos54a7: "GROMOS96 54a7 force field"
};

0 comments on commit c7ed6b1

Please sign in to comment.