Skip to content

Commit

Permalink
Revert "removing crossowrd formatting"
Browse files Browse the repository at this point in the history
This reverts commit f3b9feb.
  • Loading branch information
sndrs committed Dec 12, 2024
1 parent 8c33976 commit f4cf065
Show file tree
Hide file tree
Showing 8 changed files with 872 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dotcom-rendering/src/components/ArticleContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const articleWidth = (format: ArticleFormat) => {
}
`;
}
case ArticleDesign.Crossword:
/* The crossword player manages its own width; */
return null;
case ArticleDesign.Video:
case ArticleDesign.Audio:
return css`
Expand Down
5 changes: 5 additions & 0 deletions dotcom-rendering/src/components/BylineLink.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isString } from '@guardian/libs';
import { Hide } from '@guardian/source/react-components';
import { DottedLines } from '@guardian/source-development-kitchen/react-components';
import { Fragment } from 'react';
import { ArticleDesign, type ArticleFormat } from '../lib/articleFormat';
import {
getBylineComponentsFromTokens,
Expand Down Expand Up @@ -160,6 +161,10 @@ const getRenderedTokens = (
);
}

if (design === ArticleDesign.Crossword && renderedTokens.length > 0) {
return [<Fragment key="set-by">Set by: </Fragment>, ...renderedTokens];
}

return renderedTokens;
};

Expand Down
26 changes: 26 additions & 0 deletions dotcom-rendering/src/components/CrosswordInstructions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { css } from '@emotion/react';
import {
textEgyptian17,
textEgyptianBold17,
} from '@guardian/source/foundations';

const instructionsStyles = css`
${textEgyptian17};
white-space: pre-line;
`;

const headerStyles = css`
${textEgyptianBold17};
white-space: pre-line;
`;

export const CrosswordInstructions = ({
instructions,
}: {
instructions: string;
}) => (
<div css={instructionsStyles}>
<strong css={headerStyles}>Special instructions: </strong>
{instructions}
</div>
);
33 changes: 33 additions & 0 deletions dotcom-rendering/src/components/CrosswordLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { css } from '@emotion/react';
import { isUndefined } from '@guardian/libs';
import { type CrosswordProps } from '@guardian/react-crossword-next';
import { textSans15 } from '@guardian/source/foundations';
import { palette } from '../palette';

const crosswordLinkStyles = css`
${textSans15};
a {
color: ${palette('--standfirst-link-text')};
text-decoration: none;
:hover {
border-bottom: 1px solid ${palette('--standfirst-link-border')};
}
}
`;

export const CrosswordLinks = ({
crossword,
}: {
crossword: CrosswordProps['data'];
}) => {
return (
isUndefined(crossword.pdf) || (
<span css={crosswordLinkStyles}>
<a target="_blank" href={crossword.pdf} rel="noreferrer">
PDF version
</a>
</span>
)
);
};
Loading

0 comments on commit f4cf065

Please sign in to comment.