Skip to content

[Doc-43] add stories to atoms#810

Draft
daniel-ilan wants to merge 11 commits intodevfrom
doc-43-add-stories-to-atoms
Draft

[Doc-43] add stories to atoms#810
daniel-ilan wants to merge 11 commits intodevfrom
doc-43-add-stories-to-atoms

Conversation

@daniel-ilan
Copy link
Copy Markdown
Collaborator

No description provided.

@daniel-ilan daniel-ilan requested review from SejoB and yuvalbl November 17, 2021 18:56
);

const IconButton: FC<IProps> = ({ onClick, children }) => <MatIconButton onClick={onClick}>{children}</MatIconButton>;
const IconButton: FC<IProps> = ({ isSubmit = false, onClick, children }) => (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon button does not need isSubmit (it is never used for submit)


const Template: Story<ComponentProps<typeof AppBar>> = (args) => <AppBar {...args} />;

export const AppBarS = Template.bind({});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The following can be applied for all stories

  1. This will leave "AppBarS" to be displayed on the storybook site. rename it so it will have a displayable name
  2. you can use ComponentStory and ComponentMeta for better typing:
  3. Atoms with a single story, doesn't need a 3rd level nesting ( 'Components/atoms/AppBar' => 'Components/atoms')
import { ComponentStory, ComponentMeta } from '@storybook/react';
import AppBarComp from '../AppBar';

export default {
  title: 'Components/atoms',
  component: AppBar,
} as ComponentMeta<typeof AppBarComp>;

const Template: ComponentStory<typeof AppBar> = (args) => <AppBarComp {...args} />;
export const AppBar = Template.bind({});

import { AnyWayButton } from '../AnyWayButton';

export default {
title: 'Components/atoms/AnyWayButton',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnyWayButton is about to be refactored / remove, no need a story for this one

Comment on lines +38 to +48
// export const ButtonOutlinedS = Template.bind({});
// ButtonOutlinedS.args = {
// type: 'outlined',
// children: 'Button',
// };

// export const ButtonIconS = Template.bind({});
// ButtonIconS.args = {
// type: 'icon',
// children: 'Button',
// };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not needed


const Template: Story<ComponentProps<typeof Dialog>> = (args) => <Dialog {...args} />;

export const DialogS = Template.bind({});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not possible to display the dialog from the main content area. can you include a button which will open it?

control: { type: 'select' },
},
},
} as unknown as Meta;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why unknown?

} as Meta;

const Item: FC<ItemProps> = ({ number }) => {
return <div>Item no^{number}</div>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return <div>Item no^{number}</div>;
return <div>Item {number}</div>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants