Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Storybook to the updated logo styling for "Advertising partner" #11603

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions dotcom-rendering/src/components/ArticleMeta.apps.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,31 @@ const branding: BrandingType = {
'https://www.theguardian.com/environment/2023/jan/06/about-animals-farmed-investigating-modern-farming-around-the-world',
};

const brandingForAdvertisingPartner: BrandingType = {
brandingType: { name: 'sponsored' },
sponsorName: 'theguardian.org',
logo: {
src: 'https://static.theguardian.com/commercial/sponsor/19/Dec/2022/57ba1d00-b2bd-4f6d-ba35-15a82b8d9507-0094b90a-bdb8-4e97-b866-dcf49179b29d-theguardian.org.png',
dimensions: {
width: 280,
height: 180,
},
link: 'https://theguardian.org/',
label: 'Advertising partner',
},
logoForDarkBackground: {
src: 'https://static.theguardian.com/commercial/sponsor/19/Dec/2022/58a1e08d-cd4a-47a5-966a-4846b0461642-46629471-cb0b-4c59-9a06-1ef23778b41f-theguardian.org2.png',
dimensions: {
width: 280,
height: 180,
},
link: 'https://theguardian.org/',
label: 'Advertising partner',
},
aboutThisLink:
'https://www.theguardian.com/environment/2023/jan/06/about-animals-farmed-investigating-modern-farming-around-the-world',
};

