From 30545ab9600a5e7f72a424d7fb25255da4443f9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?=
<63847832+Gaigerov@users.noreply.github.com>
Date: Sat, 1 Aug 2020 23:09:32 +0300
Subject: [PATCH] =?UTF-8?q?HM-68.=20=D0=92=D0=B5=D1=80c=D1=82=D0=BA=D0=B0?=
=?UTF-8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20Not=20Fou?=
=?UTF-8?q?nd=20(#42)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app.html | 11 +++++++++++
src/components/not-found-content/NotFoundContent.js | 9 +++++++++
src/components/not-found-content/index.js | 3 +++
src/components/not-found-page/NotFoundPage.css | 11 +++++++++++
src/components/not-found-page/NotFoundPage.js | 12 ++++++++++--
src/img/error-404.svg | 1 +
6 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 src/components/not-found-content/NotFoundContent.js
create mode 100644 src/components/not-found-content/index.js
create mode 100644 src/components/not-found-page/NotFoundPage.css
create mode 100644 src/img/error-404.svg
diff --git a/src/app.html b/src/app.html
index ed56907..9841be2 100644
--- a/src/app.html
+++ b/src/app.html
@@ -88,6 +88,17 @@
+
+
+
+

+
+
404. Страница не найдена
+
+
+
+
+
diff --git a/src/components/not-found-content/NotFoundContent.js b/src/components/not-found-content/NotFoundContent.js
new file mode 100644
index 0000000..2d9fe9b
--- /dev/null
+++ b/src/components/not-found-content/NotFoundContent.js
@@ -0,0 +1,9 @@
+import Component from '../component/Component';
+
+class NotFoundContent extends Component {
+ constructor (parentNode) {
+ super('#not-found-content', parentNode);
+ }
+}
+
+export default NotFoundContent;
diff --git a/src/components/not-found-content/index.js b/src/components/not-found-content/index.js
new file mode 100644
index 0000000..5d71828
--- /dev/null
+++ b/src/components/not-found-content/index.js
@@ -0,0 +1,3 @@
+import NotFoundContent from './NotFoundContent';
+
+export default NotFoundContent;
diff --git a/src/components/not-found-page/NotFoundPage.css b/src/components/not-found-page/NotFoundPage.css
new file mode 100644
index 0000000..e4f45d1
--- /dev/null
+++ b/src/components/not-found-page/NotFoundPage.css
@@ -0,0 +1,11 @@
+.NotFound__text {
+ display: flex;
+ justify-content: center;
+}
+
+.NotFound__image {
+ display: flex;
+ justify-content: center;
+ margin-right: 0;
+ width: 150px;
+}
diff --git a/src/components/not-found-page/NotFoundPage.js b/src/components/not-found-page/NotFoundPage.js
index c0e8673..2d98853 100644
--- a/src/components/not-found-page/NotFoundPage.js
+++ b/src/components/not-found-page/NotFoundPage.js
@@ -1,10 +1,18 @@
import Component from '../component/index';
+import routeService from '../../services/RouteService';
+import NotFoundContent from '../not-found-content';
+import './NotFoundPage.css';
class NotFoundPage extends Component {
constructor (mainNodeSelector, parentNode) {
super(mainNodeSelector, parentNode);
-
- this.mainNode.textContent = `Not found page ${location.pathname}`;
+ this.notFoundContent = new NotFoundContent(this.mainNode);
+ this.mainNodeSelector = this.mainNode.querySelector('.NotFound__text');
+ this.mainNodeSelector.textContent = `Запрашиваемая Вами страница ${location.pathname} не найдена`;
+ this.redirectButton = this.mainNode.querySelector('.NotFound__redirectButton');
+ this.addEventListener(this.redirectButton, 'click', () => {
+ routeService.goTo('/');
+ });
}
}
diff --git a/src/img/error-404.svg b/src/img/error-404.svg
new file mode 100644
index 0000000..9e6c424
--- /dev/null
+++ b/src/img/error-404.svg
@@ -0,0 +1 @@
+