Skip to content

Commit cad0766

Browse files
author
Ivan
committed
Add 404 page
1 parent ac85e0f commit cad0766

File tree

6 files changed

+60
-2
lines changed

6 files changed

+60
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
[0.0.2]: https://github.com/AivGitHub/koldakov/releases/tag/v0.0.2
78
[0.0.1]: https://github.com/AivGitHub/koldakov/releases/tag/v0.0.1
89

10+
## [0.0.2] - 2023-07-02
11+
12+
### Added
13+
14+
- Page not found.
15+
916
## [0.0.1] - 2023-07-02
1017

1118
### Added

src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Container } from 'react-bootstrap';
22
import { Route, Routes } from "react-router-dom";
33

4-
import { Home } from './pages';
4+
import { Home, NotFound } from './pages';
55
import { NavbarHeader } from './components';
66
import './App.css';
77

@@ -11,7 +11,8 @@ function App() {
1111
<NavbarHeader />
1212
<Container className="pt-3">
1313
<Routes>
14-
<Route path="/" element={ <Home/> }/>
14+
<Route path="/" element={ <Home /> }/>
15+
<Route path="*" element={ <NotFound /> }/>
1516
</Routes>
1617
</Container>
1718
</div>

src/pages/NotFound.css

Whitespace-only changes.

src/pages/NotFound.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Col, Row, Nav } from "react-bootstrap";
2+
import { Link } from "react-router-dom";
3+
import { useTranslation } from "react-i18next";
4+
5+
import "./NotFound.css";
6+
7+
export const NotFound = () => {
8+
const { t, i18n } = useTranslation();
9+
10+
return (
11+
<div className="d-flex align-items-center justify-content-center pt-4">
12+
<Row className="text-center">
13+
<Col md={12}>
14+
<p className="fs-3"> <span className="text-danger">
15+
{t("Oops.text")}</span> {t("PageNotFound.text")}
16+
</p>
17+
<p className="lead">
18+
{t("PageNotFoundDescription.text")}
19+
</p>
20+
<Link to="/" className="btn btn-primary">{t("GoHome.text")}</Link>
21+
</Col>
22+
</Row>
23+
</div>
24+
);
25+
}

src/pages/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { Home } from './Home';
2+
export { NotFound } from './NotFound';

src/translations/resources.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@
147147
},
148148
"KoldakovDescription": {
149149
"text": "Koldakov is a my profile site."
150+
},
151+
"PageNotFound": {
152+
"text": "Page not found"
153+
},
154+
"PageNotFoundDescription": {
155+
"text": "The page you’re looking for doesn’t exist."
156+
},
157+
"Oops": {
158+
"text": "Oops!"
159+
},
160+
"GoHome": {
161+
"text": "Go Home"
150162
}
151163
}
152164
},
@@ -277,6 +289,18 @@
277289
},
278290
"Interests": {
279291
"text": "Интересы"
292+
},
293+
"PageNotFound": {
294+
"text": "Страница не найдена"
295+
},
296+
"PageNotFoundDescription": {
297+
"text": "Страница, на которой вы сейчас находитесь, не существует."
298+
},
299+
"Oops": {
300+
"text": "Упс!"
301+
},
302+
"GoHome": {
303+
"text": "Домой"
280304
}
281305
}
282306
}

0 commit comments

Comments
 (0)