Skip to content

Commit 9155453

Browse files
committed
feat: conditional banner rendering
1 parent 69ab055 commit 9155453

File tree

1 file changed

+7
-2
lines changed
  • src/app/legacy/containers/Navigation

1 file changed

+7
-2
lines changed

src/app/legacy/containers/Navigation/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import useViewTracker from '#app/hooks/useViewTracker';
1111
import { RequestContext } from '#contexts/RequestContext';
1212
import { AccountContext } from '#contexts/AccountContext';
1313
import AccountPromotionalBanner from '#app/components/Account/AccountPromotionalBanner';
14+
import { ARTICLE_PAGE, HOME_PAGE } from '#app/routes/utils/pageTypes';
1415
import LanguageNavigation from './LanguageNavigation/lazy';
1516
import { ServiceContext } from '../../../contexts/ServiceContext';
1617
import Canonical from './index.canonical';
@@ -50,14 +51,18 @@ const renderListItems = (
5051
}, []);
5152

5253
const NavigationContainer = ({ navItems, propsForTopBarOJComponent }) => {
53-
const { isAmp, isLite } = use(RequestContext);
54+
const { isAmp, isLite, pageType } = use(RequestContext);
5455

5556
const { enabled: accountEnabled } = useToggle('account');
5657
const { isSignedIn, isIdctaAvailable } = use(AccountContext);
5758
const isHydrated = useHydrationDetection();
5859

5960
const showAccountPromoBanner =
60-
isHydrated && accountEnabled && !isSignedIn && isIdctaAvailable;
61+
isHydrated &&
62+
accountEnabled &&
63+
!isSignedIn &&
64+
isIdctaAvailable &&
65+
[ARTICLE_PAGE, HOME_PAGE].includes(pageType);
6166

6267
const { blocks = [] } = propsForTopBarOJComponent || {};
6368
const {

0 commit comments

Comments
 (0)