mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Merge pull request #1911 from robintown/lock-accessibility
Make the encryption lock more accessible
This commit is contained in:
commit
0c2a410033
@ -29,17 +29,22 @@ interface Props {
|
||||
export const EncryptionLock: FC<Props> = ({ encrypted }) => {
|
||||
const { t } = useTranslation();
|
||||
const Icon = encrypted ? LockIcon : LockOffIcon;
|
||||
const label = encrypted ? t("common.encrypted") : t("common.unencrypted");
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
label={encrypted ? t("common.encrypted") : t("common.unencrypted")}
|
||||
side="right"
|
||||
>
|
||||
<Tooltip label={label} side="right">
|
||||
<Icon
|
||||
width={16}
|
||||
height={16}
|
||||
className={styles.lock}
|
||||
data-encrypted={encrypted}
|
||||
aria-label={label}
|
||||
// Make the icon focusable so that the tooltip can be opened
|
||||
// with keyboard navigation
|
||||
// TODO: Replace this with the solution from
|
||||
// https://github.com/vector-im/compound-web/pull/130 once it
|
||||
// lands
|
||||
tabIndex={0}
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user