meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
5 changed files with
6 additions and
3 deletions
-
src/components/modals/ImportAccounts/index.js
-
src/components/modals/ImportAccounts/steps/01-step-choose-currency.js
-
src/components/modals/Receive/01-step-account.js
-
src/components/modals/Send/01-step-amount.js
-
src/components/modals/Send/RecipientField.js
|
|
@ -70,7 +70,6 @@ type Props = { |
|
|
|
} |
|
|
|
|
|
|
|
type StepId = 'chooseCurrency' | 'connectDevice' | 'import' | 'finish' |
|
|
|
|
|
|
|
type ScanStatus = 'idle' | 'scanning' | 'error' | 'finished' |
|
|
|
|
|
|
|
type State = { |
|
|
|
|
|
@ -12,6 +12,7 @@ import type { StepProps } from '../index' |
|
|
|
function StepChooseCurrency({ currency, setState }: StepProps) { |
|
|
|
return ( |
|
|
|
<SelectCurrency |
|
|
|
autoFocus |
|
|
|
onChange={currency => { |
|
|
|
setState({ |
|
|
|
currency: isArray(currency) && currency.length === 0 ? null : currency, |
|
|
|
|
|
@ -18,6 +18,6 @@ type Props = { |
|
|
|
export default (props: Props) => ( |
|
|
|
<Box flow={1}> |
|
|
|
<Label>{props.t('app:receive.steps.chooseAccount.label')}</Label> |
|
|
|
<SelectAccount onChange={props.onChangeAccount} value={props.account} /> |
|
|
|
<SelectAccount autoFocus onChange={props.onChangeAccount} value={props.account} /> |
|
|
|
</Box> |
|
|
|
) |
|
|
|
|
|
@ -63,6 +63,7 @@ function StepAmount({ |
|
|
|
{account && bridge && transaction ? ( |
|
|
|
<Fragment key={account.id}> |
|
|
|
<RecipientField |
|
|
|
autoFocus |
|
|
|
account={account} |
|
|
|
bridge={bridge} |
|
|
|
transaction={transaction} |
|
|
|
|
|
@ -14,6 +14,7 @@ type Props<Transaction> = { |
|
|
|
bridge: WalletBridge<Transaction>, |
|
|
|
transaction: Transaction, |
|
|
|
onChangeTransaction: Transaction => void, |
|
|
|
autoFocus?: boolean, |
|
|
|
} |
|
|
|
|
|
|
|
class RecipientField<Transaction> extends Component<Props<Transaction>, { isValid: boolean }> { |
|
|
@ -59,7 +60,7 @@ class RecipientField<Transaction> extends Component<Props<Transaction>, { isVali |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
const { bridge, account, transaction, t } = this.props |
|
|
|
const { bridge, account, transaction, t, autoFocus } = this.props |
|
|
|
const { isValid } = this.state |
|
|
|
const value = bridge.getTransactionRecipient(account, transaction) |
|
|
|
return ( |
|
|
@ -69,6 +70,7 @@ class RecipientField<Transaction> extends Component<Props<Transaction>, { isVali |
|
|
|
<LabelInfoTooltip ml={1} text={t('app:send.steps.amount.recipientAddress')} /> |
|
|
|
</Label> |
|
|
|
<RecipientAddress |
|
|
|
autoFocus={autoFocus} |
|
|
|
withQrCode |
|
|
|
error={!value || isValid ? null : `This is not a valid ${account.currency.name} address`} |
|
|
|
value={value} |
|
|
|