Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7b52145

Browse files
author
Kerry
authored
Device manager - device security recommendation card (PSG-637) (#9158)
* add security card and style * deprecate warning and verified svgs that use hard coded color * style icons, test * i18n * stylelint * redo lost lint fixes * fix svg ref * actually fix svg * fix stupid copy pasting * use rgba for e2e light variations * add security card and style * deprecate warning and verified svgs that use hard coded color * style icons, test * i18n * stylelint * fix svg ref * actually fix svg * fix stupid copy pasting * use rgba for e2e light variations * use device security card in current session section * lint * update snapshot test after dev merge
1 parent 0be622e commit 7b52145

File tree

18 files changed

+401
-11
lines changed

18 files changed

+401
-11
lines changed

res/css/_components.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
@import "./components/views/messages/_MBeaconBody.pcss";
2929
@import "./components/views/messages/shared/_MediaProcessingError.pcss";
3030
@import "./components/views/settings/devices/_DeviceDetails.pcss";
31+
@import "./components/views/settings/devices/_DeviceSecurityCard.pcss";
3132
@import "./components/views/settings/devices/_DeviceTile.pcss";
3233
@import "./components/views/settings/devices/_FilteredDeviceList.pcss";
3334
@import "./components/views/settings/devices/_SelectableDeviceTile.pcss";
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_DeviceSecurityCard {
18+
width: 100%;
19+
display: flex;
20+
flex-direction: row;
21+
align-items: flex-start;
22+
23+
padding: $spacing-16;
24+
25+
border: 1px solid $quinary-content;
26+
border-radius: 8px;
27+
}
28+
29+
.mx_DeviceSecurityCard_icon {
30+
flex: 0 0 40px;
31+
display: flex;
32+
align-items: center;
33+
justify-content: center;
34+
margin-right: $spacing-16;
35+
border-radius: 8px;
36+
37+
height: 40px;
38+
width: 40px;
39+
40+
color: var(--icon-color);
41+
background-color: var(--background-color);
42+
43+
&.Verified {
44+
--icon-color: $e2e-verified-color;
45+
--background-color: $e2e-verified-color-light;
46+
}
47+
48+
&.Unverified {
49+
--icon-color: $e2e-warning-color;
50+
--background-color: $e2e-warning-color-light;
51+
}
52+
53+
&.Inactive {
54+
--icon-color: $secondary-content;
55+
--background-color: $system;
56+
}
57+
}
58+
59+
.mx_DeviceSecurityCard_content {
60+
flex: 1 1;
61+
}
62+
.mx_DeviceSecurityCard_heading {
63+
margin: 0 0 $spacing-4 0;
64+
}
65+
.mx_DeviceSecurityCard_description {
66+
margin: 0 0 $spacing-8 0;
67+
font-size: $font-12px;
68+
color: $secondary-content;
69+
}
Lines changed: 3 additions & 0 deletions
Loading

res/img/e2e/verified.svg

Lines changed: 1 addition & 1 deletion
Loading

res/img/e2e/warning-deprecated.svg

Lines changed: 3 additions & 0 deletions
Loading

res/img/e2e/warning.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 3 additions & 0 deletions
Loading

res/themes/legacy-light/css/_legacy-light.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ $e2e-verified-color: #76cfa5; /* N.B. *NOT* the same as $accent */
217217
$e2e-unknown-color: #e8bf37;
218218
$e2e-unverified-color: #e8bf37;
219219
$e2e-warning-color: #ba6363;
220+
$e2e-verified-color-light: rgba($e2e-verified-color, 0.06);
221+
$e2e-warning-color-light: rgba($e2e-warning-color, 0.06);
220222

221223
/*** ImageView ***/
222224
$lightbox-bg-color: #454545;

res/themes/light/css/_light.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ $e2e-verified-color: #76cfa5; /* N.B. *NOT* the same as $accent */
201201
$e2e-unknown-color: #e8bf37;
202202
$e2e-unverified-color: #e8bf37;
203203
$e2e-warning-color: #ba6363;
204+
$e2e-verified-color-light: rgba($e2e-verified-color, 0.06);
205+
$e2e-warning-color-light: rgba($e2e-warning-color, 0.06);
204206
/* ******************** */
205207

206208
/* Tabbed views */

src/components/views/dialogs/security/SetupEncryptionDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import { IDialogProps } from "../IDialogProps";
2424

2525
function iconFromPhase(phase: Phase) {
2626
if (phase === Phase.Done) {
27-
return require("../../../../../res/img/e2e/verified.svg").default;
27+
return require("../../../../../res/img/e2e/verified-deprecated.svg").default;
2828
} else {
29-
return require("../../../../../res/img/e2e/warning.svg").default;
29+
return require("../../../../../res/img/e2e/warning-deprecated.svg").default;
3030
}
3131
}
3232

0 commit comments

Comments
 (0)