mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-25 00:18:07 +00:00
Add a prop to import async select from 'react-select'
This commit is contained in:
parent
b599c7cf5f
commit
b2df1339b8
@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Select from 'react-select';
|
||||
import AsyncSelect from 'react-select/lib/Async';
|
||||
import colors from 'config/colors';
|
||||
|
||||
const styles = {
|
||||
@ -62,10 +64,18 @@ const styles = {
|
||||
};
|
||||
|
||||
const SelectWrapper = props => (
|
||||
<Select
|
||||
styles={styles}
|
||||
{...props}
|
||||
/>
|
||||
<div>
|
||||
{props.isAsync && <AsyncSelect styles={styles} {...props} /> }
|
||||
{!props.isAsync && <Select styles={styles} {...props} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
SelectWrapper.propTypes = {
|
||||
isAsync: PropTypes.bool,
|
||||
};
|
||||
|
||||
SelectWrapper.defaultProps = {
|
||||
isAsync: false,
|
||||
};
|
||||
|
||||
export default SelectWrapper;
|
||||
|
Loading…
Reference in New Issue
Block a user