1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Add a prop to import async select from 'react-select'

This commit is contained in:
Vasek Mlejnsky 2018-08-28 10:22:05 +02:00
parent b599c7cf5f
commit b2df1339b8

View File

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import Select from 'react-select'; import Select from 'react-select';
import AsyncSelect from 'react-select/lib/Async';
import colors from 'config/colors'; import colors from 'config/colors';
const styles = { const styles = {
@ -62,10 +64,18 @@ const styles = {
}; };
const SelectWrapper = props => ( const SelectWrapper = props => (
<Select <div>
styles={styles} {props.isAsync && <AsyncSelect styles={styles} {...props} /> }
{...props} {!props.isAsync && <Select styles={styles} {...props} />}
/> </div>
); );
SelectWrapper.propTypes = {
isAsync: PropTypes.bool,
};
SelectWrapper.defaultProps = {
isAsync: false,
};
export default SelectWrapper; export default SelectWrapper;