Skip to content

Commit

Permalink
add 404
Browse files Browse the repository at this point in the history
  • Loading branch information
tuan2311 committed Aug 10, 2020
1 parent 1d8507b commit 95b25d1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/ui/errors/ErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import tw, { styled } from 'twin.macro';

export const ErrorHeader = styled.h2`
${tw`text-2xl font-semibold uppercase mb-8 mt-1`}
`;

export const ErrorStatusText = styled.h1<{ color?: string }>`
${tw`text-orange-500 uppercase`}
font-size: 145px;
`;
1 change: 1 addition & 0 deletions src/components/ui/icons/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type SvgIcon =
| 'web'
| 'bag'
| 'calendar'
| 'arrow-narrow-left'
| 'arrow-narrow-right'
| 'check';

Expand Down
5 changes: 5 additions & 0 deletions src/icons/arrow-narrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import tw from 'twin.macro';
import { Helmet } from 'react-helmet';
import { Container } from '~/components/ui/containers/Container';
import { Icon } from '~/components/ui/icons/Icon';
import React from 'react';
import { ErrorHeader, ErrorStatusText } from '~/components/ui/errors/ErrorPage';
import { Card } from '~/components/ui/containers/Card';
import { Link } from 'gatsby';
import { Button } from '~/components/ui/controls/Button';

const Root = tw.div`
bg-gray-300 flex-grow py-10
`;

export default function NotFoundPage() {
return (
<Root>
<Helmet defer={false} title={'Not Found'} />
<Container className={'items-center'}>
<Card tw={'max-w-4xl sm:w-2/3 w-full p-10'}>
<div
tw={
'flex flex-col items-center justify-center transform -translate-y-5'
}
>
<ErrorStatusText>404</ErrorStatusText>
<ErrorHeader>Page Not Found</ErrorHeader>
<Link to={'/'}>
<Button>
<Icon name='arrow-narrow-left' size={16} className={'mr-2'} />
<span>Home Page</span>
</Button>
</Link>
</div>
</Card>
</Container>
</Root>
);
}

0 comments on commit 95b25d1

Please sign in to comment.