-
Notifications
You must be signed in to change notification settings - Fork 6
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
Aleksej Messer
committed
Aug 17, 2024
1 parent
106c078
commit 90b7de3
Showing
18 changed files
with
109 additions
and
16 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
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
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
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
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
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
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
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
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
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
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
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
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,54 @@ | ||
import React, { useCallback, useState } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { Helmet } from 'react-helmet' | ||
import _ from 'underscore' | ||
import FooterMain from '../../components/footer-main' | ||
import { Issue } from '../../components/Issues-list' | ||
import RecentBanners from '../../components/recent-banners' | ||
|
||
import './error.less' | ||
|
||
const Error: React.FC = () => { | ||
const [ issues, setIssues] = useState<Array<Issue>>([]) | ||
const { t } = useTranslation() | ||
const titleList: string = t('error.newestBanners') | ||
const addIssues = useCallback( | ||
(iss: Array<Issue>) => { | ||
setIssues((prevIssues) => | ||
_(prevIssues) | ||
.chain() | ||
.union(iss) | ||
.uniq(false, (i) => i.key) | ||
.value() | ||
) | ||
}, | ||
[setIssues] | ||
) | ||
const resetIssue = useCallback( | ||
(key: string) => { | ||
setIssues((prevIssues) => _(prevIssues).filter((i) => i.key !== key)) | ||
}, | ||
[setIssues] | ||
) | ||
|
||
return ( | ||
<div className="error-page"> | ||
<Helmet defer={false}> | ||
<title>{t('error.title')}</title> | ||
</Helmet> | ||
<div className="error-page__title"> | ||
<h1>{t('error.title')}</h1> | ||
</div> | ||
<div className="error-page__content"> | ||
<RecentBanners | ||
titleList={titleList} | ||
setIssues={addIssues} | ||
resetIssue={resetIssue} | ||
/> | ||
</div> | ||
<FooterMain /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Error |
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,24 @@ | ||
.error-page { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
margin: 15px; | ||
|
||
&__title { | ||
text-align: center; | ||
} | ||
|
||
&__content { | ||
display: flex; | ||
justify-content: space-around; | ||
margin-bottom: 1.5rem; | ||
width: min(100%, 1200px); | ||
|
||
.recent-banners-title { | ||
h1 { | ||
text-align: center; | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
export { default as Error } from './Error' |
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
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
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