File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
playwright/snapshots/crypto/toasts.spec.ts Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
6
6
Please see LICENSE files in the repository root for full details.
7
7
*/
8
8
9
+ import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key" ;
10
+ import { type ComponentType } from "react" ;
11
+
12
+ import type React from "react" ;
9
13
import Modal from "../Modal" ;
10
14
import { _t } from "../languageHandler" ;
11
15
import DeviceListener from "../DeviceListener" ;
@@ -61,6 +65,19 @@ const getSetupCaption = (kind: Kind): string => {
61
65
}
62
66
} ;
63
67
68
+ /**
69
+ * Get the icon to show on the primary button.
70
+ * @param kind
71
+ */
72
+ const getPrimaryButtonIcon = ( kind : Kind ) : ComponentType < React . SVGAttributes < SVGElement > > | undefined => {
73
+ switch ( kind ) {
74
+ case Kind . KEY_STORAGE_OUT_OF_SYNC :
75
+ return KeyIcon ;
76
+ default :
77
+ return ;
78
+ }
79
+ } ;
80
+
64
81
const getSecondaryButtonLabel = ( kind : Kind ) : string => {
65
82
switch ( kind ) {
66
83
case Kind . SET_UP_RECOVERY :
@@ -162,6 +179,7 @@ export const showToast = (kind: Kind): void => {
162
179
props : {
163
180
description : getDescription ( kind ) ,
164
181
primaryLabel : getSetupCaption ( kind ) ,
182
+ PrimaryIcon : getPrimaryButtonIcon ( kind ) ,
165
183
onPrimaryClick,
166
184
secondaryLabel : getSecondaryButtonLabel ( kind ) ,
167
185
onSecondaryClick,
You can’t perform that action at this time.
0 commit comments