-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(onboarding-ui): Add SomethingWentWrongPage Component (#624)
- Loading branch information
1 parent
2db85e2
commit 68e12dc
Showing
6 changed files
with
73 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
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
9 changes: 9 additions & 0 deletions
9
packages/onboarding-ui/src/pages/SomethingWentWrongPage/SomethingWentWrongPage.spec.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,9 @@ | ||
import ReactDOM from 'react-dom'; | ||
|
||
import SomethingWentWrongPage from './SomethingWentWrongPage'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<SomethingWentWrongPage />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
16 changes: 16 additions & 0 deletions
16
packages/onboarding-ui/src/pages/SomethingWentWrongPage/SomethingWentWrongPage.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,16 @@ | ||
import type { Story, Meta } from '@storybook/react'; | ||
|
||
import SomethingWentWrongPage from './SomethingWentWrongPage'; | ||
|
||
export default { | ||
title: 'pages/SomethingWentWrongPage', | ||
component: SomethingWentWrongPage, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
} as Meta; | ||
|
||
export const _SomethingWentWrongPage: Story = (args) => ( | ||
<SomethingWentWrongPage {...args} /> | ||
); | ||
_SomethingWentWrongPage.storyName = 'SomethingWentWrongPage'; |
42 changes: 42 additions & 0 deletions
42
packages/onboarding-ui/src/pages/SomethingWentWrongPage/SomethingWentWrongPage.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,42 @@ | ||
import { Box, Margins } from '@rocket.chat/fuselage'; | ||
import type { ReactElement } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import BackgroundLayer from '../../common/BackgroundLayer'; | ||
import { OnboardingLogo } from '../../common/OnboardingLogo'; | ||
|
||
const SomethingWentWrongPage = (): ReactElement => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<BackgroundLayer> | ||
<Box | ||
display='flex' | ||
flexDirection='column' | ||
alignItems='center' | ||
textAlign='center' | ||
width='100%' | ||
maxWidth={624} | ||
paddingBlock={32} | ||
paddingInline={16} | ||
> | ||
<Margins blockEnd={32}> | ||
<OnboardingLogo /> | ||
|
||
<Box | ||
fontWeight={800} | ||
fontSize='x52' | ||
lineHeight='x62' | ||
fontFamily='sans' | ||
> | ||
{t('page.somethingWentWrongPage.title')} | ||
</Box> | ||
|
||
<Box fontScale='p1'>{t('page.somethingWentWrongPage.subtitle')}</Box> | ||
</Margins> | ||
</Box> | ||
</BackgroundLayer> | ||
); | ||
}; | ||
|
||
export default SomethingWentWrongPage; |
1 change: 1 addition & 0 deletions
1
packages/onboarding-ui/src/pages/SomethingWentWrongPage/index.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 @@ | ||
export { default } from './SomethingWentWrongPage'; |