summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs')
-rw-r--r--browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs19
1 files changed, 17 insertions, 2 deletions
diff --git a/browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs b/browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs
index 257036b9da..ee08462503 100644
--- a/browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs
+++ b/browser/components/newtab/lib/DiscoveryStreamFeed.sys.mjs
@@ -331,7 +331,7 @@ export class DiscoveryStreamFeed {
},
});
},
- error(error) {},
+ error() {},
});
}
}
@@ -606,6 +606,13 @@ export class DiscoveryStreamFeed {
) {
ctaButtonVariant = pocketConfig.ctaButtonVariant;
}
+ let spocMessageVariant = "";
+ if (
+ pocketConfig.spocMessageVariant === "variant-a" ||
+ pocketConfig.spocMessageVariant === "variant-b"
+ ) {
+ spocMessageVariant = pocketConfig.spocMessageVariant;
+ }
const prepConfArr = arr => {
return arr
@@ -681,6 +688,9 @@ export class DiscoveryStreamFeed {
// For now button variants are for experimentation and English only.
ctaButtonSponsors: this.locale.startsWith("en-") ? ctaButtonSponsors : [],
ctaButtonVariant: this.locale.startsWith("en-") ? ctaButtonVariant : "",
+ spocMessageVariant: this.locale.startsWith("en-")
+ ? spocMessageVariant
+ : "",
});
sendUpdate({
@@ -2040,6 +2050,7 @@ export class DiscoveryStreamFeed {
`onboardingExperience` Show new users some UI explaining Pocket above the Pocket section.
`ctaButtonSponsors` An array of sponsors we want to show a cta button on the card for.
`ctaButtonVariant` Sets the variant for the cta sponsor button.
+ `spocMessageVariant` Sets the variant for the sponsor message dialog.
*/
getHardcodedLayout = ({
spocsUrl = SPOCS_URL,
@@ -2063,6 +2074,7 @@ getHardcodedLayout = ({
onboardingExperience = false,
ctaButtonSponsors = [],
ctaButtonVariant = "",
+ spocMessageVariant = "",
}) => ({
lastUpdate: Date.now(),
spocs: {
@@ -2144,7 +2156,9 @@ getHardcodedLayout = ({
link_url: "https://getpocket.com/firefox/new_tab_learn_more",
icon: "chrome://global/skin/icons/pocket.svg",
},
- properties: {},
+ properties: {
+ spocMessageVariant,
+ },
styles: {
".ds-message": "margin-bottom: -20px",
},
@@ -2162,6 +2176,7 @@ getHardcodedLayout = ({
onboardingExperience,
ctaButtonSponsors,
ctaButtonVariant,
+ spocMessageVariant,
},
widgets: {
positions: widgetPositions.map(position => {