Fix stories

This commit is contained in:
dominik-zeglen 2019-10-15 17:46:19 +02:00
parent f0d343dec6
commit 1027e215a2
3 changed files with 1520 additions and 485 deletions

View file

@ -32,7 +32,7 @@ const Story: React.FC<
enableLoadMore: boolean; enableLoadMore: boolean;
} }
> >
> = storyProps => { > = ({ allowCustomValues, enableLoadMore }) => {
const { change, data: countries } = useMultiAutocomplete([suggestions[0]]); const { change, data: countries } = useMultiAutocomplete([suggestions[0]]);
return ( return (
@ -49,9 +49,9 @@ const Story: React.FC<
onChange={event => change(event, choices)} onChange={event => change(event, choices)}
value={countries.map(country => country.value)} value={countries.map(country => country.value)}
loading={loading} loading={loading}
hasMore={storyProps.enableLoadMore ? hasMore : false} hasMore={enableLoadMore ? hasMore : false}
onFetchMore={storyProps.enableLoadMore ? fetchMore : undefined} onFetchMore={enableLoadMore ? fetchMore : undefined}
{...storyProps} allowCustomValues={allowCustomValues}
/> />
)} )}
</ChoiceProvider> </ChoiceProvider>

View file

@ -33,7 +33,7 @@ const Story: React.FC<
enableLoadMore: boolean; enableLoadMore: boolean;
} }
> >
> = storyProps => { > = ({ allowCustomValues, emptyOption, enableLoadMore }) => {
const [displayValue, setDisplayValue] = React.useState(suggestions[0].label); const [displayValue, setDisplayValue] = React.useState(suggestions[0].label);
return ( return (
@ -57,9 +57,10 @@ const Story: React.FC<
loading={loading} loading={loading}
onChange={handleSelect} onChange={handleSelect}
value={data.country} value={data.country}
hasMore={storyProps.enableLoadMore ? hasMore : false} hasMore={enableLoadMore ? hasMore : false}
onFetchMore={storyProps.enableLoadMore ? fetchMore : undefined} onFetchMore={enableLoadMore ? fetchMore : undefined}
{...storyProps} allowCustomValues={allowCustomValues}
emptyOption={emptyOption}
/> />
); );
}} }}

File diff suppressed because it is too large Load diff