Skip to content

Commit 29c9c9d

Browse files
committed
clean up the ScrollableSmallOnwards component
1 parent c446f0a commit 29c9c9d

File tree

4 files changed

+187
-208
lines changed

4 files changed

+187
-208
lines changed

dotcom-rendering/src/components/OnwardsUpper.importable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export const OnwardsUpper = ({
310310
format.design === ArticleDesign.Gallery ? isUndefined(url) : true;
311311

312312
return (
313-
<div css={onwardsWrapper}>
313+
<div id="marjan" css={onwardsWrapper}>
314314
{!!url && (
315315
<Section
316316
fullWidth={true}

dotcom-rendering/src/components/ScrollableCarousel.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,34 @@ const itemStyles = css`
104104
position: relative;
105105
`;
106106

107-
const leftBorderStyles = css`
107+
const leftBorderStyles = (isOnwardContent?: boolean) => css`
108108
content: '';
109109
position: absolute;
110110
top: 0;
111111
bottom: 0;
112112
left: -10px;
113113
width: 1px;
114-
background-color: ${palette('--card-border-top')};
114+
background-color: ${isOnwardContent
115+
? palette('--onward-content-border')
116+
: palette('--card-border-top')};
115117
transform: translateX(-50%);
116118
`;
117119

118-
const singleRowLeftBorderStyles = css`
120+
const singleRowLeftBorderStyles = (isOnwardContent?: boolean) => css`
119121
:not(:first-child)::before {
120-
${leftBorderStyles}
122+
${leftBorderStyles(isOnwardContent)}
121123
}
122124
`;
123125

124-
const stackedRowLeftBorderStyles = css`
126+
const stackedRowLeftBorderStyles = (isOnwardContent?: boolean) => css`
125127
${from.tablet} {
126128
:not(:first-child)::before {
127-
${leftBorderStyles}
129+
${leftBorderStyles(isOnwardContent)}
128130
}
129131
}
130132
${until.tablet} {
131133
:not(:first-child):not(:nth-child(2))::before {
132-
${leftBorderStyles}
134+
${leftBorderStyles(isOnwardContent)}
133135
}
134136
}
135137
`;
@@ -410,17 +412,20 @@ export const ScrollableCarousel = ({
410412

411413
ScrollableCarousel.Item = ({
412414
isStackingCarousel = false,
415+
isOnwardContent = false,
413416
children,
414417
}: {
415418
isStackingCarousel?: boolean;
416419
children: React.ReactNode;
420+
/** The colour of borders can be overriden */
421+
isOnwardContent?: boolean;
417422
}) => (
418423
<li
419424
css={[
420425
itemStyles,
421426
isStackingCarousel
422-
? stackedRowLeftBorderStyles
423-
: singleRowLeftBorderStyles,
427+
? stackedRowLeftBorderStyles(isOnwardContent)
428+
: singleRowLeftBorderStyles(isOnwardContent),
424429
]}
425430
>
426431
{children}

dotcom-rendering/src/components/ScrollableSmallOnwards.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const ScrollableSmallOnwardsStory = {
1818
discussionApiUrl:
1919
'https://discussion.code.dev-theguardian.com/discussion-api',
2020
heading: 'More on this story',
21-
url: 'http://localhost:9000/more-galleries',
21+
headingUrl: 'http://localhost:9000/more-galleries',
2222
onwardsSource: 'more-galleries',
2323
trails: [
2424
{

0 commit comments

Comments
 (0)