Skip to content

Commit

Permalink
Merge pull request #267 from codern-app/feat/404-page
Browse files Browse the repository at this point in the history
feat: 404 page
  • Loading branch information
armancodv authored May 10, 2024
2 parents c8211c2 + 56141b0 commit d6c9fad
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 34 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/reusable-pull-request-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,3 @@ jobs:
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
projectId: '${{ secrets.FIREBASE_PROJECT_ID }}'
target: 'web'

- name: Build Storybook
run: yarn build-storybook

- name: Deploy Storybook to Firebase Hosting (Preview)
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
projectId: '${{ secrets.FIREBASE_PROJECT_ID_STORYBOOK }}'
target: 'storybook'
5 changes: 5 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,10 @@
},
"recommendations": {
"title": "Recommendations"
},
"404": {
"title": "Page not found",
"message": "The page you are looking for does not exist.",
"back": "Back to home"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build && next-sitemap",
"start": "next start",
"start": "npx serve out",
"lint": "next lint",
"test": "npx jest",
"storybook": "npx storybook dev -p 6006",
Expand Down Expand Up @@ -49,6 +49,7 @@
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"prettier": "3.2.5",
"serve": "^14.2.3",
"storybook": "8.0.0"
},
"packageManager": "[email protected]"
Expand Down
34 changes: 34 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { WrapperComponent } from '../features/navigation/components/wrapper.component';
import { Alert, Button, Container, Typography } from '@mui/material';
import React from 'react';
import Link from 'next/link';
import { useTranslations } from 'next-intl';

export default function NotFound() {
const t = useTranslations('404');
return (
<WrapperComponent>
<Container>
<Typography
variant="h1"
sx={{
marginTop: 12,
marginBottom: 1,
}}
>
{t('title')}
</Typography>
<Alert severity="error">{t('message')}</Alert>
<Button
variant="contained"
sx={{
marginTop: 4,
marginBottom: 4,
}}
>
<Link href="/">{t('back')}</Link>
</Button>
</Container>
</WrapperComponent>
);
}
Loading

0 comments on commit d6c9fad

Please sign in to comment.