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