-
Notifications
You must be signed in to change notification settings - Fork 167
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): Invalid Link page (#496)
* new: invalid link page * chore: loki
- Loading branch information
1 parent
be3185f
commit 6c74576
Showing
8 changed files
with
95 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
Binary file added
BIN
+39.5 KB
...onboarding-ui/.loki/reference/desktop_pages_InvalidLinkPage_InvalidLinkPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+73.6 KB
.../onboarding-ui/.loki/reference/mobile_pages_InvalidLinkPage_InvalidLinkPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.8 KB
.../onboarding-ui/.loki/reference/tablet_pages_InvalidLinkPage_InvalidLinkPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
packages/onboarding-ui/src/pages/InvalidLinkPage/InvalidLinkPage.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 InvalidLinkPage from './InvalidLinkPage'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<InvalidLinkPage onRequestNewLink={() => undefined} />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/onboarding-ui/src/pages/InvalidLinkPage/InvalidLinkPage.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,20 @@ | ||
import type { Story, Meta } from '@storybook/react'; | ||
import type { ComponentProps } from 'react'; | ||
|
||
import InvalidLinkPage from './InvalidLinkPage'; | ||
|
||
type Args = ComponentProps<typeof InvalidLinkPage>; | ||
|
||
export default { | ||
title: 'pages/InvalidLinkPage', | ||
component: InvalidLinkPage, | ||
parameters: { | ||
actions: { argTypesRegex: '^on.*' }, | ||
layout: 'fullscreen', | ||
}, | ||
} as Meta<Args>; | ||
|
||
export const _InvalidLinkPage: Story<Args> = (args) => ( | ||
<InvalidLinkPage {...args} /> | ||
); | ||
_InvalidLinkPage.storyName = 'InvalidLinkPage'; |
58 changes: 58 additions & 0 deletions
58
packages/onboarding-ui/src/pages/InvalidLinkPage/InvalidLinkPage.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,58 @@ | ||
import { Box, Margins, Button } from '@rocket.chat/fuselage'; | ||
import colors from '@rocket.chat/fuselage-tokens/colors.json'; | ||
import type { ReactElement } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import BackgroundLayer from '../../common/BackgroundLayer'; | ||
import { useDarkMode } from '../../common/DarkModeProvider'; | ||
import RocketChatLogo from '../../common/RocketChatLogo'; | ||
|
||
type InvalidLinkPageProps = { | ||
onRequestNewLink: () => void; | ||
}; | ||
|
||
const InvalidLinkPage = ({ | ||
onRequestNewLink, | ||
}: InvalidLinkPageProps): ReactElement => { | ||
const darkMode = useDarkMode(); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<BackgroundLayer> | ||
<Box | ||
display='flex' | ||
flexDirection='column' | ||
alignItems='center' | ||
textAlign='center' | ||
width='100%' | ||
maxWidth={576} | ||
paddingBlock={32} | ||
paddingInline={16} | ||
color={darkMode ? colors.white : colors.n900} | ||
> | ||
<Margins blockEnd={32}> | ||
<Box width='100%' maxWidth={180}> | ||
<RocketChatLogo /> | ||
</Box> | ||
|
||
<Box | ||
fontWeight={800} | ||
fontSize='x52' | ||
lineHeight='x62' | ||
fontFamily='sans' | ||
> | ||
{t('page.invalidLink.title')} | ||
</Box> | ||
|
||
<Box fontScale='s1'>{t('page.invalidLink.content')}</Box> | ||
|
||
<Button onClick={onRequestNewLink} primary> | ||
{t('page.invalidLink.button.text')} | ||
</Button> | ||
</Margins> | ||
</Box> | ||
</BackgroundLayer> | ||
); | ||
}; | ||
|
||
export default InvalidLinkPage; |
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 './InvalidLinkPage'; |