Skip to content

Commit

Permalink
Create home page for Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
julianguyen committed Apr 14, 2022
1 parent 12dc351 commit 7b31fc5
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ const path = require('path');
const custom = require('../webpack.config');

module.exports = {
stories: ['../app/stories/**/*.stories.@(jsx|mdx)'],
stories: [
'../app/stories/Index.stories.jsx',
'../app/stories/**/*.stories.@(jsx|mdx)',
],
addons: [
'@storybook/addon-links',
{
Expand Down
1 change: 1 addition & 0 deletions client/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export const parameters = {
{ name: 'mulberry', value: '#6D0839' },
],
},
viewMode: 'docs',
};
73 changes: 73 additions & 0 deletions client/app/stories/Index.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React from 'react';
import { Logo } from 'components/Logo';
import css from 'styles/_global.scss';

export default {
title: 'Home',
};

export const Welcome = () => (
<div
style={{
color: '#FFFFFF',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
textAlign: 'center',
}}
>
<Logo lg link="https://if-me.org" />
<p style={{ marginTop: '40px' }}>
Welcome to our official design system!
<br />
<em>Components</em>
{' '}
and
<em>libraries</em>
{' '}
are used in React.
<br />
The
{' '}
<em>style guide</em>
{' '}
is used across Rails and React.
</p>
<p
style={{
marginTop: '40px',
display: 'flex',
}}
>
<a
className={css.buttonGhostM}
target="_blank"
href="https://github.com/ifmeorg/ifme/tree/main/client/app/stories"
rel="noreferrer"
>
Source Code
</a>
<a
className={css.buttonGhostM}
target="_blank"
style={{ marginLeft: '10px' }}
href="https://github.com/ifmeorg/ifme/wiki/Frontend-Practices"
rel="noreferrer"
>
Frontend Practices
</a>
</p>
</div>
);

Welcome.parameters = {
viewMode: 'story',
backgrounds: { default: 'mulberry' },
previewTabs: {
'storybook/docs/panel': {
hidden: true,
},
},
};

0 comments on commit 7b31fc5

Please sign in to comment.