swtich hardcoded T1 icons to DeviceIcon component

pull/349/head
slowbackspace 5 years ago
parent 46bced2fdd
commit b09b5f854d

@ -1,10 +1,15 @@
/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { H3 } from 'components/Heading';
import ICONS from 'config/icons';
import Icon from 'components/Icon';
import DeviceIcon from 'components/images/DeviceIcon';
import type { TrezorDevice } from 'flowtype';
type Props = {
device: TrezorDevice;
}
const Wrapper = styled.div``;
@ -12,13 +17,18 @@ const Header = styled.div`
padding: 48px;
`;
const ConfirmAction = () => (
const ConfirmAction = (props: Props) => (
<Wrapper>
<Header>
<Icon icon={ICONS.T1} size={100} />
<DeviceIcon device={props.device} size={100} />
<H3>Confirm action on your Trezor</H3>
</Header>
</Wrapper>
);
ConfirmAction.propTypes = {
device: PropTypes.object.isRequired,
};
export default ConfirmAction;

@ -4,12 +4,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import icons from 'config/icons';
import colors from 'config/colors';
import { LINE_HEIGHT, FONT_SIZE, FONT_WEIGHT } from 'config/variables';
import P from 'components/Paragraph';
import Icon from 'components/Icon';
import DeviceIcon from 'components/images/DeviceIcon';
import { H3 } from 'components/Heading';
import type { TrezorDevice, State } from 'flowtype';
@ -71,7 +70,7 @@ const ConfirmSignTx = (props: Props) => {
return (
<Wrapper>
<Header>
<Icon icon={icons.T1} size={60} color={colors.TEXT_SECONDARY} />
<DeviceIcon device={props.device} size={60} color={colors.TEXT_SECONDARY} />
<H3>Confirm transaction on { props.device.label } device</H3>
<P isSmaller>Details are shown on display</P>
</Header>

@ -96,11 +96,11 @@ const getDeviceContextModal = (props: Props) => {
}
case 'ButtonRequest_ProtectCall':
return <ConfirmAction />;
return <ConfirmAction device={modal.device} />;
case 'ButtonRequest_Other':
case 'ButtonRequest_ConfirmOutput':
return <ConfirmAction />;
return <ConfirmAction device={modal.device} />;
case RECEIVE.REQUEST_UNVERIFIED:
return (

@ -4,10 +4,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import icons from 'config/icons';
import colors from 'config/colors';
import Icon from 'components/Icon';
import DeviceIcon from 'components/images/DeviceIcon';
import { H3 } from 'components/Heading';
import P from 'components/Paragraph';
@ -27,7 +26,7 @@ const Header = styled.div``;
const PassphraseType = (props: Props) => (
<Wrapper>
<Header>
<Icon icon={icons.T1} size={60} color={colors.TEXT_SECONDARY} />
<DeviceIcon device={props.device} size={60} color={colors.TEXT_SECONDARY} />
<H3>Complete the action on { props.device.label } device</H3>
<P isSmaller>If you enter a wrong passphrase, you will not unlock the desired hidden wallet.</P>
</Header>

@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import Icon from 'components/Icon';
import DeviceIcon from 'components/images/DeviceIcon';
import icons from 'config/icons';
import colors from 'config/colors';
@ -77,11 +78,7 @@ class MenuItems extends PureComponent {
</Item>
{this.showClone() && (
<Item onClick={() => this.onDeviceMenuClick('clone', this.props.device)}>
<Icon
icon={icons.T1}
size={25}
color={colors.TEXT_SECONDARY}
/>
<DeviceIcon device={this.props.device} size={25} color={colors.TEXT_SECONDARY} />
<Label>Change wallet type</Label>
</Item>
)}
@ -89,7 +86,7 @@ class MenuItems extends PureComponent {
<Item
onClick={() => this.onDeviceMenuClick('reload')}
>
<Icon icon={icons.T1} size={25} color={colors.TEXT_SECONDARY} />
<DeviceIcon device={this.props.device} size={25} color={colors.TEXT_SECONDARY} />
<Label>Renew session</Label>
</Item>
)}

@ -8,6 +8,7 @@ import Button from 'components/Button';
import Icon from 'components/Icon';
import Tooltip from 'components/Tooltip';
import Input from 'components/inputs/Input';
import DeviceIcon from 'components/images/DeviceIcon';
import ICONS from 'config/icons';
import colors from 'config/colors';
@ -131,10 +132,7 @@ const AccountReceive = (props: Props) => {
isPartiallyHidden={isAddressHidden}
trezorAction={isAddressVerifying ? (
<React.Fragment>
<Icon
icon={ICONS.T1}
color={colors.WHITE}
/>
<DeviceIcon device={device} color={colors.WHITE} />
Check address on your Trezor
</React.Fragment>
) : null}

@ -8,6 +8,7 @@ import Button from 'components/Button';
import Icon from 'components/Icon';
import Tooltip from 'components/Tooltip';
import Input from 'components/inputs/Input';
import DeviceIcon from 'components/images/DeviceIcon';
import ICONS from 'config/icons';
import colors from 'config/colors';
@ -131,10 +132,7 @@ const AccountReceive = (props: Props) => {
isPartiallyHidden={isAddressHidden}
trezorAction={isAddressVerifying ? (
<React.Fragment>
<Icon
icon={ICONS.T1}
color={colors.WHITE}
/>
<DeviceIcon device={device} color={colors.WHITE} />
Check address on your Trezor
</React.Fragment>
) : null}

Loading…
Cancel
Save