From 01b789a78e9aede7a8d384d5d0477bd8d65a2b1e Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Thu, 17 Jan 2019 17:13:21 +0100 Subject: [PATCH] add button to scan qr code next to the address input --- .../views/Account/Send/ethereum/Container.js | 4 ++++ .../views/Account/Send/ethereum/index.js | 21 ++++++++++++++++++ .../views/Account/Send/ripple/Container.js | 3 +++ .../Wallet/views/Account/Send/ripple/index.js | 22 +++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/src/views/Wallet/views/Account/Send/ethereum/Container.js b/src/views/Wallet/views/Account/Send/ethereum/Container.js index 19982c8f..baa378d2 100644 --- a/src/views/Wallet/views/Account/Send/ethereum/Container.js +++ b/src/views/Wallet/views/Account/Send/ethereum/Container.js @@ -4,6 +4,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import SendFormActions from 'actions/ethereum/SendFormActions'; +import { openQrModal } from 'actions/ModalActions'; import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { State, Dispatch } from 'flowtype'; import AccountSend from './index'; @@ -20,6 +21,7 @@ export type StateProps = { export type DispatchProps = { sendFormActions: typeof SendFormActions, + openQrModal: typeof openQrModal, } export type Props = StateProps & DispatchProps; @@ -34,6 +36,8 @@ const mapStateToProps: MapStateToProps = (state: St const mapDispatchToProps: MapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ sendFormActions: bindActionCreators(SendFormActions, dispatch), + openQrModal: bindActionCreators(openQrModal, dispatch), + }); export default connect(mapStateToProps, mapDispatchToProps)(AccountSend); \ No newline at end of file diff --git a/src/views/Wallet/views/Account/Send/ethereum/index.js b/src/views/Wallet/views/Account/Send/ethereum/index.js index 4da01e1d..2c328844 100644 --- a/src/views/Wallet/views/Account/Send/ethereum/index.js +++ b/src/views/Wallet/views/Account/Send/ethereum/index.js @@ -159,6 +159,14 @@ const AdvancedSettingsIcon = styled(Icon)` margin-left: 10px; `; +const QrButton = styled(Button)` + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + border-left: 0px; + height: 40px; + padding: 0 10px; +`; + // render helpers const getAddressInputState = (address: string, addressErrors: string, addressWarnings: string): string => { let state = ''; @@ -281,6 +289,19 @@ const AccountSend = (props: Props) => { bottomText={errors.address || warnings.address || infos.address} value={address} onChange={event => onAddressChange(event.target.value)} + sideAddons={[( + + + + )]} /> diff --git a/src/views/Wallet/views/Account/Send/ripple/Container.js b/src/views/Wallet/views/Account/Send/ripple/Container.js index ea29c363..aeebe926 100644 --- a/src/views/Wallet/views/Account/Send/ripple/Container.js +++ b/src/views/Wallet/views/Account/Send/ripple/Container.js @@ -4,6 +4,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import SendFormActions from 'actions/ripple/SendFormActions'; +import { openQrModal } from 'actions/ModalActions'; import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { State, Dispatch } from 'flowtype'; import AccountSend from './index'; @@ -20,6 +21,7 @@ export type StateProps = { export type DispatchProps = { sendFormActions: typeof SendFormActions, + openQrModal: typeof openQrModal, } export type Props = StateProps & DispatchProps; @@ -34,6 +36,7 @@ const mapStateToProps: MapStateToProps = (state: St const mapDispatchToProps: MapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ sendFormActions: bindActionCreators(SendFormActions, dispatch), + openQrModal: bindActionCreators(openQrModal, dispatch), }); export default connect(mapStateToProps, mapDispatchToProps)(AccountSend); \ No newline at end of file diff --git a/src/views/Wallet/views/Account/Send/ripple/index.js b/src/views/Wallet/views/Account/Send/ripple/index.js index f6582587..c9d0eaba 100644 --- a/src/views/Wallet/views/Account/Send/ripple/index.js +++ b/src/views/Wallet/views/Account/Send/ripple/index.js @@ -156,6 +156,15 @@ const AdvancedSettingsIcon = styled(Icon)` margin-left: 10px; `; +const QrButton = styled(Button)` + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + border-left: 0px; + height: 40px; + padding: 0 10px; +`; + + // render helpers const getAddressInputState = (address: string, addressErrors: string, addressWarnings: string): string => { let state = ''; @@ -254,6 +263,19 @@ const AccountSend = (props: Props) => { bottomText={errors.address || warnings.address || infos.address} value={address} onChange={event => onAddressChange(event.target.value)} + sideAddons={[( + + + + )]} />