HM-68. Верcтка страницы Not Found (#42)

This commit is contained in:
Михаил
2020-08-01 23:09:32 +03:00
committed by GitHub
parent f7ddce5bb0
commit 30545ab960
6 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,9 @@
import Component from '../component/Component';
class NotFoundContent extends Component {
constructor (parentNode) {
super('#not-found-content', parentNode);
}
}
export default NotFoundContent;

View File

@ -0,0 +1,3 @@
import NotFoundContent from './NotFoundContent';
export default NotFoundContent;

View File

@ -0,0 +1,11 @@
.NotFound__text {
display: flex;
justify-content: center;
}
.NotFound__image {
display: flex;
justify-content: center;
margin-right: 0;
width: 150px;
}

View File

@ -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('/');
});
}
}