Skip to content

Commit 3742001

Browse files
Run disableArticleSwipe Bridget function on DCAR app interactives
1 parent fcd6113 commit 3742001

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { log } from '@guardian/libs';
2+
import { useEffect } from 'react';
3+
import { getInteractionClient } from '../lib/bridgetApi';
4+
5+
export const InteractivesDisableArticleSwipe = () => {
6+
useEffect(() => {
7+
void getInteractionClient()
8+
.disableArticleSwipe(true)
9+
.catch((error) => {
10+
log('dotcom', 'disableArticleSwipe failed:', error);
11+
});
12+
}, []);
13+
return null;
14+
};

dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { AdSlot, MobileStickyContainer } from '../components/AdSlot.web';
88
import { Footer } from '../components/Footer';
99
import { HeaderAdSlot } from '../components/HeaderAdSlot';
10+
import { InteractivesDisableArticleSwipe } from '../components/InteractivesDisableArticleSwipe';
1011
import { InteractivesNativePlatformWrapper } from '../components/InteractivesNativePlatformWrapper.importable';
1112
import { Island } from '../components/Island';
1213
import { LabsHeader } from '../components/LabsHeader';
@@ -215,6 +216,9 @@ export const FullPageInteractiveLayout = (props: WebProps | AppsProps) => {
215216
<Island priority="critical">
216217
<InteractivesNativePlatformWrapper />
217218
</Island>
219+
<Island priority="critical">
220+
<InteractivesDisableArticleSwipe />
221+
</Island>
218222
<Global styles={temporaryBodyCopyColourOverride} />
219223
</>
220224
)}

dotcom-rendering/src/layouts/InteractiveLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { DiscussionLayout } from '../components/DiscussionLayout';
2424
import { Footer } from '../components/Footer';
2525
import { GridItem } from '../components/GridItem';
2626
import { HeaderAdSlot } from '../components/HeaderAdSlot';
27+
import { InteractivesDisableArticleSwipe } from '../components/InteractivesDisableArticleSwipe';
2728
import { InteractivesNativePlatformWrapper } from '../components/InteractivesNativePlatformWrapper.importable';
2829
import { Island } from '../components/Island';
2930
import { LabsHeader } from '../components/LabsHeader';
@@ -251,6 +252,9 @@ export const InteractiveLayout = (props: WebProps | AppsProps) => {
251252
<Island priority="critical">
252253
<InteractivesNativePlatformWrapper />
253254
</Island>
255+
<Island priority="critical">
256+
<InteractivesDisableArticleSwipe />
257+
</Island>
254258
<Global styles={temporaryBodyCopyColourOverride} />
255259
</>
256260
)}

0 commit comments

Comments
 (0)