From c96992a3f73ccbefef7970aa1967e516237db83f Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Tue, 12 Mar 2019 18:34:32 +0100 Subject: [PATCH] searchable currency select with dropDownIndicator enabled --- src/components/Select/index.js | 9 ++++++--- src/views/Wallet/views/Account/Send/ethereum/index.js | 2 +- src/views/Wallet/views/Account/Summary/ethereum/index.js | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Select/index.js b/src/components/Select/index.js index 7aa4ad66..4db074a0 100644 --- a/src/components/Select/index.js +++ b/src/components/Select/index.js @@ -4,12 +4,15 @@ import ReactSelect from 'react-select'; import ReactAsyncSelect from 'react-select/lib/Async'; import colors from 'config/colors'; -const styles = isSearchable => ({ +const styles = (isSearchable, withDropdownIndicator = true) => ({ singleValue: base => ({ ...base, maxWidth: 'calc(100% - 10px)', // 8px padding + 2px maring-left width: '100%', color: colors.TEXT_SECONDARY, + '&:hover': { + cursor: 'text', + }, }), control: (base, { isDisabled, isFocused }) => ({ ...base, @@ -20,7 +23,7 @@ const styles = isSearchable => ({ boxShadow: isFocused ? `0 0px 6px 0 ${colors.INPUT_FOCUSED_SHADOW}` : 'none', background: isDisabled ? colors.LANDING : colors.WHITE, '&:hover': { - cursor: isSearchable ? 'text' : 'pointer', + cursor: 'pointer', }, }), indicatorSeparator: () => ({ @@ -28,7 +31,7 @@ const styles = isSearchable => ({ }), dropdownIndicator: (base, { isDisabled }) => ({ ...base, - display: isSearchable || isDisabled ? 'none' : 'block', + display: !withDropdownIndicator || isDisabled ? 'none' : 'block', color: colors.TEXT_SECONDARY, path: '', '&:hover': { diff --git a/src/views/Wallet/views/Account/Send/ethereum/index.js b/src/views/Wallet/views/Account/Send/ethereum/index.js index 9b344739..96f1f66c 100644 --- a/src/views/Wallet/views/Account/Send/ethereum/index.js +++ b/src/views/Wallet/views/Account/Send/ethereum/index.js @@ -455,7 +455,7 @@ const AccountSend = (props: Props) => { sideAddons={[ onLocalCurrencyChange(option)} value={buildCurrencyOption(localCurrency)} diff --git a/src/views/Wallet/views/Account/Summary/ethereum/index.js b/src/views/Wallet/views/Account/Summary/ethereum/index.js index b4cbc08b..bc0a2e3f 100644 --- a/src/views/Wallet/views/Account/Summary/ethereum/index.js +++ b/src/views/Wallet/views/Account/Summary/ethereum/index.js @@ -121,6 +121,7 @@ const AccountSummary = (props: Props) => {