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

Commit babbbfd

Browse files
committed
make styling closer to the Figma design
1 parent 70a6cbb commit babbbfd

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

res/css/views/messages/_DecryptionFailureBody.pcss

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ Please see LICENSE files in the repository root for full details.
1111
font-style: italic;
1212
}
1313

14-
.mx_DecryptionFailureVerifiedIdentityChanged {
15-
color: red;
14+
.mx_DecryptionFailureVerifiedIdentityChanged > span {
15+
color: $e2e-warning-color;
16+
border-radius: $font-16px;
17+
border-width: 1px;
18+
border-color: $e2e-warning-color;
19+
border-style: solid;
20+
padding: $font-1px 0.4em $font-1px 0.4em;
21+
display: inline-flex;
22+
align-items: center;
23+
24+
.mx_Icon {
25+
margin-inline-start: -0.3em;
26+
margin-inline-end: 0.2em;
27+
}
1628
}

src/components/views/messages/DecryptionFailureBody.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import { DecryptionFailureCode } from "matrix-js-sdk/src/crypto-api";
1414
import { _t } from "../../../languageHandler";
1515
import { IBodyProps } from "./IBodyProps";
1616
import { LocalDeviceVerificationStateContext } from "../../../contexts/LocalDeviceVerificationStateContext";
17+
import { Icon as WarningBadgeIcon } from "../../../../res/img/compound/error-16px.svg";
1718

18-
function getErrorMessage(mxEvent: MatrixEvent, isVerified: boolean | undefined): string {
19+
function getErrorMessage(mxEvent: MatrixEvent, isVerified: boolean | undefined): string | React.JSX.Element {
1920
switch (mxEvent.decryptionFailureReason) {
2021
case DecryptionFailureCode.MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE:
2122
return _t("timeline|decryption_failure|blocked");
@@ -36,7 +37,12 @@ function getErrorMessage(mxEvent: MatrixEvent, isVerified: boolean | undefined):
3637
return _t("timeline|decryption_failure|historical_event_user_not_joined");
3738

3839
case DecryptionFailureCode.SENDER_IDENTITY_PREVIOUSLY_VERIFIED:
39-
return _t("timeline|decryption_failure|sender_identity_previously_verified");
40+
return (
41+
<span>
42+
<WarningBadgeIcon className="mx_Icon mx_Icon_16" />
43+
{_t("timeline|decryption_failure|sender_identity_previously_verified")}
44+
</span>
45+
);
4046

4147
case DecryptionFailureCode.UNSIGNED_SENDER_DEVICE:
4248
// TODO: event should be hidden instead of showing this error (only

0 commit comments

Comments
 (0)