Skip to content

Commit 3dd1253

Browse files
committed
feat: add unencrypted icon for unencrypted rooms
1 parent 481f178 commit 3dd1253

2 files changed

Lines changed: 29 additions & 6 deletions

File tree

res/css/views/rooms/_MessageComposer.pcss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ Please see LICENSE files in the repository root for full details.
8282
height: 12px;
8383
}
8484

85+
.mx_MessageComposer_e2eIcon-new {
86+
position: absolute;
87+
left: 23px;
88+
}
89+
8590
.mx_MessageComposer_noperm_error {
8691
width: 100%;
8792
height: 60px;
@@ -336,4 +341,8 @@ Please see LICENSE files in the repository root for full details.
336341
.mx_MessageComposer_e2eIcon {
337342
left: 0;
338343
}
344+
345+
.mx_MessageComposer_e2eIcon-new {
346+
left: 5px;
347+
}
339348
}

src/components/views/rooms/MessageComposer.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import { type Optional } from "matrix-events-sdk";
2020
import { Tooltip } from "@vector-im/compound-web";
2121
import { logger } from "matrix-js-sdk/src/logger";
22+
import LockOffIcon from "@vector-im/compound-design-tokens/assets/web/icons/lock-off";
2223

2324
import { _t } from "../../../languageHandler";
2425
import { MatrixClientPeg } from "../../../MatrixClientPeg";
@@ -525,12 +526,25 @@ export class MessageComposer extends React.Component<IProps, IState> {
525526
};
526527

527528
public render(): React.ReactNode {
528-
const hasE2EIcon = Boolean(!this.state.isWysiwygLabEnabled && this.props.e2eStatus === E2EStatus.Warning);
529-
const e2eIcon = hasE2EIcon && (
530-
<div className="mx_MessageComposer_e2eIconWrapper">
531-
<E2EIcon key="e2eIcon" status={this.props.e2eStatus!} className="mx_MessageComposer_e2eIcon" />
532-
</div>
533-
);
529+
const isUnencrypted = !this.props.e2eStatus;
530+
const encryptionWarning = this.props.e2eStatus === E2EStatus.Verified;
531+
const hasE2EIcon = Boolean(!this.state.isWysiwygLabEnabled && (encryptionWarning || isUnencrypted));
532+
533+
let e2eIcon: ReactNode;
534+
if (hasE2EIcon) {
535+
e2eIcon = encryptionWarning ? (
536+
<div className="mx_MessageComposer_e2eIconWrapper">
537+
<E2EIcon key="e2eIcon" status={this.props.e2eStatus!} className="mx_MessageComposer_e2eIcon" />
538+
</div>
539+
) : (
540+
<LockOffIcon
541+
className="mx_MessageComposer_e2eIcon-new"
542+
width="12"
543+
height="12"
544+
color="var(--cpd-color-icon-info-primary)"
545+
/>
546+
);
547+
}
534548

535549
const controls: ReactNode[] = [];
536550
const menuPosition = this.getMenuPosition();

0 commit comments

Comments
 (0)