-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into refactor/auth-client-…
…layer # Conflicts: # packages/client/src/routes/index.tsx
- Loading branch information
Showing
40 changed files
with
1,833 additions
and
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export default { | ||
LOGIN_EXPIRATION_DATE: 'loginExpirationDate', | ||
}; | ||
enum LocalStorageKey { | ||
LOGIN_EXPIRATION_DATE = 'loginExpirationDate', | ||
THEME_TYPE = 'themeType', | ||
} | ||
export default LocalStorageKey; |
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
34 changes: 34 additions & 0 deletions
34
packages/client/src/containers/PageNotFound/PageNotFound.styled.ts
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,34 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { ContentWrapperProps, DescriptionProps } from './PageNotFound.types'; | ||
|
||
export const Title = styled.h2` | ||
font-weight: 400; | ||
margin-bottom: 40px; | ||
`; | ||
|
||
export const Description = styled.h5<DescriptionProps>` | ||
color: ${({ theme: { palette } }) => palette.text.secondary}; | ||
font-weight: 400; | ||
position: absolute; | ||
top: ${({ illustrationHeight }) => illustrationHeight - illustrationHeight * 0.1}px; | ||
`; | ||
|
||
export const IllustrationWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 80%; | ||
flex-direction: column; | ||
`; | ||
|
||
export const ContentWrapper = styled.div<ContentWrapperProps>` | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
flex-direction: column; | ||
position: relative; | ||
width: 100%; | ||
height: ${({ illustrationHeight }) => illustrationHeight + 40}px; | ||
margin-bottom: 40px; | ||
`; |
7 changes: 7 additions & 0 deletions
7
packages/client/src/containers/PageNotFound/PageNotFound.types.d.ts
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 @@ | ||
export interface DescriptionProps { | ||
illustrationHeight: number; | ||
} | ||
|
||
export interface ContentWrapperProps { | ||
illustrationHeight: number; | ||
} |
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,50 @@ | ||
import React, { useLayoutEffect, useRef, useState } from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
import { routes } from '../../constants'; | ||
import { Button, CardLayout, Heaven, Hell } from '../../elements'; | ||
import { useCurrentUser, useThemeType } from '../../hooks'; | ||
import { ThemeType } from '../../theme/Theme'; | ||
import { ContentWrapper, Description, IllustrationWrapper, Title } from './PageNotFound.styled'; | ||
|
||
const PageNotFound = () => { | ||
const { t } = useTranslation(); | ||
const { themeType } = useThemeType(); | ||
const [currentUser] = useCurrentUser(); | ||
const illustrationWrapperRef = useRef<HTMLDivElement>(null); | ||
const [illustrationHeight, setIllustrationHeight] = useState(0); | ||
const isLightTheme = themeType === ThemeType.light; | ||
|
||
useLayoutEffect(() => { | ||
if (illustrationWrapperRef && illustrationWrapperRef.current) { | ||
setIllustrationHeight(illustrationWrapperRef.current.clientHeight); | ||
} | ||
}, []); | ||
|
||
return ( | ||
<CardLayout.Container> | ||
<Title> | ||
<Trans i18nKey="routes.pageNotFound.title" components={{ b: <b /> }} /> | ||
</Title> | ||
<ContentWrapper illustrationHeight={illustrationHeight}> | ||
<IllustrationWrapper ref={illustrationWrapperRef}> | ||
{isLightTheme ? <Heaven /> : <Hell />} | ||
</IllustrationWrapper> | ||
<Description illustrationHeight={illustrationHeight}> | ||
<Trans i18nKey="routes.pageNotFound.description" components={{ b: <b /> }} /> | ||
</Description> | ||
</ContentWrapper> | ||
<Button | ||
to={currentUser ? routes.HOME : routes.LOGIN} | ||
fullWidth | ||
withArrow | ||
colorVariant={isLightTheme ? 'blue' : 'red'} | ||
> | ||
{t('routes.pageNotFound.goTo')} | ||
{currentUser ? t('routes.pageNotFound.dashboard') : t('routes.pageNotFound.loginPage')} | ||
</Button> | ||
</CardLayout.Container> | ||
); | ||
}; | ||
|
||
export default PageNotFound; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { default as Dashboard } from './Dashboard'; | ||
export { default as Login } from './Login'; | ||
export { default as PageNotFound } from './PageNotFound'; | ||
export { default as Registration } from './Registration'; |
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
2 changes: 1 addition & 1 deletion
2
packages/client/src/elements/animations/AnimatedLogo/AnimatedLogo.stories.tsx
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
22 changes: 22 additions & 0 deletions
22
packages/client/src/elements/animations/Heaven/Heaven.stories.tsx
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,22 @@ | ||
import { Meta, Story } from '@storybook/react/types-6-0'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import Heaven from '.'; | ||
|
||
export default { | ||
title: 'Elements/animations/Heaven', | ||
component: Heaven, | ||
} as Meta; | ||
|
||
const Wrapper = styled.div` | ||
width: 500px; | ||
`; | ||
|
||
const Template: Story = (args) => ( | ||
<Wrapper> | ||
<Heaven {...args} /> | ||
</Wrapper> | ||
); | ||
|
||
export const Default = Template.bind({}); |
Oops, something went wrong.