Update toast styles to match Figma (#12833)

* Warn users on unsupported browsers before they lack features

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update Learn more link

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update toast styles to match Figma

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove test code

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshots

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-07-30 13:57:15 +01:00
committed by GitHub
parent a1897583b1
commit b0392b8fc3
29 changed files with 156 additions and 114 deletions
+8 -8
View File
@@ -87,10 +87,10 @@ export const showToast = (): void => {
// them to opt in again.
props = {
description: _t("analytics|consent_migration"),
acceptLabel: _t("analytics|accept_button"),
onAccept,
rejectLabel: _t("action|learn_more"),
onReject: onLearnMorePreviouslyOptedIn,
primaryLabel: _t("analytics|accept_button"),
onPrimaryClick: onAccept,
secondaryLabel: _t("action|learn_more"),
onSecondaryClick: onLearnMorePreviouslyOptedIn,
};
} else if (legacyAnalyticsOptIn === null || legacyAnalyticsOptIn === undefined) {
// The user had no analytics setting previously set, so we just need to prompt to opt-in, rather than
@@ -102,10 +102,10 @@ export const showToast = (): void => {
);
props = {
description: _t("analytics|learn_more", {}, { LearnMoreLink: learnMoreLink }),
acceptLabel: _t("action|yes"),
onAccept,
rejectLabel: _t("action|no"),
onReject,
primaryLabel: _t("action|yes"),
onPrimaryClick: onAccept,
secondaryLabel: _t("action|no"),
onSecondaryClick: onReject,
};
} else {
// false
+4 -4
View File
@@ -44,10 +44,10 @@ export const showToast = (deviceIds: Set<string>): void => {
icon: "verification_warning",
props: {
description: _t("encryption|verification|unverified_sessions_toast_description"),
acceptLabel: _t("action|review"),
onAccept,
rejectLabel: _t("encryption|verification|unverified_sessions_toast_reject"),
onReject,
primaryLabel: _t("action|review"),
onPrimaryClick: onAccept,
secondaryLabel: _t("encryption|verification|unverified_sessions_toast_reject"),
onSecondaryClick: onReject,
},
component: GenericToast,
priority: 50,
+4 -4
View File
@@ -44,10 +44,10 @@ export const showToast = (fromMessageSend: boolean): void => {
: _t("notifications|enable_prompt_toast_title"),
props: {
description: _t("notifications|enable_prompt_toast_description"),
acceptLabel: _t("action|enable"),
onAccept,
rejectLabel: _t("action|dismiss"),
onReject,
primaryLabel: _t("action|enable"),
onPrimaryClick: onAccept,
secondaryLabel: _t("action|dismiss"),
onSecondaryClick: onReject,
},
component: GenericToast,
priority: 30,
+4 -4
View File
@@ -45,10 +45,10 @@ export const showToast = (): void => {
title: _t("mobile_guide|toast_title"),
props: {
description: _t("mobile_guide|toast_description", { brand }),
acceptLabel: _t("mobile_guide|toast_accept"),
onAccept,
rejectLabel: _t("action|dismiss"),
onReject,
primaryLabel: _t("mobile_guide|toast_accept"),
onPrimaryClick: onAccept,
secondaryLabel: _t("action|dismiss"),
onSecondaryClick: onReject,
},
component: GenericToast,
priority: 99,
+2 -2
View File
@@ -47,8 +47,8 @@ export const showToast = (
{errorText} {contactText}
</React.Fragment>
),
acceptLabel: _t("action|ok"),
onAccept: () => {
primaryLabel: _t("action|ok"),
onPrimaryClick: () => {
hideToast();
if (onHideToast) onHideToast();
},
+5 -4
View File
@@ -114,10 +114,11 @@ export const showToast = (kind: Kind): void => {
icon: getIcon(kind),
props: {
description: getDescription(kind),
acceptLabel: getSetupCaption(kind),
onAccept,
rejectLabel: _t("encryption|verification|unverified_sessions_toast_reject"),
onReject,
primaryLabel: getSetupCaption(kind),
onPrimaryClick: onAccept,
secondaryLabel: _t("encryption|verification|unverified_sessions_toast_reject"),
onSecondaryClick: onReject,
destructive: "secondary",
},
component: GenericToast,
priority: kind === Kind.VERIFY_THIS_SESSION ? 95 : 40,
+5 -4
View File
@@ -59,10 +59,11 @@ export const showToast = async (deviceId: string): Promise<void> => {
props: {
description: device.display_name,
detail: <DeviceMetaData device={extendedDevice} />,
acceptLabel: _t("encryption|verification|unverified_session_toast_accept"),
onAccept,
rejectLabel: _t("action|no"),
onReject,
primaryLabel: _t("encryption|verification|unverified_session_toast_accept"),
onPrimaryClick: onAccept,
secondaryLabel: _t("action|no"),
onSecondaryClick: onReject,
destructive: "secondary",
},
component: GenericToast,
priority: 80,
+4 -4
View File
@@ -83,10 +83,10 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st
title: _t("update|toast_title", { brand }),
props: {
description: _t("update|toast_description", { brand }),
acceptLabel,
onAccept,
rejectLabel: _t("action|dismiss"),
onReject,
primaryLabel: acceptLabel,
onPrimaryClick: onAccept,
secondaryLabel: _t("action|dismiss"),
onSecondaryClick: onReject,
},
component: GenericToast,
priority: 20,