mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-29 06:21:20 +01:00
Add KeyIcon to key storage out of sync toast (#29201)
* feat(toast crypto): add KeyIcon to key storage out of sync toast * test(toast crypto): update key storage out of sync snapshot
This commit is contained in:
parent
4a381c2a10
commit
0358b7f93c
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
@ -6,6 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
|
|||||||
Please see LICENSE files in the repository root for full details.
|
Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key";
|
||||||
|
import { type ComponentType } from "react";
|
||||||
|
|
||||||
|
import type React from "react";
|
||||||
import Modal from "../Modal";
|
import Modal from "../Modal";
|
||||||
import { _t } from "../languageHandler";
|
import { _t } from "../languageHandler";
|
||||||
import DeviceListener from "../DeviceListener";
|
import DeviceListener from "../DeviceListener";
|
||||||
@ -61,6 +65,19 @@ const getSetupCaption = (kind: Kind): string => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the icon to show on the primary button.
|
||||||
|
* @param kind
|
||||||
|
*/
|
||||||
|
const getPrimaryButtonIcon = (kind: Kind): ComponentType<React.SVGAttributes<SVGElement>> | undefined => {
|
||||||
|
switch (kind) {
|
||||||
|
case Kind.KEY_STORAGE_OUT_OF_SYNC:
|
||||||
|
return KeyIcon;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const getSecondaryButtonLabel = (kind: Kind): string => {
|
const getSecondaryButtonLabel = (kind: Kind): string => {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case Kind.SET_UP_RECOVERY:
|
case Kind.SET_UP_RECOVERY:
|
||||||
@ -162,6 +179,7 @@ export const showToast = (kind: Kind): void => {
|
|||||||
props: {
|
props: {
|
||||||
description: getDescription(kind),
|
description: getDescription(kind),
|
||||||
primaryLabel: getSetupCaption(kind),
|
primaryLabel: getSetupCaption(kind),
|
||||||
|
PrimaryIcon: getPrimaryButtonIcon(kind),
|
||||||
onPrimaryClick,
|
onPrimaryClick,
|
||||||
secondaryLabel: getSecondaryButtonLabel(kind),
|
secondaryLabel: getSecondaryButtonLabel(kind),
|
||||||
onSecondaryClick,
|
onSecondaryClick,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user