Skip to content

Commit 93af365

Browse files
committed
add link around logo component and enable clickable title for labs variation of front section
1 parent d6eceb7 commit 93af365

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

dotcom-rendering/src/components/FrontSection.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,11 @@ export const FrontSection = ({
693693

694694
{isLabs && showLabsRedesign ? (
695695
<div css={labsSectionHeaderStyles}>
696-
<LabsSectionHeader title={title} />
696+
<LabsSectionHeader
697+
title={title}
698+
url={url}
699+
editionId={editionId}
700+
/>
697701
</div>
698702
) : (
699703
<div

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const meta = {
1414
args: {
1515
title: 'Container Title',
1616
url: '/',
17+
editionId: 'AU',
1718
},
1819
render: (args) => (
1920
<div

dotcom-rendering/src/components/LabsSectionHeader.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import {
77
until,
88
} from '@guardian/source/foundations';
99
import {
10+
Link,
1011
LinkButton,
1112
SvgArrowRightStraight,
1213
} from '@guardian/source/react-components';
14+
import type { EditionId } from '../lib/edition';
15+
import { getLabsUrlSuffix } from '../lib/labs';
1316
import { palette as schemePalette } from '../palette';
1417
import { ContainerTitle } from './ContainerTitle';
1518
import { Details } from './Details';
@@ -20,6 +23,8 @@ type Props = {
2023
title?: string;
2124
/** The title can be made into a link using this property */
2225
url?: string;
26+
/** The ID of the edition, used to construct the Labs front URL */
27+
editionId: EditionId;
2328
};
2429

2530
const headerStyles = css`
@@ -96,10 +101,16 @@ const detailsStyles = css`
96101
padding: ${space[5]}px;
97102
`;
98103

99-
export const LabsSectionHeader = ({ title, url }: Props) => (
104+
export const LabsSectionHeader = ({ title, url, editionId }: Props) => (
100105
<div css={headerStyles}>
101106
<div css={[logoStyles, dividerStylesUntilLeftCol]}>
102-
<LabsLogo />
107+
<Link
108+
href={`https://www.theguardian.com/guardian-labs${getLabsUrlSuffix(
109+
editionId,
110+
)}`}
111+
>
112+
<LabsLogo />
113+
</Link>
103114
</div>
104115

105116
<div css={textLayoutStyles}>

0 commit comments

Comments
 (0)