-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract some stories and simplified
- Loading branch information
Showing
38 changed files
with
368 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {type ComponentProps} from 'react'; | ||
import {Text} from 'react-native'; | ||
import {action} from '@storybook/addon-actions'; | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import type {CheckboxColor} from '../../main'; | ||
import {Checkbox, DoobooProvider} from '../../main'; | ||
import {StoryWrapper} from '../Common'; | ||
|
||
const colors: CheckboxColor[] = [ | ||
'primary', | ||
'success', | ||
'info', | ||
'warning', | ||
'danger', | ||
'secondary', | ||
]; | ||
|
||
const meta = { | ||
title: 'Checkbox', | ||
component: (props) => <Checkbox {...props} />, | ||
argTypes: { | ||
color: { | ||
control: 'select', | ||
options: colors, | ||
}, | ||
checked: { | ||
defaultValue: false, | ||
type: 'boolean', | ||
}, | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<DoobooProvider> | ||
<StoryWrapper> | ||
<Story /> | ||
</StoryWrapper> | ||
</DoobooProvider> | ||
), | ||
], | ||
} satisfies Meta<ComponentProps<typeof Checkbox>>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Basic: Story = { | ||
args: { | ||
color: 'primary', | ||
endElement: <Text>Click Checkbox!</Text>, | ||
checked: false, | ||
onPress: action('onCheck'), | ||
}, | ||
}; |
Oops, something went wrong.