this.props.onSelectDevice(device)}
+ >
{device.instanceLabel}
- {this.getStatus(device)}
+ {getStatus(device)}
{
const { devices } = props;
const { transport } = props.connect;
@@ -41,10 +47,6 @@ export const DeviceSelect = (props: Props) => {
css += ' trezor-t';
}
- const handleOpen = () => {
- props.toggleDeviceDropdown(!props.deviceDropdownOpened);
- };
-
const deviceCount = devices.length;
const webusb: boolean = !!((transport && transport.version.indexOf('webusb') >= 0));
const disabled: boolean = (devices.length < 1 && !webusb) || (devices.length === 1 && !selected.features && !webusb);
@@ -52,14 +54,28 @@ export const DeviceSelect = (props: Props) => {
css += ' disabled';
}
+ const handleOpen = () => {
+ props.toggleDeviceDropdown(!props.deviceDropdownOpened);
+ };
+
return (
-
-
-
{selected.instanceLabel}
-
{deviceStatus}
+
+
+
+
+ {selected.instanceLabel}
+ {deviceStatus}
+
+ {deviceCount > 1 ?
{deviceCount}
: null}
+
- {deviceCount > 1 ?
{deviceCount}
: null}
-
);
};
@@ -172,7 +188,7 @@ export class DeviceDropdown extends Component
{
const sortByInstance = (a: TrezorDevice, b: TrezorDevice) => {
if (!a.instance || !b.instance) return -1;
return a.instance > b.instance ? 1 : -1;
- }
+ };
const deviceList = devices.sort(sortByInstance).map((dev, index) => {
if (dev === selected) return null;
@@ -214,14 +230,14 @@ export class DeviceDropdown extends Component {
);
});
-
return (
-
+
{currentDeviceMenu}
- {deviceList.length > 1 ? : null}
+ {this.props.devices.length > 1 ? : null}
+ {/* */}
{deviceList}
{webUsbButton}
-
+
);
}
}