export default {
component: ArticleMetaApps,
title: 'Components/ArticleMetaApps',
Expand Down Expand Up @@ -329,3 +354,35 @@ ArticleAppsWithBrandingStory.parameters = {
config: { renderingTarget: 'Apps' },
};
ArticleAppsWithBrandingStory.decorators = [splitTheme([defaultFormat])];

export const ArticleAppsWithBrandingStoryForAdvertisingPartner: StoryObj = ({
format,
isCommentable = true,
}: StoryArgs) => {
return (
<Wrapper>
<ArticleMetaApps
format={format}
pageId=""
byline="Lanre Bakare Chief music writer"
tags={tagsWithLargeBylineImage}
primaryDateline="Sun 12 Jan 2020 18.00 GMT"
secondaryDateline="Last modified on Sun 12 Jan 2020 21.00 GMT"
isCommentable={isCommentable}
discussionApiUrl="https://discussion.theguardian.com/discussion-api"
shortUrlId="/p/zemg8"
branding={brandingForAdvertisingPartner}
/>
</Wrapper>
);
};
/** @see /dotcom-rendering/docs/development/storybook.md */
ArticleAppsWithBrandingStoryForAdvertisingPartner.args = {
format: defaultFormat,
};
ArticleAppsWithBrandingStoryForAdvertisingPartner.parameters = {
config: { renderingTarget: 'Apps', updateLogoAdPartnerSwitch: true },
};
ArticleAppsWithBrandingStoryForAdvertisingPartner.decorators = [
splitTheme([defaultFormat]),
];
54 changes: 54 additions & 0 deletions dotcom-rendering/src/components/ArticleMeta.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,31 @@ const branding: BrandingType = {
'https://www.theguardian.com/environment/2023/jan/06/about-animals-farmed-investigating-modern-farming-around-the-world',
};

const brandingForAdvertisingPartner: BrandingType = {
brandingType: { name: 'sponsored' },
sponsorName: 'theguardian.org',
logo: {
src: 'https://static.theguardian.com/commercial/sponsor/19/Dec/2022/57ba1d00-b2bd-4f6d-ba35-15a82b8d9507-0094b90a-bdb8-4e97-b866-dcf49179b29d-theguardian.org.png',
dimensions: {
width: 280,
height: 180,
},
link: 'https://theguardian.org/',
label: 'Advertising partner',
},
logoForDarkBackground: {
src: 'https://static.theguardian.com/commercial/sponsor/19/Dec/2022/58a1e08d-cd4a-47a5-966a-4846b0461642-46629471-cb0b-4c59-9a06-1ef23778b41f-theguardian.org2.png',
dimensions: {
width: 280,
height: 180,
},
link: 'https://theguardian.org/',
label: 'Advertising partner',
},
aboutThisLink:
'https://www.theguardian.com/environment/2023/jan/06/about-animals-farmed-investigating-modern-farming-around-the-world',
};

export const Branding: StoryObj = ({ format }: StoryArgs) => {
return (
<Wrapper>
Expand All @@ -143,6 +168,35 @@ Branding.args = { format: defaultFormat };
Branding.parameters = { config: { darkModeAvailable: true } };
Branding.decorators = [browserThemeDecorator(defaultFormat)];

export const BrandingForAdvertisingPartner: StoryObj = ({
format,
}: StoryArgs) => {
return (
<Wrapper>
<ArticleMeta
branding={brandingForAdvertisingPartner}
format={format}
pageId=""
webTitle=""
byline="Lanre Bakare"
tags={tagsWithLargeBylineImage}
primaryDateline="Sun 12 Jan 2020 18.00 GMT"
secondaryDateline="Last modified on Sun 12 Jan 2020 21.00 GMT"
isCommentable={false}
discussionApiUrl=""
shortUrlId=""
/>
</Wrapper>
);
};
BrandingForAdvertisingPartner.args = { format: defaultFormat };
BrandingForAdvertisingPartner.parameters = {
config: { darkModeAvailable: true, updateLogoAdPartnerSwitch: true },
};
BrandingForAdvertisingPartner.decorators = [
browserThemeDecorator(defaultFormat),
];

export const BrandingLiveBlog: StoryObj = ({ format }: StoryArgs) => {
return (
<div
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/Branding.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const brandingLogoAdvertisingPartnerStyle = css`
padding: 0;
& img {
display: block;
max-width: 140px;
${between.leftCol.and.wide} {
max-width: 130px;
}
Expand Down
77 changes: 74 additions & 3 deletions dotcom-rendering/src/components/FrontSection.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const TreatsStory = () => {
TreatsStory.storyName = 'with treats and date header';

/**
* Use the same logo for each of the stories with branding
* Use the same logo for each of the stories with branding except stories for Advertising partner and Exclusive advertising partner labels
*/
const logo = {
src: 'https://static.theguardian.com/commercial/sponsor/28/Oct/2020/daa941da-14fd-46cc-85cb-731ce59050ee-Grounded_badging-280x180.png',
Expand All @@ -277,6 +277,16 @@ const logo = {
label: 'Paid for by',
};

const logoForAdvertisingPartner = {
src: 'https://static.theguardian.com/commercial/sponsor/28/Oct/2020/daa941da-14fd-46cc-85cb-731ce59050ee-Grounded_badging-280x180.png',
dimensions: {
width: 140,
height: 90,
},
link: '/',
label: 'Advertising partner',
};

export const WithSponsoredBranding = () => {
return (
<FrontSection
Expand All @@ -295,7 +305,7 @@ export const WithSponsoredBranding = () => {
aboutThisLink:
'https://www.theguardian.com/global-development/2021/feb/21/about-the-rights-and-freedom-series',
},
isContainerBranding: false,
isContainerBranding: true,
hasMultipleBranding: false,
}}
>
Expand All @@ -305,6 +315,67 @@ export const WithSponsoredBranding = () => {
};
WithSponsoredBranding.storyName = 'with sponsored branding';

export const WithSponsoredBrandingAdvertisingPartner = () => {
return (
<FrontSection
title="Section"
discussionApiUrl={discussionApiUrl}
editionId={'UK'}
collectionBranding={{
kind: 'sponsored',
isFrontBranding: true,
branding: {
brandingType: {
name: 'sponsored',
},
sponsorName: 'guardian.org',
logo: logoForAdvertisingPartner,
aboutThisLink:
'https://www.theguardian.com/global-development/2021/feb/21/about-the-rights-and-freedom-series',
},
isContainerBranding: false,
hasMultipleBranding: false,
}}
updateLogoAdPartnerSwitch={true}
>
<Placeholder />
</FrontSection>
);
};
WithSponsoredBrandingAdvertisingPartner.storyName =
'with sponsored branding for Advertising partner';

export const WithSponsoredBrandingAdvertisingPartnerTagPages = () => {
return (
<FrontSection
title="Section"
isTagPage={true}
discussionApiUrl={discussionApiUrl}
editionId={'UK'}
collectionBranding={{
kind: 'sponsored',
isFrontBranding: true,
branding: {
brandingType: {
name: 'sponsored',
},
sponsorName: 'guardian.org',
logo: logoForAdvertisingPartner,
aboutThisLink:
'https://www.theguardian.com/global-development/2021/feb/21/about-the-rights-and-freedom-series',
},
isContainerBranding: false,
hasMultipleBranding: false,
}}
updateLogoAdPartnerSwitch={true}
>
<Placeholder />
</FrontSection>
);
};
WithSponsoredBrandingAdvertisingPartnerTagPages.storyName =
'with sponsored branding for Advertising partner TagPages';

export const WithPaidBranding = () => {
return (
<FrontSection
Expand All @@ -323,7 +394,7 @@ export const WithPaidBranding = () => {
aboutThisLink:
'https://www.theguardian.com/global-development/2021/feb/21/about-the-rights-and-freedom-series',
},
isContainerBranding: false,
isContainerBranding: true,
hasMultipleBranding: false,
}}
>
Expand Down
Loading