Browse Source

bugfix input recipient

master
Gaëtan Renaudeau 7 years ago
parent
commit
efa67ea0d5
  1. 2
      src/components/RecipientAddress/index.js
  2. 6
      src/components/modals/Send/01-step-amount.js

2
src/components/RecipientAddress/index.js

@ -45,7 +45,7 @@ const BackgroundLayer = styled(Box)`
type Props = { type Props = {
value: string, value: string,
// return false if it can't be changed (invalid info) // return false if it can't be changed (invalid info)
onChange: (string, { amount?: number, currency?: CryptoCurrency }) => ?boolean, onChange: (string, ?{ amount?: number, currency?: CryptoCurrency }) => ?boolean,
withQrCode: boolean, withQrCode: boolean,
} }

6
src/components/modals/Send/01-step-amount.js

@ -17,6 +17,7 @@ const AccountField = ({ onChange, value, t }: *) => (
</Box> </Box>
) )
// TODO we should use isRecipientValid & provide a feedback to user
const RecipientField = ({ bridge, account, transaction, onChangeTransaction, t }: *) => ( const RecipientField = ({ bridge, account, transaction, onChangeTransaction, t }: *) => (
<Box flow={1}> <Box flow={1}>
<Label> <Label>
@ -26,9 +27,8 @@ const RecipientField = ({ bridge, account, transaction, onChangeTransaction, t }
<RecipientAddress <RecipientAddress
withQrCode withQrCode
value={bridge.getTransactionRecipient(account, transaction)} value={bridge.getTransactionRecipient(account, transaction)}
onChange={(recipient, { amount, currency }) => { onChange={(recipient, maybeExtra) => {
console.log(recipient, amount, currency, account.currency) const { amount, currency } = maybeExtra || {}
// TODO we should use isRecipientValid & provide a feedback to user
if (currency && currency.scheme !== account.currency.scheme) return false if (currency && currency.scheme !== account.currency.scheme) return false
let t = transaction let t = transaction
if (amount) { if (amount) {

Loading…
Cancel
Save