Skip to content

Commit

Permalink
Merge pull request #28 from Financial-Times/CI-1158-alphaville-articl…
Browse files Browse the repository at this point in the history
…e-page-branding

Ci 1158 alphaville article page branding
  • Loading branch information
juanSanchezAlcala authored Sep 1, 2022
2 parents f440c2e + e7656ee commit 599f1a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 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
]
}
};
27 changes: 19 additions & 8 deletions src/lib/get-topper-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,30 @@ 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 if (isAlphaville) {
myFtButtonVariant = 'monochrome';
backgroundColour = 'matisse';
} else {
backgroundColour = 'wheat';
}
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 599f1a2

Please sign in to comment.