mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-28 03:08:30 +00:00
add SignTx modal with SendFormRippleReducer
This commit is contained in:
parent
e130b1edc0
commit
d7e0fb91cd
@ -19,7 +19,8 @@ type StateProps = {
|
||||
devices: $ElementType<State, 'devices'>,
|
||||
connect: $ElementType<State, 'connect'>,
|
||||
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||
sendForm: $ElementType<State, 'sendFormEthereum'>,
|
||||
sendFormEthereum: $ElementType<State, 'sendFormEthereum'>,
|
||||
sendFormRipple: $ElementType<State, 'sendFormRipple'>,
|
||||
receive: $ElementType<State, 'receive'>,
|
||||
localStorage: $ElementType<State, 'localStorage'>,
|
||||
wallet: $ElementType<State, 'wallet'>,
|
||||
@ -38,7 +39,8 @@ const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: St
|
||||
devices: state.devices,
|
||||
connect: state.connect,
|
||||
selectedAccount: state.selectedAccount,
|
||||
sendForm: state.sendFormEthereum,
|
||||
sendFormEthereum: state.sendFormEthereum,
|
||||
sendFormRipple: state.sendFormRipple,
|
||||
receive: state.receive,
|
||||
localStorage: state.localStorage,
|
||||
wallet: state.wallet,
|
||||
|
@ -12,12 +12,11 @@ import P from 'components/Paragraph';
|
||||
import Icon from 'components/Icon';
|
||||
import { H3 } from 'components/Heading';
|
||||
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
import type { Props as BaseProps } from '../../Container';
|
||||
import type { TrezorDevice, State } from 'flowtype';
|
||||
|
||||
type Props = {
|
||||
device: TrezorDevice;
|
||||
sendForm: $ElementType<BaseProps, 'sendForm'>;
|
||||
sendForm: $ElementType<State, 'sendFormEthereum'> | $ElementType<State, 'sendFormRipple'>;
|
||||
}
|
||||
|
||||
const Wrapper = styled.div`
|
||||
@ -51,10 +50,11 @@ const ConfirmSignTx = (props: Props) => {
|
||||
const {
|
||||
amount,
|
||||
address,
|
||||
currency,
|
||||
selectedFeeLevel,
|
||||
} = props.sendForm;
|
||||
|
||||
const currency: string = typeof props.sendForm.currency === 'string' ? props.sendForm.currency : props.sendForm.networkSymbol;
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Header>
|
||||
|
@ -88,13 +88,16 @@ const getDeviceContextModal = (props: Props) => {
|
||||
case 'ButtonRequest_PassphraseType':
|
||||
return <PassphraseType device={modal.device} />;
|
||||
|
||||
case 'ButtonRequest_SignTx':
|
||||
return <ConfirmSignTx device={modal.device} sendForm={props.sendForm} />;
|
||||
case 'ButtonRequest_SignTx': {
|
||||
const sendForm = props.selectedAccount.network && props.selectedAccount.network.type === 'ethereum' ? props.sendFormEthereum : props.sendFormRipple;
|
||||
return <ConfirmSignTx device={modal.device} sendForm={sendForm} />;
|
||||
}
|
||||
|
||||
case 'ButtonRequest_ProtectCall':
|
||||
return <ConfirmAction />;
|
||||
|
||||
case 'ButtonRequest_Other':
|
||||
case 'ButtonRequest_ConfirmOutput':
|
||||
return <ConfirmAction />;
|
||||
|
||||
case RECEIVE.REQUEST_UNVERIFIED:
|
||||
|
Loading…
Reference in New Issue
Block a user