Skip to content

Commit d348a5c

Browse files
th-202: Implement the 404 page according to the design (#206)
* th-202: + styled 404 page * th-202: * import fix * th-202: - removed unnecessary svg * th-166: * fixed paths * th-166: * link changed to button * th-202: * changed navigate route * th-202: * fix import * th-202: * fix styles import
1 parent 295030e commit d348a5c

File tree

2 files changed

+61
-12
lines changed

2 files changed

+61
-12
lines changed
Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
import { Link } from '~/libs/components/components.js';
1+
import { Button } from '~/libs/components/components.js';
22
import { AppRoute } from '~/libs/enums/enums.js';
3+
import { useCallback, useNavigate } from '~/libs/hooks/hooks.js';
34

4-
const NotFound = (): JSX.Element => (
5-
<div>
6-
<h2>
7-
Oops, the dreaded <span>404</span>.
8-
</h2>
5+
import styles from './styles.module.scss';
96

10-
<p>Let&apos;s get you back on track.</p>
7+
const NotFound = (): JSX.Element => {
8+
const navigate = useNavigate();
119

12-
<Link to={AppRoute.ROOT}>
13-
<span>Back to Home page</span>
14-
</Link>
15-
</div>
16-
);
10+
const handleClick = useCallback(() => {
11+
navigate(AppRoute.ROOT);
12+
}, [navigate]);
13+
14+
return (
15+
<div className={styles.page}>
16+
<h1 className={styles.code}>404</h1>
17+
<p className={styles.message}>OOPS! PAGE NOT FOUND</p>
18+
<Button
19+
className={styles.link}
20+
label="GO TO HOMEPAGE"
21+
onClick={handleClick}
22+
/>
23+
</div>
24+
);
25+
};
1726

1827
export { NotFound };
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@import "src/assets/css/vars.scss";
2+
3+
.page {
4+
display: flex;
5+
flex-flow: column;
6+
justify-content: center;
7+
align-items: center;
8+
height: 100vh;
9+
background-color: $blue-dark;
10+
background-image: url("../../assets/img/auth-page-bg.svg");
11+
background-repeat: no-repeat;
12+
background-position: center;
13+
background-size: cover;
14+
}
15+
16+
.code {
17+
color: $white;
18+
font-weight: $font-weight-extrabold;
19+
font-size: 220px;
20+
font-family: $font-family;
21+
}
22+
23+
.message {
24+
margin-bottom: 40px;
25+
color: $white;
26+
font-weight: $font-weight-bold;
27+
font-size: 28px;
28+
font-family: $font-family;
29+
}
30+
31+
.link {
32+
padding: 15px;
33+
color: $white;
34+
font-size: 16px;
35+
font-family: $font-family;
36+
background-color: $red-dark;
37+
border-radius: 5px;
38+
box-shadow: 0 4px 4px 0 rgb(0 0 0 / 40%);
39+
cursor: pointer;
40+
}

0 commit comments

Comments
 (0)