1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Added one more status for device

This commit is contained in:
Vladimir Volek 2018-08-23 11:52:55 +02:00
parent 2c5ec70a02
commit 8a0591bfd5
2 changed files with 8 additions and 7 deletions

View File

@ -29,6 +29,9 @@ const getStatusName = (deviceStatus) => {
case 'disconnected': case 'disconnected':
statusName = 'Disconnected'; statusName = 'Disconnected';
break; break;
case 'unacquired':
statusName = 'Used in other window';
break;
case 'unavailable': case 'unavailable':
statusName = 'Unavailable'; statusName = 'Unavailable';
break; break;
@ -61,6 +64,9 @@ const getStatusColor = (deviceStatus) => {
case 'connected': case 'connected':
color = colors.GREEN_PRIMARY; color = colors.GREEN_PRIMARY;
break; break;
case 'unacquired':
color = colors.WARNING_PRIMARY;
break;
case 'disconnected': case 'disconnected':
color = colors.ERROR_PRIMARY; color = colors.ERROR_PRIMARY;
break; break;

View File

@ -17,16 +17,11 @@ const Wrapper = styled.div`
background: ${colors.WHITE}; background: ${colors.WHITE};
border-bottom: 1px solid ${colors.DIVIDER}; border-bottom: 1px solid ${colors.DIVIDER};
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
cursor: pointer;
${props => props.isOpen && css` ${props => props.isOpen && css`
border-bottom: 1px solid ${colors.WHITE}; border-bottom: 1px solid ${colors.WHITE};
box-shadow: none; box-shadow: none;
`} `}
${props => props.disabled && css`
cursor: initial;
`}
`; `;
const ClickWrapper = styled.div` const ClickWrapper = styled.div`
@ -119,11 +114,11 @@ class DeviceHeader extends Component {
status, label, deviceCount, isOpen, trezorModel, disabled, status, label, deviceCount, isOpen, trezorModel, disabled,
} = this.props; } = this.props;
return ( return (
<Wrapper isOpen={isOpen} disabled={disabled}> <Wrapper isOpen={isOpen}>
<ClickWrapper disabled={disabled} onClick={() => this.handleClick()}> <ClickWrapper disabled={disabled} onClick={() => this.handleClick()}>
<ImageWrapper> <ImageWrapper>
<Dot color={getStatusColor(status)} /> <Dot color={getStatusColor(status)} />
<TrezorImage status={status} model={trezorModel} /> <TrezorImage model={trezorModel} />
</ImageWrapper> </ImageWrapper>
<LabelWrapper> <LabelWrapper>
<Name>{label}</Name> <Name>{label}</Name>