Skip to content

Commit

Permalink
move scrollDepth back to jumpTo component
Browse files Browse the repository at this point in the history
  • Loading branch information
louisearchibald committed Nov 15, 2024
1 parent 343b753 commit 167afb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/app/components/JumpTo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Text from '#app/components/Text';
import isLive from '#app/lib/utilities/isLive';
import { EventTrackingMetadata } from '#app/models/types/eventTracking';
import { OptimizelyContext } from '@optimizely/react-sdk';
import useOptimizelyScrollDepth from '#app/hooks/useOptimizelyScrollDepth';
import idSanitiser from '../../lib/utilities/idSanitiser';
import styles from './index.styles';

Expand Down Expand Up @@ -47,6 +48,8 @@ const JumpTo = ({ jumpToHeadings }: JumpToProps) => {

const titleId = 'jump-to-heading';

useOptimizelyScrollDepth();

return (
<nav
ref={viewRef}
Expand Down
3 changes: 0 additions & 3 deletions src/app/pages/ArticlePage/ArticlePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import JumpTo, { JumpToProps } from '#app/components/JumpTo';
import useOptimizelyVariation from '#app/hooks/useOptimizelyVariation';
import OptimizelyArticleCompleteTracking from '#app/legacy/containers/OptimizelyArticleCompleteTracking';
import OptimizelyPageViewTracking from '#app/legacy/containers/OptimizelyPageViewTracking';
import useOptimizelyScrollDepth from '#app/hooks/useOptimizelyScrollDepth';
import ElectionBanner from './ElectionBanner';
import ImageWithCaption from '../../components/ImageWithCaption';
import AdContainer from '../../components/Ad';
Expand Down Expand Up @@ -239,8 +238,6 @@ const ArticlePage = ({ pageData }: { pageData: Article }) => {
showRelatedTopics && topics.length > 0 && !isTransliterated,
);

useOptimizelyScrollDepth();

return (
<div css={styles.pageWrapper}>
{shouldEnableExperimentTopStories && (
Expand Down

0 comments on commit 167afb4

Please sign in to comment.