1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +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 cfda758ecb
commit 1bc6fa9412
4 changed files with 12 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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