1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-24 16:08:11 +00:00

Fix broken eject icon & disable click on Header in LeftNavigation if device is in bootloader moder

This commit is contained in:
Vasek Mlejnsky 2018-09-25 14:36:07 +02:00
parent 1d6e6976b6
commit 83e14f423e
4 changed files with 13 additions and 8 deletions

View File

@ -26,7 +26,7 @@ const Wrapper = styled.div`
box-shadow: none;
`}
${props => props.isHoverable && css`
${props => props.isHoverable && !props.disabled && css`
&:hover {
background: ${colors.GRAY_LIGHT};
}
@ -103,7 +103,10 @@ const DeviceHeader = ({
isHoverable={isHoverable}
disabled={disabled}
>
<ClickWrapper disabled={disabled} onClick={onClickWrapper}>
<ClickWrapper
disabled={disabled}
onClick={onClickWrapper}
>
<ImageWrapper>
<Dot color={getStatusColor(status)} />
<TrezorImage model={getVersion(device)} />

View File

@ -15,7 +15,9 @@ class DeviceList extends Component {
}
render() {
const { devices, selectedDevice, onSelectDevice } = this.props;
const {
devices, selectedDevice, onSelectDevice, forgetDevice,
} = this.props;
return (
<Wrapper>
{devices
@ -31,13 +33,13 @@ class DeviceList extends Component {
onSelectDevice(device);
}
}}
onClickIcon={() => this.onDeviceMenuClick({ type: 'forget', label: '' }, device)}
onClickIcon={() => forgetDevice(device)}
icon={(
<React.Fragment>
<IconClick onClick={(event) => {
event.stopPropagation();
event.preventDefault();
this.onDeviceMenuClick({ type: 'forget', label: '' }, device);
forgetDevice(device);
}}
>
<Icon

View File

@ -110,6 +110,7 @@ class DeviceMenu extends Component<Props> {
devices={devices}
selectedDevice={selectedDevice}
onSelectDevice={onSelectDevice}
forgetDevice={() => this.props.forgetDevice(selectedDevice)}
/>
<ButtonWrapper>
{isWebUSB(transport) && (

View File

@ -171,8 +171,7 @@ class LeftNavigation extends Component {
isSelected
onClickWrapper={() => this.handleOpen()}
device={this.props.wallet.selectedDevice}
transport={this.props.connect.transport}
devices={this.props.devices}
disabled={this.props.wallet.selectedDevice.features && this.props.wallet.selectedDevice.features.bootloader_mode && this.props.devices.length === 1}
isOpen={this.props.wallet.dropdownOpened}
icon={(
<React.Fragment>