Skip to content

Commit

Permalink
fix: storybook checkbox style
Browse files Browse the repository at this point in the history
before:
1. there is no flexWrap option in Wrapper Component so in mobile environment some checkbox won't show
2. there is no key props for LabelWrapper, so there are warnings while compiling code

after:

1. added flexWrap:'wrap' and justifyContent:'center' for responsive layout
2. added key props for LabelWrapper
  • Loading branch information
Juyeong-Byeon committed Aug 9, 2021
1 parent ab9bf3f commit 4df40c6
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions stories/dooboo-ui/CheckboxStories/CheckboxStory.tsx
Expand Up @@ -53,23 +53,26 @@ const CheckboxStory: FC = () => {
Checkbox
</StyledText>

<View style={{flexDirection: 'row'}}>
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
}}>
{types.map((type) => (
<>
<LabelWapper label={type ?? 'default'}>
<Checkbox
checked={checked}
onPress={() => setChecked(!checked)}
type={type}
/>
</LabelWapper>

<View style={{width: 22}} />
</>
<LabelWapper key={type} label={type ?? 'default'}>
<Checkbox
style={{margin: 25}}
checked={checked}
onPress={() => setChecked(!checked)}
type={type}
/>
</LabelWapper>
))}

<LabelWapper label="disabled">
<Checkbox
style={{margin: 25}}
checked={checked}
onPress={() => setChecked(!checked)}
disabled
Expand Down

0 comments on commit 4df40c6

Please sign in to comment.