Skip to content

Commit

Permalink
Merge branch 'main' into doml/onward-ab-test-links
Browse files Browse the repository at this point in the history
  • Loading branch information
domlander authored Dec 12, 2024
2 parents 19c945b + c8f5b09 commit 1813bfa
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 207 deletions.
25 changes: 21 additions & 4 deletions dotcom-rendering/src/components/FlexibleGeneral.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ export const SplashCardLayout = ({
absoluteServerTimes,
imageLoading,
aspectRatio,
isLastRow,
}: {
cards: DCRFrontCard[];
imageLoading: Loading;
containerPalette?: DCRContainerPalette;
showAge?: boolean;
absoluteServerTimes: boolean;
aspectRatio: AspectRatio;
isLastRow: boolean;
}) => {
const card = cards[0];
if (!card) return null;
Expand All @@ -183,7 +185,11 @@ export const SplashCardLayout = ({
);

return (
<UL padBottom={true} hasLargeSpacing={true} showTopBar={false}>
<UL
padBottom={!isLastRow}
hasLargeSpacing={!isLastRow}
showTopBar={false}
>
<LI
padSides={true}
verticalDividerColour={palette('--card-border-supporting')}
Expand Down Expand Up @@ -268,6 +274,7 @@ export const BoostedCardLayout = ({
imageLoading,
aspectRatio,
isFirstRow,
isLastRow,
}: {
cards: DCRFrontCard[];
imageLoading: Loading;
Expand All @@ -276,6 +283,7 @@ export const BoostedCardLayout = ({
absoluteServerTimes: boolean;
aspectRatio: AspectRatio;
isFirstRow: boolean;
isLastRow: boolean;
}) => {
const card = cards[0];
if (!card) return null;
Expand All @@ -287,7 +295,11 @@ export const BoostedCardLayout = ({
liveUpdatesPosition,
} = decideCardProperties(card.boostLevel);
return (
<UL padBottom={true} hasLargeSpacing={true} showTopBar={!isFirstRow}>
<UL
showTopBar={!isFirstRow}
padBottom={!isLastRow}
hasLargeSpacing={!isLastRow}
>
<LI
padSides={true}
verticalDividerColour={palette('--card-border-supporting')}
Expand Down Expand Up @@ -333,6 +345,7 @@ export const StandardCardLayout = ({
isFirstRow,
isFirstStandardRow,
aspectRatio,
isLastRow,
}: {
cards: DCRFrontCard[];
imageLoading: Loading;
Expand All @@ -343,14 +356,15 @@ export const StandardCardLayout = ({
absoluteServerTimes: boolean;
showImage?: boolean;
aspectRatio: AspectRatio;
isLastRow: boolean;
}) => {
if (cards.length === 0) return null;

return (
<UL
direction="row"
padBottom={true}
hasLargeSpacing={true}
padBottom={!isLastRow}
hasLargeSpacing={!isLastRow}
showTopBar={!isFirstRow}
/** We use one full top bar for the first row and use a split one for subsequent rows */
splitTopBar={!isFirstStandardRow}
Expand Down Expand Up @@ -429,6 +443,7 @@ export const FlexibleGeneral = ({
absoluteServerTimes={absoluteServerTimes}
imageLoading={imageLoading}
aspectRatio={aspectRatio}
isLastRow={cards.length === 0}
/>
)}

Expand All @@ -444,6 +459,7 @@ export const FlexibleGeneral = ({
imageLoading={imageLoading}
aspectRatio={aspectRatio}
isFirstRow={!splash.length && i === 0}
isLastRow={i === groupedCards.length - 1}
/>
);

Expand All @@ -460,6 +476,7 @@ export const FlexibleGeneral = ({
isFirstRow={!splash.length && i === 0}
isFirstStandardRow={i === 0}
aspectRatio={aspectRatio}
isLastRow={i === groupedCards.length - 1}
/>
);
}
Expand Down
13 changes: 6 additions & 7 deletions dotcom-rendering/src/components/FlexibleSpecial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ export const OneCardLayout = ({
absoluteServerTimes,
imageLoading,
aspectRatio,
isLastRow,
}: {
cards: DCRFrontCard[];
imageLoading: Loading;
containerPalette?: DCRContainerPalette;
showAge?: boolean;
absoluteServerTimes: boolean;
aspectRatio: AspectRatio;
isLastRow: boolean;
}) => {
const card = cards[0];
if (!card) return null;
Expand All @@ -137,7 +139,7 @@ export const OneCardLayout = ({
card.supportingContent?.length ?? 0,
);
return (
<UL padBottom={true} hasLargeSpacing={true}>
<UL padBottom={!isLastRow} hasLargeSpacing={!isLastRow}>
<LI padSides={true}>
<FrontCard
trail={card}
Expand Down Expand Up @@ -187,12 +189,7 @@ const TwoCardOrFourCardLayout = ({
if (cards.length === 0) return null;
const hasTwoOrFewerCards = cards.length <= 2;
return (
<UL
direction="row"
padBottom={true}
showTopBar={true}
hasLargeSpacing={true}
>
<UL direction="row" showTopBar={true}>
{cards.map((card, cardIndex) => {
return (
<LI
Expand Down Expand Up @@ -250,6 +247,7 @@ export const FlexibleSpecial = ({
absoluteServerTimes={absoluteServerTimes}
imageLoading={imageLoading}
aspectRatio={aspectRatio}
isLastRow={splash.length === 0 && cards.length === 0}
/>
<OneCardLayout
cards={splash}
Expand All @@ -258,6 +256,7 @@ export const FlexibleSpecial = ({
absoluteServerTimes={absoluteServerTimes}
imageLoading={imageLoading}
aspectRatio={aspectRatio}
isLastRow={cards.length === 0}
/>
<TwoCardOrFourCardLayout
cards={cards}
Expand Down
Loading

0 comments on commit 1813bfa

Please sign in to comment.