forked from hyochan/dooboo-ui-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AutoComplete C. Story (hyochan#67)
* Add AutoComplete C. Story - add addon-ondevice-knobs D. * Update Doc/AutoComplete/ Add Storybook in Readme * Fix/AutoComplete/ lint error fixed * Update/AutoComplete Storybook/ Wrapper Style - Add Wrapper Style change to Object from height number
- Loading branch information
Showing
6 changed files
with
253 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@storybook/addon-ondevice-knobs/register'; |
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,33 @@ | ||
import React, { useState } from 'react'; | ||
import { number, object, text } from '@storybook/addon-knobs'; | ||
|
||
import AutoComplete from '../../src/components/shared/AutoComplete'; | ||
import { storiesOf } from '@storybook/react-native'; | ||
import styled from 'styled-components/native'; | ||
|
||
export const ContainerDeco = (storyFn): React.ReactElement => ( | ||
<Wrapper>{storyFn()}</Wrapper> | ||
); | ||
|
||
const Wrapper = styled.SafeAreaView` | ||
`; | ||
|
||
storiesOf('AutoComplete', module) | ||
.addDecorator(ContainerDeco) | ||
.add('default', () => (<Default />)); | ||
|
||
function Default(): React.ReactElement { | ||
const [value] = useState<string>(); | ||
|
||
return ( | ||
// if Wrapper Style height is 50? | ||
<Wrapper style={object('wrapperStyle', { height: 300 }) }> | ||
<AutoComplete | ||
value={value} | ||
style={object('inputStyle', { backgroundColor: '#f3f5f7' })} | ||
debounceDelay={number('debounceDelay', 400)} | ||
placeholderText={text('placeholder', 'Choose a country')} | ||
/> | ||
</Wrapper> | ||
); | ||
} |
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
Oops, something went wrong.