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

Commit e05fcc8

Browse files
authored
Merge pull request #5408 from matrix-org/t3chguy/fix/15400
Update styling of the Analytics toast
2 parents 8eadf6b + 5dd0766 commit e05fcc8

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
@import "./views/settings/tabs/user/_SecurityUserSettingsTab.scss";
228228
@import "./views/settings/tabs/user/_VoiceUserSettingsTab.scss";
229229
@import "./views/terms/_InlineTermsAgreement.scss";
230+
@import "./views/toasts/_AnalyticsToast.scss";
230231
@import "./views/toasts/_NonUrgentEchoFailureToast.scss";
231232
@import "./views/verification/_VerificationShowSas.scss";
232233
@import "./views/voip/_CallContainer.scss";
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright 2020 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_AnalyticsToast {
18+
.mx_AccessibleButton_kind_danger {
19+
background: none;
20+
color: $accent-color;
21+
}
22+
23+
.mx_AccessibleButton_kind_primary {
24+
background: $accent-color;
25+
color: #ffffff;
26+
}
27+
}

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
@@ -648,7 +648,7 @@
648648
"Unknown App": "Unknown App",
649649
"Help us improve %(brand)s": "Help us improve %(brand)s",
650650
"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>.",
651-
"I want to help": "I want to help",
651+
"Yes": "Yes",
652652
"No": "No",
653653
"Review where you’re logged in": "Review where you’re logged in",
654654
"Verify all your sessions to ensure your account & messages are safe": "Verify all your sessions to ensure your account & messages are safe",
@@ -1615,7 +1615,6 @@
16151615
"Verify by emoji": "Verify by emoji",
16161616
"Almost there! Is your other session showing the same shield?": "Almost there! Is your other session showing the same shield?",
16171617
"Almost there! Is %(displayName)s showing the same shield?": "Almost there! Is %(displayName)s showing the same shield?",
1618-
"Yes": "Yes",
16191618
"Verify all users in a room to ensure it's secure.": "Verify all users in a room to ensure it's secure.",
16201619
"In encrypted rooms, verify all users to ensure it’s secure.": "In encrypted rooms, verify all users to ensure it’s secure.",
16211620
"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)