mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
Add option to import AsyncSelect
This commit is contained in:
parent
ef4bb665db
commit
203a66a904
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Select from 'react-select';
|
||||
import AsyncSelect from 'react-select/lib/Async';
|
||||
import ReactSelect from 'react-select';
|
||||
import ReactAsyncSelect from 'react-select/lib/Async';
|
||||
import colors from 'config/colors';
|
||||
|
||||
const styles = isSearchable => ({
|
||||
@ -58,21 +58,16 @@ const styles = isSearchable => ({
|
||||
}),
|
||||
});
|
||||
|
||||
const SelectWrapper = props => (
|
||||
<div>
|
||||
{props.isAsync && <AsyncSelect styles={styles(props.isSearchable)} {...props} /> }
|
||||
{!props.isAsync && <Select styles={styles(props.isSearchable)} {...props} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
SelectWrapper.propTypes = {
|
||||
const propTypes = {
|
||||
isAsync: PropTypes.bool,
|
||||
isSearchable: PropTypes.bool,
|
||||
};
|
||||
const Select = props => <ReactSelect styles={styles(props.isSearchable)} {...props} />;
|
||||
const AsyncSelect = props => <ReactAsyncSelect styles={styles(props.isSearchable)} {...props} />;
|
||||
Select.propTypes = propTypes;
|
||||
AsyncSelect.propTypes = propTypes;
|
||||
|
||||
SelectWrapper.defaultProps = {
|
||||
isAsync: false,
|
||||
isSearchable: false,
|
||||
export {
|
||||
Select,
|
||||
AsyncSelect,
|
||||
};
|
||||
|
||||
export default SelectWrapper;
|
||||
|
@ -5,7 +5,7 @@ import styled from 'styled-components';
|
||||
import colors from 'config/colors';
|
||||
import { FONT_SIZE, FONT_WEIGHT } from 'config/variables';
|
||||
import installers from 'constants/bridge';
|
||||
import Select from 'components/Select';
|
||||
import { Select } from 'components/Select';
|
||||
import Link from 'components/Link';
|
||||
import Button from 'components/Button';
|
||||
import Loader from 'components/Loader';
|
||||
|
Loading…
Reference in New Issue
Block a user