HM-68. Верcтка страницы Not Found (#42)
This commit is contained in:
9
src/components/not-found-content/NotFoundContent.js
Normal file
9
src/components/not-found-content/NotFoundContent.js
Normal file
@ -0,0 +1,9 @@
|
||||
import Component from '../component/Component';
|
||||
|
||||
class NotFoundContent extends Component {
|
||||
constructor (parentNode) {
|
||||
super('#not-found-content', parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
export default NotFoundContent;
|
||||
3
src/components/not-found-content/index.js
Normal file
3
src/components/not-found-content/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import NotFoundContent from './NotFoundContent';
|
||||
|
||||
export default NotFoundContent;
|
||||
11
src/components/not-found-page/NotFoundPage.css
Normal file
11
src/components/not-found-page/NotFoundPage.css
Normal file
@ -0,0 +1,11 @@
|
||||
.NotFound__text {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.NotFound__image {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-right: 0;
|
||||
width: 150px;
|
||||
}
|
||||
@ -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('/');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user