Skip to content

Commit

Permalink
Add 404 page (#118)
Browse files Browse the repository at this point in the history
* Add 404 page

-Add 404 page
-Add 404 page styling
-Add translations needed for 404 page

fix #107

* Remove duplicate styles
  • Loading branch information
AbdelazizMalfy authored Aug 24, 2020
1 parent 1caaeac commit 20124b5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
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

0 comments on commit 20124b5

Please sign in to comment.