Skip to content

Commit

Permalink
feat(toast crypto): add KeyIcon to key storage out of sync toast
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Feb 5, 2025
1 parent 4a381c2 commit be196a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/toasts/SetupEncryptionToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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.
*/

import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key";
import React, { type ComponentType } from "react";

Check failure on line 10 in src/toasts/SetupEncryptionToast.ts

View workflow job for this annotation

GitHub Actions / ESLint

All imports in the declaration are only used as types. Use `import type`

import Modal from "../Modal";
import { _t } from "../languageHandler";
import DeviceListener from "../DeviceListener";
Expand Down Expand Up @@ -61,6 +64,15 @@ const getSetupCaption = (kind: Kind): string => {
}
};

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 => {
switch (kind) {
case Kind.SET_UP_RECOVERY:
Expand Down Expand Up @@ -162,6 +174,7 @@ export const showToast = (kind: Kind): void => {
props: {
description: getDescription(kind),
primaryLabel: getSetupCaption(kind),
PrimaryIcon: getPrimaryButtonIcon(kind),
onPrimaryClick,
secondaryLabel: getSecondaryButtonLabel(kind),
onSecondaryClick,
Expand Down

0 comments on commit be196a8

Please sign in to comment.