-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { PageInterface } from '@/shared/types/interfaces.ts'; | ||
|
||
import NotFoundPageView from '../view/NotFoundPageView.ts'; | ||
|
||
class NotFoundPageModel implements PageInterface { | ||
private view: NotFoundPageView; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.view = new NotFoundPageView(parent); | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default NotFoundPageModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { TAG_NAMES } from '@/shared/constants/enums.ts'; | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import NOT_FOUND_PAGE_STYLES from './notFoundPageView.module.scss'; | ||
|
||
class NotFoundPageView { | ||
private page: HTMLDivElement; | ||
|
||
private parent: HTMLDivElement; | ||
|
||
constructor(parent: HTMLDivElement) { | ||
this.parent = parent; | ||
this.page = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.page = createBaseElement({ | ||
cssClasses: [NOT_FOUND_PAGE_STYLES.notFoundPage], | ||
tag: TAG_NAMES.DIV, | ||
}); | ||
|
||
this.parent.append(this.page); | ||
|
||
return this.page; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.page; | ||
} | ||
|
||
public hide(): boolean { | ||
this.page.classList.add(NOT_FOUND_PAGE_STYLES.notFoundPage_hidden); | ||
return true; | ||
} | ||
|
||
public show(): boolean { | ||
this.page.classList.remove(NOT_FOUND_PAGE_STYLES.notFoundPage_hidden); | ||
return true; | ||
} | ||
} | ||
export default NotFoundPageView; |
File renamed without changes.