Make device image in list a link to the device
This commit is contained in:
parent
9296226036
commit
1506c40d61
@ -122,14 +122,18 @@ class DeviceView extends React.Component<DeviceViewProps> {
|
|||||||
} else {
|
} else {
|
||||||
const { connectionState } = this.device;
|
const { connectionState } = this.device;
|
||||||
let header: React.ReactNode;
|
let header: React.ReactNode;
|
||||||
|
let image: React.ReactNode;
|
||||||
if (inList) { // tslint:disable-line:prefer-conditional-expression
|
if (inList) { // tslint:disable-line:prefer-conditional-expression
|
||||||
header = <Link to={route.device(this.deviceInfo.id)}>Device <kbd>{this.deviceInfo.name}</kbd></Link>;
|
const devicePath = route.device(this.deviceInfo.id);
|
||||||
|
header = <Link to={devicePath}>Device <kbd>{this.deviceInfo.name}</kbd></Link>;
|
||||||
|
image = <DeviceImage size="tiny" as={Link} to={devicePath} />;
|
||||||
} else {
|
} else {
|
||||||
header = <span>Device <kbd>{this.deviceInfo.name}</kbd></span>;
|
header = <span>Device <kbd>{this.deviceInfo.name}</kbd></span>;
|
||||||
|
image = <DeviceImage />;
|
||||||
}
|
}
|
||||||
itemContent = (
|
itemContent = (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<DeviceImage size={inList ? "tiny" : undefined} />
|
{image}
|
||||||
<Item.Content className="device">
|
<Item.Content className="device">
|
||||||
<Header as={inList ? "h2" : "h1"}>
|
<Header as={inList ? "h2" : "h1"}>
|
||||||
{header}
|
{header}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user