Skip to content

Commit e727d5c

Browse files
committed
fetch local data
1 parent 5b5986a commit e727d5c

File tree

4 files changed

+246
-580
lines changed

4 files changed

+246
-580
lines changed

dotcom-rendering/src/components/FlexibleGeneral.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Props = {
3535
collectionId: number;
3636
/** Feature flag for the labs redesign work */
3737
showLabsRedesign?: boolean;
38+
SCStyle?: boolean;
3839
};
3940

4041
type RowLayout = 'oneCardHalfWidth' | 'oneCardFullWidth' | 'twoCard';
@@ -172,6 +173,7 @@ const decideSplashCardProperties = (
172173
mediaCard: boolean,
173174
useLargerHeadlineSizeDesktop: boolean,
174175
avatarUrl: boolean,
176+
SCStyle?: boolean,
175177
): BoostedSplashProperties => {
176178
switch (boostLevel) {
177179
// The default boost level is equal to no boost. It is the same as the default card layout.
@@ -201,10 +203,13 @@ const decideSplashCardProperties = (
201203
mediaPositionOnDesktop: 'right',
202204
mediaPositionOnMobile: mediaCard ? 'top' : 'bottom',
203205
mediaSize: avatarUrl ? 'large' : 'xlarge',
204-
supportingContentAlignment:
205-
supportingContentLength >= 4 ? 'horizontal' : 'vertical',
206+
supportingContentAlignment: SCStyle
207+
? 'vertical'
208+
: supportingContentLength >= 4
209+
? 'horizontal'
210+
: 'vertical',
206211
liveUpdatesAlignment: 'vertical',
207-
trailTextSize: 'regular',
212+
trailTextSize: SCStyle ? 'large' : 'regular',
208213
subtitleSize: 'medium',
209214
};
210215
case 'megaboost':
@@ -256,6 +261,7 @@ type SplashCardLayoutProps = {
256261
collectionId: number;
257262
/** Feature flag for the labs redesign work */
258263
showLabsRedesign?: boolean;
264+
SCStyle?: boolean;
259265
};
260266

261267
const SplashCardLayout = ({
@@ -269,6 +275,7 @@ const SplashCardLayout = ({
269275
containerLevel,
270276
collectionId,
271277
showLabsRedesign,
278+
SCStyle,
272279
}: SplashCardLayoutProps) => {
273280
const card = cards[0];
274281
if (!card) return null;
@@ -308,6 +315,7 @@ const SplashCardLayout = ({
308315
isMediaCard(card.format),
309316
useLargerHeadlineSizeDesktop,
310317
!!card.avatarUrl,
318+
SCStyle,
311319
);
312320

313321
return (
@@ -617,12 +625,17 @@ export const FlexibleGeneral = ({
617625
containerLevel = 'Primary',
618626
collectionId,
619627
showLabsRedesign,
628+
SCStyle = false,
620629
}: Props) => {
621630
const splash = [...groupedTrails.splash].slice(0, 1).map((snap) => ({
622631
...snap,
623632
uniqueId: `collection-${collectionId}-splash-0`,
624633
}));
625634

635+
splash[0]?.headline.includes('Senate') &&
636+
containerLevel === 'Primary' &&
637+
console.dir({ groupedTrails }, { depth: null });
638+
626639
const cards = [...groupedTrails.standard]
627640
.slice(0, 19)
628641
.map((standard, i) => ({
@@ -646,6 +659,7 @@ export const FlexibleGeneral = ({
646659
containerLevel={containerLevel}
647660
collectionId={collectionId}
648661
showLabsRedesign={showLabsRedesign}
662+
SCStyle={SCStyle}
649663
/>
650664
)}
651665
{groupedCards.map((row, i) => {

dotcom-rendering/src/components/StorylineTabContent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ const contentCss = css`
3232
`;
3333

3434
export const StorylineTabContent = ({ content }: { content: Category[] }) => {
35-
// key stories - flexible general, megaboosted first standard card
35+
// key stories - flexible general, megaboosted first standard card - done?
3636
// other categories - flex gen secondary
3737
// explainers/multimedia with default
38-
// opinion with default boost and design 8 (comment)
38+
// opinion with default boost and design 8 (comment) - missing avatar url
3939
// deep reads/profiles with contents->display->is immersive true
4040
const DecideContainer = ({
4141
containerType,
@@ -64,6 +64,7 @@ export const StorylineTabContent = ({ content }: { content: Category[] }) => {
6464
aspectRatio={'5:4'}
6565
collectionId={0}
6666
containerLevel="Secondary"
67+
SCStyle={true}
6768
/>
6869
);
6970
default:

0 commit comments

Comments
 (0)