Cleanup E2ePadlock
code (#7144)
This commit is contained in:
parent
f27eb04133
commit
8f13f3882f
2 changed files with 15 additions and 12 deletions
|
@ -424,8 +424,6 @@ $left-gutter: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
background-color: #ffffff;
|
|
||||||
mask-image: url('$(res)/img/e2e/normal.svg');
|
|
||||||
mask-repeat: no-repeat;
|
mask-repeat: no-repeat;
|
||||||
mask-position: center;
|
mask-position: center;
|
||||||
mask-size: 80%;
|
mask-size: 80%;
|
||||||
|
|
|
@ -1509,25 +1509,25 @@ export function haveTileForEvent(e: MatrixEvent, showHiddenEvents?: boolean) {
|
||||||
|
|
||||||
function E2ePadlockUndecryptable(props) {
|
function E2ePadlockUndecryptable(props) {
|
||||||
return (
|
return (
|
||||||
<E2ePadlock title={_t("This message cannot be decrypted")} icon="warning" {...props} />
|
<E2ePadlock title={_t("This message cannot be decrypted")} icon={E2ePadlockIcon.Warning} {...props} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function E2ePadlockUnverified(props) {
|
function E2ePadlockUnverified(props) {
|
||||||
return (
|
return (
|
||||||
<E2ePadlock title={_t("Encrypted by an unverified session")} icon="warning" {...props} />
|
<E2ePadlock title={_t("Encrypted by an unverified session")} icon={E2ePadlockIcon.Warning} {...props} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function E2ePadlockUnencrypted(props) {
|
function E2ePadlockUnencrypted(props) {
|
||||||
return (
|
return (
|
||||||
<E2ePadlock title={_t("Unencrypted")} icon="warning" {...props} />
|
<E2ePadlock title={_t("Unencrypted")} icon={E2ePadlockIcon.Warning} {...props} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function E2ePadlockUnknown(props) {
|
function E2ePadlockUnknown(props) {
|
||||||
return (
|
return (
|
||||||
<E2ePadlock title={_t("Encrypted by a deleted session")} icon="normal" {...props} />
|
<E2ePadlock title={_t("Encrypted by a deleted session")} icon={E2ePadlockIcon.Normal} {...props} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1535,14 +1535,19 @@ function E2ePadlockUnauthenticated(props) {
|
||||||
return (
|
return (
|
||||||
<E2ePadlock
|
<E2ePadlock
|
||||||
title={_t("The authenticity of this encrypted message can't be guaranteed on this device.")}
|
title={_t("The authenticity of this encrypted message can't be guaranteed on this device.")}
|
||||||
icon="unauthenticated"
|
icon={E2ePadlockIcon.Normal}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum E2ePadlockIcon {
|
||||||
|
Normal = "normal",
|
||||||
|
Warning = "warning",
|
||||||
|
}
|
||||||
|
|
||||||
interface IE2ePadlockProps {
|
interface IE2ePadlockProps {
|
||||||
icon: string;
|
icon: E2ePadlockIcon;
|
||||||
title: string;
|
title: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1551,7 +1556,7 @@ interface IE2ePadlockState {
|
||||||
}
|
}
|
||||||
|
|
||||||
class E2ePadlock extends React.Component<IE2ePadlockProps, IE2ePadlockState> {
|
class E2ePadlock extends React.Component<IE2ePadlockProps, IE2ePadlockState> {
|
||||||
constructor(props) {
|
constructor(props: IE2ePadlockProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -1559,15 +1564,15 @@ class E2ePadlock extends React.Component<IE2ePadlockProps, IE2ePadlockState> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onHoverStart = () => {
|
private onHoverStart = (): void => {
|
||||||
this.setState({ hover: true });
|
this.setState({ hover: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
onHoverEnd = () => {
|
private onHoverEnd = (): void => {
|
||||||
this.setState({ hover: false });
|
this.setState({ hover: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
public render(): JSX.Element {
|
||||||
let tooltip = null;
|
let tooltip = null;
|
||||||
if (this.state.hover) {
|
if (this.state.hover) {
|
||||||
tooltip = <Tooltip className="mx_EventTile_e2eIcon_tooltip" label={this.props.title} />;
|
tooltip = <Tooltip className="mx_EventTile_e2eIcon_tooltip" label={this.props.title} />;
|
||||||
|
|
Loading…
Reference in a new issue