Skip to content

Commit 28cddc1

Browse files
committed
Fix repeating newsletter sign up
1 parent 63c3564 commit 28cddc1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dotcom-rendering/src/components/ProductElement.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const Content = ({
124124
key={index}
125125
index={index}
126126
format={format}
127+
isProduct={true}
127128
isMainMedia={false}
128129
/>
129130
))}

dotcom-rendering/src/lib/renderElement.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ type Props = {
9393
editionId: EditionId;
9494
forceDropCap?: 'on' | 'off';
9595
isTimeline?: boolean;
96+
isProduct?: boolean;
9697
totalElements?: number;
9798
isListElement?: boolean;
9899
isSectionedMiniProfilesArticle?: boolean;
@@ -164,6 +165,7 @@ export const renderElement = ({
164165
editionId,
165166
forceDropCap,
166167
isTimeline = false,
168+
isProduct = false,
167169
totalElements = 0,
168170
isListElement = false,
169171
isSectionedMiniProfilesArticle = false,
@@ -553,7 +555,7 @@ export const renderElement = ({
553555
successDescription: element.newsletter.successDescription,
554556
theme: element.newsletter.theme,
555557
};
556-
if (isListElement || isTimeline) return null;
558+
if (isListElement || isTimeline || isProduct) return null;
557559
return <EmailSignUpWrapper {...emailSignUpProps} />;
558560
case 'model.dotcomrendering.pageElements.AdPlaceholderBlockElement':
559561
return renderAds && <AdPlaceholder />;
@@ -985,6 +987,7 @@ export const RenderArticleElement = ({
985987
editionId,
986988
forceDropCap,
987989
isTimeline,
990+
isProduct,
988991
totalElements,
989992
isListElement,
990993
isSectionedMiniProfilesArticle,
@@ -1013,6 +1016,7 @@ export const RenderArticleElement = ({
10131016
editionId,
10141017
forceDropCap,
10151018
isTimeline,
1019+
isProduct,
10161020
totalElements,
10171021
isListElement,
10181022
isSectionedMiniProfilesArticle,
@@ -1053,6 +1057,7 @@ type ElementLevelPropNames =
10531057
| 'hideCaption'
10541058
| 'format'
10551059
| 'isTimeline'
1060+
| 'isProduct'
10561061
| 'isListElement'
10571062
| 'isMainMedia';
10581063
type ArticleLevelProps = Omit<Props, ElementLevelPropNames>;

0 commit comments

Comments
 (0)