Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 36ef9ec

Browse files
committed
Update styling of the Analytics toast to try and decrease number of users blindly pressing No
1 parent a7e6d8e commit 36ef9ec

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
@import "./views/settings/tabs/user/_SecurityUserSettingsTab.scss";
226226
@import "./views/settings/tabs/user/_VoiceUserSettingsTab.scss";
227227
@import "./views/terms/_InlineTermsAgreement.scss";
228+
@import "./views/toasts/_AnalyticsToast.scss";
228229
@import "./views/toasts/_NonUrgentEchoFailureToast.scss";
229230
@import "./views/verification/_VerificationShowSas.scss";
230231
@import "./views/voip/_CallContainer.scss";

src/components/structures/ToastContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ export default class ToastContainer extends React.Component<{}, IState> {
5555
let toast;
5656
if (totalCount !== 0) {
5757
const topToast = this.state.toasts[0];
58-
const {title, icon, key, component, props} = topToast;
58+
const {title, icon, key, component, className, props} = topToast;
5959
const toastClasses = classNames("mx_Toast_toast", {
6060
"mx_Toast_hasIcon": icon,
6161
[`mx_Toast_icon_${icon}`]: icon,
62-
});
62+
}, className);
6363

6464
let countIndicator;
6565
if (isStacked || this.state.countSeen > 0) {

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
"Unknown App": "Unknown App",
398398
"Help us improve %(brand)s": "Help us improve %(brand)s",
399399
"Send <UsageDataLink>anonymous usage data</UsageDataLink> which helps us improve %(brand)s. This will use a <PolicyLink>cookie</PolicyLink>.": "Send <UsageDataLink>anonymous usage data</UsageDataLink> which helps us improve %(brand)s. This will use a <PolicyLink>cookie</PolicyLink>.",
400-
"I want to help": "I want to help",
400+
"Yes": "Yes",
401401
"No": "No",
402402
"Review where you’re logged in": "Review where you’re logged in",
403403
"Verify all your sessions to ensure your account & messages are safe": "Verify all your sessions to ensure your account & messages are safe",
@@ -1355,7 +1355,6 @@
13551355
"Verify by emoji": "Verify by emoji",
13561356
"Almost there! Is your other session showing the same shield?": "Almost there! Is your other session showing the same shield?",
13571357
"Almost there! Is %(displayName)s showing the same shield?": "Almost there! Is %(displayName)s showing the same shield?",
1358-
"Yes": "Yes",
13591358
"Verify all users in a room to ensure it's secure.": "Verify all users in a room to ensure it's secure.",
13601359
"In encrypted rooms, verify all users to ensure it’s secure.": "In encrypted rooms, verify all users to ensure it’s secure.",
13611360
"You've successfully verified your device!": "You've successfully verified your device!",

src/stores/ToastStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface IToast<C extends ComponentClass> {
2525
title: string;
2626
icon?: string;
2727
component: C;
28+
className?: string;
2829
props?: Omit<React.ComponentProps<C>, "toastKey">; // toastKey is injected by ToastContainer
2930
}
3031

src/toasts/AnalyticsToast.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ export const showToast = (policyUrl?: string) => {
6464
) : sub,
6565
},
6666
),
67-
acceptLabel: _t("I want to help"),
67+
acceptLabel: _t("Yes"),
6868
onAccept,
6969
rejectLabel: _t("No"),
7070
onReject,
7171
},
7272
component: GenericToast,
73+
className: "mx_AnalyticsToast",
7374
priority: 10,
7475
});
7576
};

0 commit comments

Comments
 (0)