Skip to content

Commit

Permalink
Merge pull request #11485 from guardian/dina/set-live-logo-styling-be…
Browse files Browse the repository at this point in the history
…hind-a-switch

Set live updated logo styling for Advertising Partner
  • Loading branch information
deedeeh authored May 30, 2024
2 parents 8141d77 + 9e80f8c commit c4e4c52
Show file tree
Hide file tree
Showing 30 changed files with 104 additions and 112 deletions.
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/ArticleMeta.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ArticleMeta', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('ArticleMeta', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
6 changes: 3 additions & 3 deletions dotcom-rendering/src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Props = {
ophanComponentName?: string;
isInLabsSection?: boolean;
isAdvertisingPartner?: boolean;
inAdvertisingPartnerABTest?: boolean;
updateLogoAdPartnerSwitch?: boolean;
};

export const Badge = ({
Expand All @@ -57,7 +57,7 @@ export const Badge = ({
ophanComponentName,
isInLabsSection = false,
isAdvertisingPartner = false,
inAdvertisingPartnerABTest = false,
updateLogoAdPartnerSwitch = false,
}: Props) => {
return (
<a
Expand All @@ -73,7 +73,7 @@ export const Badge = ({
? labsSectionBadgeSizingStyles
: frontsSectionBadgeSizingStyles,
isAdvertisingPartner &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
imageAdvertisingPartnerStyles,
]}
src={imageSrc}
Expand Down
12 changes: 6 additions & 6 deletions dotcom-rendering/src/components/Branding.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const Branding = ({ branding, format }: Props) => {
locationPrefix: 'article-meta',
});

const { darkModeAvailable, inAdvertisingPartnerABTest } = useConfig();
const { darkModeAvailable, updateLogoAdPartnerSwitch } = useConfig();

const isAdvertisingPartnerOrExclusive =
branding.logo.label.toLowerCase() === 'advertising partner' ||
Expand All @@ -223,18 +223,18 @@ export const Branding = ({ branding, format }: Props) => {
css={[
brandingStyle,
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
brandingAdvertisingPartnerStyle,
isAdvertisingPartnerAndInteractive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
brandingInteractiveStyle,
]}
>
<div
css={[
labelStyle,
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
labelAdvertisingPartnerStyle,
isLiveBlog && liveBlogLabelStyle,
]}
Expand All @@ -245,8 +245,8 @@ export const Branding = ({ branding, format }: Props) => {
css={[
brandingLogoStyle,
isAdvertisingPartnerOrExclusive &&
updateLogoAdPartnerSwitch &&
!isInteractive &&
inAdvertisingPartnerABTest &&
brandingLogoAdvertisingPartnerStyle,
]}
>
Expand All @@ -269,7 +269,7 @@ export const Branding = ({ branding, format }: Props) => {
css={[
aboutLinkStyle,
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
aboutLinkAdvertisingPartnerStyle,
isLiveBlog && liveBlogAboutLinkStyle,
]}
Expand Down
10 changes: 5 additions & 5 deletions dotcom-rendering/src/components/BylineLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('BylineLink', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('BylineLink', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('BylineLink', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -237,7 +237,7 @@ describe('BylineLink', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -269,7 +269,7 @@ describe('BylineLink', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
6 changes: 3 additions & 3 deletions dotcom-rendering/src/components/ConfigContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ describe('ConfigContext', () => {
{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
},
{
renderingTarget: 'Apps',
darkModeAvailable: true,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
},
{
renderingTarget: 'Apps',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
},
] as const satisfies ReadonlyArray<Config>)(
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/Contributor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Contributor', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('Contributor', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('App', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
12 changes: 6 additions & 6 deletions dotcom-rendering/src/components/Dropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -67,7 +67,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -92,7 +92,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -116,7 +116,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -142,7 +142,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -169,7 +169,7 @@ describe('Dropdown', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
6 changes: 3 additions & 3 deletions dotcom-rendering/src/components/FrontSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type Props = {
discussionApiUrl: string;
collectionBranding?: CollectionBranding;
isTagPage?: boolean;
inAdvertisingPartnerABTest?: boolean;
updateLogoAdPartnerSwitch?: boolean;
};

const width = (columns: number, columnWidth: number, columnGap: number) =>
Expand Down Expand Up @@ -463,7 +463,7 @@ export const FrontSection = ({
discussionApiUrl,
collectionBranding,
isTagPage = false,
inAdvertisingPartnerABTest = false,
updateLogoAdPartnerSwitch = false,
}: Props) => {
const overrides =
containerPalette && decideContainerOverrides(containerPalette);
Expand Down Expand Up @@ -541,7 +541,7 @@ export const FrontSection = ({
/>
}
collectionBranding={collectionBranding}
inAdvertisingPartnerABTest={inAdvertisingPartnerABTest}
updateLogoAdPartnerSwitch={updateLogoAdPartnerSwitch}
/>

{leftContent}
Expand Down
16 changes: 8 additions & 8 deletions dotcom-rendering/src/components/FrontSectionTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Badge } from './Badge';
type Props = {
title: React.ReactNode;
collectionBranding: CollectionBranding | undefined;
inAdvertisingPartnerABTest: boolean;
updateLogoAdPartnerSwitch: boolean;
};

const titleStyle = css`
Expand Down Expand Up @@ -81,7 +81,7 @@ const aboutThisLinkAdvertisingPartnerStyles = css`
export const FrontSectionTitle = ({
title,
collectionBranding,
inAdvertisingPartnerABTest,
updateLogoAdPartnerSwitch,
}: Props) => {
switch (collectionBranding?.kind) {
case 'foundation': {
Expand Down Expand Up @@ -168,21 +168,21 @@ export const FrontSectionTitle = ({
<div css={titleStyle}>
{title}
{isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest ? (
updateLogoAdPartnerSwitch ? (
<hr css={advertisingPartnerDottedBorder} />
) : null}
<div
css={
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
brandingAdvertisingPartnerStyle
}
>
<p
css={[
labelStyles,
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
labelAdvertisingPartnerStyles,
]}
>
Expand All @@ -194,16 +194,16 @@ export const FrontSectionTitle = ({
isAdvertisingPartner={
isAdvertisingPartnerOrExclusive
}
inAdvertisingPartnerABTest={
inAdvertisingPartnerABTest
updateLogoAdPartnerSwitch={
updateLogoAdPartnerSwitch
}
/>
<a
href={aboutThisLink}
css={[
aboutThisLinkStyles,
isAdvertisingPartnerOrExclusive &&
inAdvertisingPartnerABTest &&
updateLogoAdPartnerSwitch &&
aboutThisLinkAdvertisingPartnerStyles,
]}
>
Expand Down
6 changes: 3 additions & 3 deletions dotcom-rendering/src/components/GuideAtom/GuideAtom.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('GuideAtom', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -37,7 +37,7 @@ describe('GuideAtom', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand All @@ -64,7 +64,7 @@ describe('GuideAtom', () => {
value={{
renderingTarget: 'Web',
darkModeAvailable: false,
inAdvertisingPartnerABTest: false,
updateLogoAdPartnerSwitch: false,
assetOrigin: '/',
}}
>
Expand Down
Loading

0 comments on commit c4e4c52

Please sign in to comment.