Skip to content

Commit

Permalink
Change crossword component name to fix renaming issue with build (#13177
Browse files Browse the repository at this point in the history
)

* Change name to fix renaming issue with build
  • Loading branch information
oliverabrahams authored Jan 21, 2025
1 parent d8f5a3f commit ec58bd7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 0 additions & 6 deletions dotcom-rendering/src/components/Crossword.importable.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions dotcom-rendering/src/components/CrosswordComponent.importable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Crossword as ReactCrossword } from '@guardian/react-crossword-next';
import type { CrosswordProps } from '@guardian/react-crossword-next';

/*
The name of this component is important, when it was "Crossword"
webpack was renaming it and the JS wasn't loading in the client.
*/
export const CrosswordComponent = ({
data,
}: {
data: CrosswordProps['data'];
}) => <ReactCrossword data={data} clueMinWidth={150} />;
4 changes: 2 additions & 2 deletions dotcom-rendering/src/lib/renderElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CartoonComponent } from '../components/CartoonComponent';
import { ChartAtom } from '../components/ChartAtom.importable';
import { CodeBlockComponent } from '../components/CodeBlockComponent';
import { CommentBlockComponent } from '../components/CommentBlockComponent';
import { Crossword } from '../components/Crossword.importable';
import { CrosswordComponent } from '../components/CrosswordComponent.importable';
import { DividerBlockComponent } from '../components/DividerBlockComponent';
import { DocumentBlockComponent } from '../components/DocumentBlockComponent.importable';
import { EmailSignUpWrapper } from '../components/EmailSignUpWrapper';
Expand Down Expand Up @@ -864,7 +864,7 @@ export const renderElement = ({
case 'model.dotcomrendering.pageElements.CrosswordElement':
return (
<Island priority="critical" defer={{ until: 'visible' }}>
<Crossword data={element.crossword} />
<CrosswordComponent data={element.crossword} />
</Island>
);
case 'model.dotcomrendering.pageElements.AudioBlockElement':
Expand Down

0 comments on commit ec58bd7

Please sign in to comment.