Device manager - device type and verification icons on device tile (PSG-637) (#9197)

* add unknown device icon

* add device type and verification icon component

* test

* stylelint

* fix securitycard spacing

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
Kerry 2022-08-29 12:48:00 +02:00 committed by GitHub
parent 5aae974e93
commit 825a0af4a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 480 additions and 27 deletions

View file

@ -31,6 +31,7 @@
@import "./components/views/settings/devices/_DeviceExpandDetailsButton.pcss";
@import "./components/views/settings/devices/_DeviceSecurityCard.pcss";
@import "./components/views/settings/devices/_DeviceTile.pcss";
@import "./components/views/settings/devices/_DeviceType.pcss";
@import "./components/views/settings/devices/_FilteredDeviceList.pcss";
@import "./components/views/settings/devices/_SecurityRecommendations.pcss";
@import "./components/views/settings/devices/_SelectableDeviceTile.pcss";

View file

@ -68,3 +68,7 @@ limitations under the License.
font-size: $font-12px;
color: $secondary-content;
}
.mx_DeviceSecurityCard_actions {
margin-top: $spacing-16;
}

View file

@ -0,0 +1,66 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_DeviceType {
flex: 0 0 auto;
position: relative;
margin-right: $spacing-8;
/* creates space for verification icon to overlap */
padding: 0 $spacing-8 $spacing-8 0;
}
.mx_DeviceType_deviceIcon {
--background-color: $system;
--icon-color: $secondary-content;
height: 40px;
width: 40px;
box-sizing: border-box;
border: $spacing-8 solid var(--background-color);
border-radius: 50%;
color: var(--icon-color);
background-color: var(--background-color);
}
.mx_DeviceType_selected .mx_DeviceType_deviceIcon {
--background-color: $primary-content;
--icon-color: $background;
}
.mx_DeviceType_verificationIcon {
position: absolute;
bottom: 0;
right: 0;
height: 24px;
width: 24px;
box-sizing: border-box;
padding: $spacing-4;
border: 1px solid $system;
border-radius: 50%;
background-color: $background;
color: var(--v-icon-color);
&.verified {
--v-icon-color: $e2e-verified-color;
}
&.unverified {
--v-icon-color: $e2e-warning-color;
}
}

View file

@ -57,6 +57,12 @@ limitations under the License.
margin-block: 10px;
min-height: 35px;
padding: 0 $spacing-8;
.mx_DeviceType {
/* hide the new device type in legacy device list
for backwards compat reasons */
display: none;
}
}
.mx_DevicesPanel_icon {

View file

@ -0,0 +1,3 @@
<svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 22.5C17.0751 22.5 22 17.5751 22 11.5C22 5.42487 17.0751 0.5 11 0.5C4.92487 0.5 0 5.42487 0 11.5C0 17.5751 4.92487 22.5 11 22.5ZM11.0002 18.2605C11.7596 18.2605 12.3752 17.6449 12.3752 16.8855C12.3752 16.1261 11.7596 15.5105 11.0002 15.5105C10.2408 15.5105 9.6252 16.1261 9.6252 16.8855C9.6252 17.6449 10.2408 18.2605 11.0002 18.2605ZM9.0899 9.42801C9.0899 8.3697 9.94859 7.51827 10.9996 7.51827C12.0476 7.51827 12.9093 8.38001 12.9093 9.42801C12.9093 9.91336 12.7018 10.0866 11.8839 10.6516C11.5215 10.902 11.0246 11.2498 10.6376 11.7599C10.2233 12.306 9.96838 12.9869 9.96838 13.8528H12.0309C12.0309 13.4287 12.1436 13.1873 12.2807 13.0065C12.4452 12.7897 12.6834 12.6061 13.0563 12.3485C13.0955 12.3215 13.1368 12.2933 13.18 12.264C13.8559 11.8042 14.9718 11.0452 14.9718 9.42801C14.9718 7.24094 13.1867 5.45577 10.9996 5.45577C8.8156 5.45577 7.0274 7.22452 7.0274 9.42801H9.0899Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 1 KiB