Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 404 page #118

Merged
merged 2 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions pages/404/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// #region Global Imports
import * as React from "react";
import { NextPage } from "next";
// #endregion Global Imports

// #region Local Imports
import { withTranslation } from "@Server/i18n";
import { Container, TopText, ApodButton } from "@Styled/Home";
import Link from "next/link";
// #endregion Local Imports

// #region Interface Imports
import { IErrorPage } from "@Interfaces";
// #endregion Interface Imports

const Custom404: NextPage<IErrorPage.IProps> = ({ t }) => {
return (
<Container>
<TopText>{t("common:NotFound")}</TopText>
<Link href="/">
<ApodButton>{t("common:BackHome")}</ApodButton>
</Link>
</Container>
);
};

export default withTranslation("common")(Custom404);
4 changes: 3 additions & 1 deletion public/static/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"Hello": "Hello",
"World": "World",
"Error": "Errr!"
"Error": "Errr!",
"NotFound": "Page not found!",
"BackHome": "Back to home"
}
1 change: 1 addition & 0 deletions src/Styled/Home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const ApodButton = styled.div`
font-size: 25px;
color: ${({ theme }) => theme.colors.primary};
letter-spacing: 0;
cursor: pointer;
`;

export const TopText = styled.div`
Expand Down