Skip to content

Commit f131909

Browse files
committed
Fix: sign-in rendering
1 parent f1fda20 commit f131909

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

src/app/components/Account/AccountHeader/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const AccountHeader = () => {
88
const { isSignedIn, signInUrl, forYouUrl } = use(AccountContext);
99
const { translations } = use(ServiceContext);
1010

11-
const href = isSignedIn ? forYouUrl : signInUrl;
12-
if (!href) return null;
11+
const href = isSignedIn ? forYouUrl : signInUrl || '/signin';
1312

1413
const label = isSignedIn
1514
? (translations?.account?.forYou ?? 'For you')

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { use, useRef, useState, useMemo } from 'react';
1+
import { use, useRef, useState } from 'react';
22
import SkipLink from '#psammead/psammead-brand/src/SkipLink';
33
import { RequestContext } from '#contexts/RequestContext';
44
import useOperaMiniDetection from '#hooks/useOperaMiniDetection';
@@ -12,7 +12,6 @@ import {
1212
} from '#app/routes/utils/pageTypes';
1313
import LiteSiteSummary from '#app/components/LiteSiteSummary';
1414
import AccountHeader from '#app/components/Account/AccountHeader';
15-
import { AccountContext } from '#contexts/AccountContext';
1615
import { ServiceContext } from '../../../contexts/ServiceContext';
1716
import ConsentBanner from '../ConsentBanner';
1817
import NavigationContainer from '../Navigation';
@@ -68,16 +67,6 @@ const HeaderContainer = ({ navItems, propsForTopBarOJComponent }) => {
6867
const isOperaMini = useOperaMiniDetection();
6968

7069
const brandRef = useRef(null);
71-
// const accountContextValue = useContext(AccountContext);
72-
73-
const accountContextValue = useMemo(
74-
() => ({
75-
isSignedIn: false,
76-
signInUrl: '/signin',
77-
forYouUrl: '/for-you',
78-
}),
79-
[],
80-
);
8170

8271
// `serviceLang` is defined when the language the page is written in is different to the
8372
// language of the service. `serviceLang` is used to override the page language.
@@ -120,19 +109,15 @@ const HeaderContainer = ({ navItems, propsForTopBarOJComponent }) => {
120109
skipLink={skipLink}
121110
scriptLink={shouldRenderScriptSwitch && <ScriptLink />}
122111
>
123-
<AccountContext.Provider value={accountContextValue}>
124-
<AccountHeader />
125-
</AccountContext.Provider>
112+
<AccountHeader />
126113
</Header>
127114
) : (
128115
<Header
129116
brandRef={brandRef}
130117
skipLink={skipLink}
131118
scriptLink={shouldRenderScriptSwitch && <ScriptLink />}
132119
>
133-
<AccountContext.Provider value={accountContextValue}>
134-
<AccountHeader />
135-
</AccountContext.Provider>
120+
<AccountHeader />
136121
</Header>
137122
)}
138123
{isLite && <LiteSiteSummary />}

0 commit comments

Comments
 (0)