Skip to content

Commit 5285d76

Browse files
authored
feat(onboarding-ui): create reusable InformationPage (#663)
1 parent 50234f4 commit 5285d76

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import ReactDOM from 'react-dom';
2+
3+
import InformationPage from './InformationPage';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<InformationPage title='' description='' />, div);
8+
ReactDOM.unmountComponentAtNode(div);
9+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { Story, Meta } from '@storybook/react';
2+
import type { ComponentProps } from 'react';
3+
4+
import InformationPage from './InformationPage';
5+
6+
type Args = ComponentProps<typeof InformationPage>;
7+
8+
export default {
9+
title: 'pages/InformationPage',
10+
component: InformationPage,
11+
parameters: {
12+
actions: { argTypesRegex: '^on.*' },
13+
layout: 'fullscreen',
14+
},
15+
args: {
16+
title: 'Place your title here',
17+
description: 'Place your description here',
18+
},
19+
} as Meta<Args>;
20+
21+
export const _InformationPage: Story<Args> = (args) => (
22+
<InformationPage {...args} />
23+
);
24+
_InformationPage.storyName = 'InformationPage';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Box, Margins } from '@rocket.chat/fuselage';
2+
import type { ReactElement } from 'react';
3+
4+
import BackgroundLayer from '../../common/BackgroundLayer';
5+
import { OnboardingLogo } from '../../common/OnboardingLogo';
6+
7+
type InformationPageProps = {
8+
title: string;
9+
description: string;
10+
};
11+
12+
const InformationPage = ({
13+
title,
14+
description,
15+
}: InformationPageProps): ReactElement => (
16+
<BackgroundLayer>
17+
<Box
18+
display='flex'
19+
flexDirection='column'
20+
alignItems='center'
21+
textAlign='center'
22+
width='100%'
23+
maxWidth={624}
24+
paddingBlock={32}
25+
paddingInline={16}
26+
>
27+
<Margins blockEnd={32}>
28+
<OnboardingLogo />
29+
30+
<Box fontWeight={800} fontSize='x52' lineHeight='x62' fontFamily='sans'>
31+
{title}
32+
</Box>
33+
34+
<Box fontScale='p1'>{description}</Box>
35+
</Margins>
36+
</Box>
37+
</BackgroundLayer>
38+
);
39+
40+
export default InformationPage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './InformationPage';

0 commit comments

Comments
 (0)