/* @flow */
'use strict';
import React from 'react';
import { findSelectedDevice } from '../../reducers/TrezorConnectReducer';
const ConfirmAddress = (props: any): any => {
const account = props.accounts.find(a => a.deviceState === props.receive.deviceState && a.index === props.receive.accountIndex && a.network === props.receive.network);
const { config } = props.localStorage;
const selectedCoin = config.coins.find(c => c.network === account.network);
return (
Confirm address on TREZOR
Please compare your address on device with address shown bellow.
{ account.address }
{ selectedCoin.symbol } account #{ (account.index + 1) }
);
}
export default ConfirmAddress;
export const ConfirmUnverifiedAddress = (props: any): any => {
const account = props.accounts.find(a => a.deviceState === props.receive.deviceState && a.index === props.receive.accountIndex && a.network === props.receive.network);
const {
onCancel
} = props.modalActions;
const {
showUnverifiedAddress,
showAddress
} = props.receiveActions;
const {
device
} = props.modal;
if (!device.connected) {
return (
{ device.instanceLabel } is not connected
To prevent phishing attacks, you should verify the address on your TREZOR first. Please reconnect your device to continue with the verification process.
{
onCancel();
showAddress(account.addressPath);
} }>Try again
{
onCancel();
showUnverifiedAddress();
} }>Show unverified address
);
} else {
const enable: string = device.features.passphrase_protection ? 'Enable' : 'Disable';
return (
{ device.instanceLabel } is unavailable
To prevent phishing attacks, you should verify the address on your TREZOR first. { enable } passphrase settings to continue with the verification process.
{
onCancel();
showAddress(account.addressPath);
} }>Try again
{
onCancel();
showUnverifiedAddress();
} }>Show unverified address
);
}
}