Skip to content

Commit

Permalink
Refactor: remove unusued showSlash prop
Browse files Browse the repository at this point in the history
  • Loading branch information
abeddow91 committed Jan 30, 2023
1 parent 653516b commit 6e97cff
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 96 deletions.
20 changes: 0 additions & 20 deletions dotcom-rendering/src/web/components/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,26 +433,6 @@ export const WithQuotesSpecialReportAlt = () => {
);
};

export const WithNoSlash = () => {
return (
<CardWrapper>
<Card {...basicCardProps} showSlash={false} kickerText="No slash" />
</CardWrapper>
);
};

export const WithNoLinebreak = () => {
return (
<CardWrapper>
<Card
{...basicCardProps}
hideLineBreak={true}
kickerText="No linebreak"
/>
</CardWrapper>
);
};

export const WithAnAvatar = () => {
return (
<>
Expand Down
11 changes: 0 additions & 11 deletions dotcom-rendering/src/web/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export type Props = {
showMainVideo?: boolean;
kickerText?: string;
showPulsingDot?: boolean;
/** Sometimes kickers and headlines are separated by a slash */
showSlash?: boolean;
/** Sometimes kickers and headlines are separated by a linebreak */
hideLineBreak?: boolean;
starRating?: number;
minWidthInPixels?: number;
/** Used for Ophan tracking */
Expand Down Expand Up @@ -233,8 +229,6 @@ export const Card = ({
showMainVideo,
kickerText,
showPulsingDot,
showSlash,
hideLineBreak,
starRating,
minWidthInPixels,
dataLinkName,
Expand Down Expand Up @@ -414,11 +408,6 @@ export const Card = ({
format.design === ArticleDesign.LiveBlog ||
showPulsingDot
}
showSlash={
format.design === ArticleDesign.LiveBlog ||
showSlash
}
hideLineBreak={hideLineBreak}
byline={byline}
showByline={showByline}
isDynamo={isDynamo}
Expand Down
23 changes: 2 additions & 21 deletions dotcom-rendering/src/web/components/CardHeadline.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,7 @@ export const liveStory = () => (
);
liveStory.story = { name: 'With Live kicker' };

export const noSlash = () => (
<Section fullWidth={true} showTopBorder={false} showSideBorders={false}>
<CardHeadline
headlineText="This is how a card headline with no kicker slash looks"
format={{
display: ArticleDisplay.Standard,
design: ArticleDesign.Standard,
theme: ArticlePillar.News,
}}
kickerText="Live"
showSlash={false}
/>
</Section>
);
noSlash.story = { name: 'With Live kicker but no slash' };

export const noLinebreak = () => (
export const noLineBreak = () => (
<Section fullWidth={true} showTopBorder={false} showSideBorders={false}>
<CardHeadline
headlineText="This is how a card headline with no kicker linebreak looks"
Expand All @@ -241,7 +225,7 @@ export const noLinebreak = () => (
/>
</Section>
);
noSlash.story = { name: 'With Live kicker but no slash' };
noLineBreak.story = { name: 'With Live kicker but no line break' };

export const pulsingDot = () => (
<Section fullWidth={true} showTopBorder={false} showSideBorders={false}>
Expand Down Expand Up @@ -308,7 +292,6 @@ export const OpinionKicker = () => (
}}
showQuotes={true}
kickerText="George Monbiot"
showSlash={true}
size={size}
/>
</Section>
Expand All @@ -335,7 +318,6 @@ export const SpecialReport = () => (
}}
showQuotes={true}
kickerText="Special Report"
showSlash={true}
/>
</Section>
);
Expand All @@ -352,7 +334,6 @@ export const Busy = () => (
}}
showQuotes={true}
kickerText="Aerial Yoga"
showSlash={true}
/>
</Section>
);
Expand Down
3 changes: 0 additions & 3 deletions dotcom-rendering/src/web/components/CardHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type Props = {
containerPalette?: DCRContainerPalette;
kickerText?: string;
showPulsingDot?: boolean;
showSlash?: boolean;
hideLineBreak?: boolean;
showQuotes?: boolean; // Even with design !== Comment, a piece can be opinion
size?: SmallHeadlineSize;
Expand Down Expand Up @@ -233,7 +232,6 @@ export const CardHeadline = ({
showQuotes,
kickerText,
showPulsingDot,
showSlash,
hideLineBreak,
size = 'medium',
sizeOnMobile,
Expand Down Expand Up @@ -274,7 +272,6 @@ export const CardHeadline = ({
text={kickerText}
color={kickerColour}
showPulsingDot={showPulsingDot}
showSlash={showSlash}
hideLineBreak={hideLineBreak}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/src/web/components/FrontCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const FrontCard = (props: Props) => {
webPublicationDate: trail.webPublicationDate,
kickerText: trail.kickerText,
showPulsingDot: trail.format.design === ArticleDesign.LiveBlog,
showSlash: true,
showClock: false,
imageUrl: trail.image,
isCrossword: trail.isCrossword,
Expand Down
3 changes: 0 additions & 3 deletions dotcom-rendering/src/web/components/Kicker.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { css } from '@emotion/react';
import { useEffect, useState } from 'react';
import { PulsingDot } from './PulsingDot.importable';

// Defines a prefix to be used with a headline (e.g. 'Live /')
type Props = {
text: string;
color: string;
showPulsingDot?: boolean;
showSlash?: boolean;
hideLineBreak?: boolean;
};

Expand All @@ -22,7 +20,6 @@ export const Kicker = ({
text,
color,
showPulsingDot,
showSlash = true,
hideLineBreak,
}: Props) => {
return (
Expand Down
32 changes: 1 addition & 31 deletions dotcom-rendering/src/web/components/LinkHeadline.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,10 @@ export const liveStory = () => (
);
liveStory.story = { name: 'With Live kicker' };

// TODO remove after test
export const noSlash = () => (
<Section fullWidth={true} showTopBorder={false} showSideBorders={false}>
<LinkHeadline
headlineText="This is how a headline with no kicker slash looks"
format={{
display: ArticleDisplay.Standard,
design: ArticleDesign.Standard,
theme: ArticlePillar.News,
}}
kickerText="Live"
showSlash={false}
/>
</Section>
);
noSlash.story = { name: 'With Live kicker but no slash' };

export const noLinebreak = () => (
<Section fullWidth={true} showTopBorder={false} showSideBorders={false}>
<LinkHeadline
headlineText="This is how a headline with no line break looks"
headlineText="This is how a headline with no kicker line break looks"
format={{
display: ArticleDisplay.Standard,
design: ArticleDesign.Standard,
Expand Down Expand Up @@ -134,7 +117,6 @@ export const OpinionKicker = () => (
}}
showQuotes={true}
kickerText="George Monbiot"
showSlash={true}
/>
</Section>
);
Expand All @@ -151,7 +133,6 @@ export const SpecialReport = () => (
}}
showQuotes={true}
kickerText="Special Report"
showSlash={true}
/>
</Section>
);
Expand All @@ -169,7 +150,6 @@ export const InUnderlinedState = () => (
showUnderline={true}
size="small"
kickerText="I am never underlined"
showSlash={true}
link={{
to: 'https://www.theguardian.com/us-news/2019/nov/14/nancy-pelosi-trump-ukraine-bribery',
}}
Expand All @@ -188,7 +168,6 @@ export const linkStory = () => (
theme: ArticlePillar.Sport,
}}
kickerText="I am not a link"
showSlash={true}
link={{
to: 'https://www.theguardian.com/us-news/2019/nov/14/nancy-pelosi-trump-ukraine-bribery',
}}
Expand All @@ -208,7 +187,6 @@ export const LiveBlogSizes = () => (
}}
showQuotes={true}
kickerText="Large live"
showSlash={true}
showPulsingDot={true}
size="large"
/>
Expand All @@ -222,7 +200,6 @@ export const LiveBlogSizes = () => (
}}
showQuotes={true}
kickerText="Medium live"
showSlash={true}
showPulsingDot={true}
size="medium"
/>
Expand All @@ -236,7 +213,6 @@ export const LiveBlogSizes = () => (
}}
showQuotes={true}
kickerText="Small live"
showSlash={true}
showPulsingDot={true}
size="small"
/>
Expand All @@ -250,7 +226,6 @@ export const LiveBlogSizes = () => (
}}
showQuotes={true}
kickerText="Tiny live"
showSlash={true}
showPulsingDot={true}
size="tiny"
/>
Expand All @@ -269,7 +244,6 @@ export const DeadBlogSizes = () => (
}}
showQuotes={true}
kickerText="Large dead"
showSlash={true}
showPulsingDot={false}
size="large"
/>
Expand All @@ -283,7 +257,6 @@ export const DeadBlogSizes = () => (
}}
showQuotes={true}
kickerText="Medium dead"
showSlash={true}
showPulsingDot={false}
size="medium"
/>
Expand All @@ -297,7 +270,6 @@ export const DeadBlogSizes = () => (
}}
showQuotes={true}
kickerText="Small dead"
showSlash={true}
showPulsingDot={false}
size="small"
/>
Expand All @@ -311,7 +283,6 @@ export const DeadBlogSizes = () => (
}}
showQuotes={true}
kickerText="Tiny dead"
showSlash={true}
showPulsingDot={false}
size="tiny"
/>
Expand All @@ -329,7 +300,6 @@ export const Updated = () => (
theme: ArticlePillar.News,
}}
showPulsingDot={true}
showSlash={false}
hideLineBreak={true}
kickerText="Updated 7m ago"
size="tiny"
Expand Down
3 changes: 0 additions & 3 deletions dotcom-rendering/src/web/components/LinkHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Props = {
showUnderline?: boolean; // Some headlines have text-decoration underlined when hovered
kickerText?: string;
showPulsingDot?: boolean;
showSlash?: boolean;
hideLineBreak?: boolean;
showQuotes?: boolean; // When true the QuoteIcon is shown
size?: SmallHeadlineSize;
Expand Down Expand Up @@ -71,7 +70,6 @@ export const LinkHeadline = ({
showUnderline = false,
kickerText,
showPulsingDot,
showSlash,
hideLineBreak,
showQuotes = false,
size = 'medium',
Expand All @@ -87,7 +85,6 @@ export const LinkHeadline = ({
text={kickerText}
color={palette.text.linkKicker}
showPulsingDot={showPulsingDot}
showSlash={showSlash}
hideLineBreak={hideLineBreak}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const MostViewedFooterItem = ({
format={format}
size="small"
kickerText="Live"
showSlash={true}
hideLineBreak={false}
showPulsingDot={true}
showQuotes={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const MostViewedRightItem = ({ trail, mostViewedItemIndex }: Props) => {
size="small"
showUnderline={isHovered}
kickerText="Live"
showSlash={false}
hideLineBreak={true}
byline={
trail.showByline ? trail.byline : undefined
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/src/web/components/SupportingContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ export const SupportingContent = ({
<CardHeadline
format={subLink.format}
size="tiny"
showSlash={false}
hideLineBreak={true}
showLine={true}
linkTo={subLink.url}
Expand Down

0 comments on commit 6e97cff

Please sign in to comment.