diff --git a/src/components/DeviceHeader/index.js b/src/components/DeviceHeader/index.js index ad9b7c54..8315b326 100644 --- a/src/components/DeviceHeader/index.js +++ b/src/components/DeviceHeader/index.js @@ -42,7 +42,7 @@ const ClickWrapper = styled.div` cursor: pointer; ${props => props.disabled && css` - cursor: not-allowed; + cursor: default; `} `; @@ -93,7 +93,14 @@ const Dot = styled.div` const DeviceHeader = ({ - isOpen, icon, device, isHoverable = true, onClickWrapper, disabled = false, isSelected = false, + isOpen, + icon, + device, + isHoverable = true, + onClickWrapper, + isBootloader = false, + disabled = false, + isSelected = false, }) => { const status = getStatus(device); return ( @@ -116,7 +123,7 @@ const DeviceHeader = ({ {getStatusName(status)} - {icon && !disabled && icon} + {icon && !disabled && !isBootloader && icon} @@ -124,6 +131,7 @@ const DeviceHeader = ({ }; DeviceHeader.propTypes = { + isBootloader: PropTypes.bool, device: PropTypes.object, icon: PropTypes.element, isHoverable: PropTypes.bool, diff --git a/src/views/Wallet/components/LeftNavigation/components/DeviceMenu/components/DeviceList/index.js b/src/views/Wallet/components/LeftNavigation/components/DeviceMenu/components/DeviceList/index.js index d8228df3..d4b86412 100644 --- a/src/views/Wallet/components/LeftNavigation/components/DeviceMenu/components/DeviceList/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/DeviceMenu/components/DeviceList/index.js @@ -4,6 +4,7 @@ import Icon from 'components/Icon'; import DeviceHeader from 'components/DeviceHeader'; import icons from 'config/icons'; import colors from 'config/colors'; +import { withRouter } from 'react-router-dom'; const Wrapper = styled.div``; const IconClick = styled.div``; @@ -14,6 +15,10 @@ class DeviceList extends Component { return a.instance > b.instance ? 1 : -1; } + redirectToBootloader(selectedDevice) { + this.props.history.push(`/device/${selectedDevice.features.device_id}/bootloader`); + } + render() { const { devices, selectedDevice, onSelectDevice, forgetDevice, @@ -26,10 +31,12 @@ class DeviceList extends Component { device !== selectedDevice && ( { - if (device.features - && !device.features.bootloader_mode) { + if (device.features) { + if (device.features.bootloader_mode) { + this.redirectToBootloader(selectedDevice); + } onSelectDevice(device); } }} @@ -62,4 +69,4 @@ class DeviceList extends Component { } } -export default DeviceList; \ No newline at end of file +export default withRouter(DeviceList); \ No newline at end of file diff --git a/src/views/Wallet/components/LeftNavigation/index.js b/src/views/Wallet/components/LeftNavigation/index.js index 40666081..0856d41f 100644 --- a/src/views/Wallet/components/LeftNavigation/index.js +++ b/src/views/Wallet/components/LeftNavigation/index.js @@ -187,6 +187,7 @@ class LeftNavigation extends React.PureComponent { >
{ if (!isDeviceInBootloader || this.props.devices.length > 1) { this.handleOpen();