Device manager - sign out of multiple sessions (#9325)
* add device selection that does nothing * multi select and sign out of sessions * test multiple selection * fix type after rebase
This commit is contained in:
parent
7a33818bd7
commit
772df30212
13 changed files with 224 additions and 33 deletions
|
@ -25,6 +25,7 @@ import { DeviceWithVerification } from "./types";
|
|||
import { DeviceType } from "./DeviceType";
|
||||
export interface DeviceTileProps {
|
||||
device: DeviceWithVerification;
|
||||
isSelected?: boolean;
|
||||
children?: React.ReactNode;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
@ -68,7 +69,12 @@ const DeviceMetadata: React.FC<{ value: string | React.ReactNode, id: string }>
|
|||
value ? <span data-testid={`device-metadata-${id}`}>{ value }</span> : null
|
||||
);
|
||||
|
||||
const DeviceTile: React.FC<DeviceTileProps> = ({ device, children, onClick }) => {
|
||||
const DeviceTile: React.FC<DeviceTileProps> = ({
|
||||
device,
|
||||
children,
|
||||
isSelected,
|
||||
onClick,
|
||||
}) => {
|
||||
const inactive = getInactiveMetadata(device);
|
||||
const lastActivity = device.last_seen_ts && `${_t('Last activity')} ${formatLastActivity(device.last_seen_ts)}`;
|
||||
const verificationStatus = device.isVerified ? _t('Verified') : _t('Unverified');
|
||||
|
@ -83,7 +89,7 @@ const DeviceTile: React.FC<DeviceTileProps> = ({ device, children, onClick }) =>
|
|||
];
|
||||
|
||||
return <div className="mx_DeviceTile" data-testid={`device-tile-${device.device_id}`}>
|
||||
<DeviceType isVerified={device.isVerified} />
|
||||
<DeviceType isVerified={device.isVerified} isSelected={isSelected} />
|
||||
<div className="mx_DeviceTile_info" onClick={onClick}>
|
||||
<DeviceTileName device={device} />
|
||||
<div className="mx_DeviceTile_metadata">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue