-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from anastasiiavorobiova/feat/utility-pages
Feat/utility pages
- Loading branch information
Showing
11 changed files
with
112 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
'use client'; | ||
|
||
import ErrorPage from '@/widgets/ErrorPage'; | ||
|
||
export default function ErrorBoundary({ reset }: { reset: () => void }) { | ||
return <ErrorPage reset={reset} />; | ||
} |
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 |
---|---|---|
|
@@ -34,7 +34,6 @@ main { | |
} | ||
|
||
header, | ||
footer, | ||
main { | ||
padding: 20px; | ||
} | ||
|
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,9 @@ | ||
import { Center, Loader } from '@/shared/ui'; | ||
|
||
export default function Loading() { | ||
return ( | ||
<Center h={100} w="100%"> | ||
<Loader color="teal" mx="auto" /> | ||
</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
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,3 @@ | ||
import { ErrorPage } from './ui/ErrorPage'; | ||
|
||
export default ErrorPage; |
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,37 @@ | ||
.root { | ||
padding-top: rem(80px); | ||
padding-bottom: rem(80px); | ||
} | ||
|
||
.label { | ||
text-align: center; | ||
font-weight: 900; | ||
font-size: rem(38px); | ||
line-height: 1; | ||
margin-bottom: calc(1.5 * var(--mantine-spacing-xl)); | ||
color: var(--mantine-color-gray-2); | ||
|
||
@media (max-width: $mantine-breakpoint-sm) { | ||
font-size: rem(32px); | ||
} | ||
} | ||
|
||
.description { | ||
max-width: rem(500px); | ||
margin: auto; | ||
margin-top: var(--mantine-spacing-xl); | ||
margin-bottom: calc(1.5 * var(--mantine-spacing-xl)); | ||
} | ||
|
||
.title { | ||
font-family: | ||
Greycliff CF, | ||
var(--mantine-font-family); | ||
text-align: center; | ||
font-weight: 900; | ||
font-size: rem(38px); | ||
|
||
@media (max-width: $mantine-breakpoint-sm) { | ||
font-size: rem(32px); | ||
} | ||
} |
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,12 @@ | ||
import { describe, expect, test, vi } from 'vitest'; | ||
import { screen } from '@testing-library/react'; | ||
import { renderWithWrappers } from '@/shared/lib/tests/withWrappers'; | ||
import { ErrorPage } from './ErrorPage'; | ||
|
||
describe('Error Page component', () => { | ||
test('Renders', async () => { | ||
await renderWithWrappers(<ErrorPage reset={vi.fn()} />); | ||
|
||
expect(screen.getByText('Something bad just happened...')).toBeInTheDocument(); | ||
}); | ||
}); |
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 @@ | ||
'use client'; | ||
|
||
import { Button, Container, Group, Title, Text } from '@/shared/ui'; | ||
import { useTranslations } from 'next-intl'; | ||
import styles from './ErrorPage.module.css'; | ||
|
||
export function ErrorPage({ reset }: { reset: () => void }) { | ||
const t = useTranslations('ErrorPage'); | ||
|
||
return ( | ||
<Container className={styles.root}> | ||
<div className={styles.label}>500</div> | ||
<Title className={styles.title}>{t('title')}</Title> | ||
<Text c="dimmed" size="lg" ta="center" className={styles.description}> | ||
{t('text')} | ||
</Text> | ||
<Group justify="center"> | ||
<Button variant="subtle" size="md" onClick={reset}> | ||
{t('button')} | ||
</Button> | ||
</Group> | ||
</Container> | ||
); | ||
} |