Skip to content

Commit

Permalink
set myFtButton variant for alphaville branding
Browse files Browse the repository at this point in the history
  • Loading branch information
juanSanchezAlcala committed Aug 31, 2022
1 parent 159a469 commit e7656ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
3 changes: 2 additions & 1 deletion secret-squirrel.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = {
strings: {
deny: [],
denyOverrides: [
'6da31a37\\x2d691f\\x2d4908\\x2d896f\\x2d2829ebe2309e' // src/lib/get-topper-settings.js:31, test/lib/get-topper-settings.test.js:174|192
'6da31a37\\x2d691f\\x2d4908\\x2d896f\\x2d2829ebe2309e', // src/lib/get-topper-settings.js:31, test/lib/get-topper-settings.test.js:168|186
'89d15f70\\x2d640d\\x2d11e4\\x2d9803\\x2d0800200c9a66' // src/lib/get-topper-settings.js:156
]
}
};
29 changes: 20 additions & 9 deletions src/lib/get-topper-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,32 @@ const useBrandedTopper = (content, flags) => {
const fthead = headshotConcepts[0] ? headshotConcepts[0].value : '';
const modifiers = fthead ? ['branded', 'has-headshot'] : ['branded'];
const opinionGenreConceptId = '6da31a37-691f-4908-896f-2829ebe2309e';

const alphavilleConceptId = '89d15f70-640d-11e4-9803-0800200c9a66';
let backgroundColour;
let headshotTint;
let isOpinion = false;

if (
content.genreConcept &&
content.genreConcept.id === opinionGenreConceptId
) {
let isOpinion =
content.genreConcept && content.genreConcept.id === opinionGenreConceptId
? true
: false;
let isAlphaville =
content.brandConcept && content.brandConcept.id === alphavilleConceptId
? true
: false;
let myFtButtonVariant = 'standard';

if (isOpinion) {
backgroundColour =
content.containedIn && content.containedIn.length ? 'wheat' : 'sky';

myFtButtonVariant = backgroundColour === 'sky' ? 'opinion' : 'standard';
modifiers.push('opinion');
headshotTint = '054593,d6d5d3';
isOpinion = true;
} else {
} else if (isAlphaville) {
myFtButtonVariant = 'monochrome';
backgroundColour = 'matisse';
} else {
backgroundColour = 'wheat';
}

if (content.topper && content.topper.backgroundColour) {
Expand All @@ -181,10 +191,11 @@ const useBrandedTopper = (content, flags) => {
includesTeaser: true,
modifiers,
isOpinion,
isAlphaville,
headshotTint,
fthead,
myFtButton: {
variant: backgroundColour === 'sky' ? 'opinion' : 'standard',
variant: myFtButtonVariant,
followPlusDigestEmail: followPlusDigestEmail(flags)
}
};
Expand Down

0 comments on commit e7656ee

Please sign in to comment.