Skip to content

Add MastHead to the GalleryLayout #13988

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

Merged
merged 1 commit into from
May 27, 2025
Merged
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
99 changes: 61 additions & 38 deletions dotcom-rendering/src/layouts/GalleryLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { css } from '@emotion/react';
import { Masthead } from '../components/Masthead/Masthead';
import { grid } from '../grid';
import type { NavType } from '../model/extract-nav';
import type { Gallery } from '../types/article';
Expand All @@ -23,41 +24,63 @@ const border = css({
borderStyle: 'solid',
});

export const GalleryLayout = (props: WebProps | AppProps) => (
<>
{props.renderingTarget === 'Web' ? 'Masthead' : null}
<main>
<div css={border}>Labs header</div>
<header css={[grid.container]}>
<div css={[grid.column.all, border]}>Main media</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Headline
</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Standfirst
</div>
<div css={[border, grid.column.left]}>Main media caption</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Meta
</div>
</header>
<div css={border}>Body</div>
<div css={border}>Submeta</div>
</main>
</>
);
export const GalleryLayout = (props: WebProps | AppProps) => {
const frontendData = props.gallery.frontendData;
return (
<>
{props.renderingTarget === 'Web' && (
<Masthead
nav={props.NAV}
editionId={frontendData.editionId}
idUrl={frontendData.config.idUrl}
mmaUrl={frontendData.config.mmaUrl}
discussionApiUrl={frontendData.config.discussionApiUrl}
idApiUrl={frontendData.config.idApiUrl}
contributionsServiceUrl={
frontendData.contributionsServiceUrl
}
showSubNav={false}
showSlimNav={true}
hasPageSkin={false}
hasPageSkinContentSelfConstrain={false}
Comment on lines +44 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these always be false? Do they rely on commercial data @arelra ?

Copy link
Member

@arelra arelra May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a GalleryLayout these will always be false as we only apply page skins to network fronts.

hasPageSkin comes from the config in Frontend payload which in turn is populated by the commercial DFP jobs that allow Frontend match the requested page to an 'active' page skin.

hasPageSkinContentSelfConstrain is an option to control whether the container should be full width but the content should still constrain to a page skin width.

cc @Amouzle

pageId={frontendData.pageId}
/>
)}
<main>
<div css={border}>Labs header</div>
<header css={[grid.container]}>
<div css={[grid.column.all, border]}>Main media</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Headline
</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Standfirst
</div>
<div css={[border, grid.column.left]}>
Main media caption
</div>
<div
css={[
border,
grid.between('centre-column-start', 'grid-end'),
]}
>
Meta
</div>
</header>
<div css={border}>Body</div>
<div css={border}>Submeta</div>
</main>
</>
);
};
Loading