Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc-43] add stories to atoms #810

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from
Draft

Conversation

daniel-ilan
Copy link
Collaborator

No description provided.

@daniel-ilan daniel-ilan requested review from SejoB and yuvalbl November 17, 2021 18:56
@@ -25,7 +25,11 @@ const TextButton: FC<IProps> = ({ isSubmit = false, onClick, children }) => (
</MatButton>
);

const IconButton: FC<IProps> = ({ onClick, children }) => <MatIconButton onClick={onClick}>{children}</MatIconButton>;
const IconButton: FC<IProps> = ({ isSubmit = false, onClick, children }) => (
Copy link
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
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
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
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
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
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
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