Skip to content

Commit d74be3f

Browse files
PROD-1075 #comment PR comments #time 10m
1 parent 80dfff4 commit d74be3f

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/header/utility-selectors/UtilitySelector/ProfileSelector/ProfileSelector.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FC, useContext } from 'react'
22

3+
import { SETTINGS_TITLE } from '../../../../config'
34
import { profileContext, ProfileContextData } from '../../../../lib'
45
import '../../../../lib/styles/index.scss'
56

@@ -23,7 +24,7 @@ const ProfileSelector: FC<{}> = () => {
2324
return (
2425
<div className={styles['profile-selector']}>
2526
{!isLoggedIn && <ProfileNotLoggedIn />}
26-
{isLoggedIn && <ProfileLoggedIn />}
27+
{isLoggedIn && <ProfileLoggedIn settingsTitle={SETTINGS_TITLE} />}
2728
</div>
2829
)
2930
}

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/ProfileLoggedIn.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {
1111
import { ProfilePanel } from './profile-panel'
1212
import styles from './ProfileLoggedIn.module.scss'
1313

14-
const ProfileLoggedIn: FC<{}> = () => {
14+
interface ProfileLoggedInProps {
15+
settingsTitle: string
16+
}
17+
18+
const ProfileLoggedIn: FC<ProfileLoggedInProps> = (props: ProfileLoggedInProps) => {
1519

1620
const { profile }: ProfileContextData = useContext(profileContext)
1721
const [profilePanelOpen, setProfilePanelOpen]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
@@ -41,7 +45,12 @@ const ProfileLoggedIn: FC<{}> = () => {
4145
</div>
4246
)}
4347
</div>
44-
{profilePanelOpen && <ProfilePanel toggleProfilePanel={toggleProfilePanel} />}
48+
{profilePanelOpen && (
49+
<ProfilePanel
50+
settingsTitle={props.settingsTitle}
51+
toggleProfilePanel={toggleProfilePanel}
52+
/>
53+
)}
4554
</>
4655
)
4756
}

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/profile-panel/ProfilePanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FC, useContext } from 'react'
22
import { Link } from 'react-router-dom'
33

4-
import { SETTINGS_TITLE } from '../../../../../../config'
54
import {
65
authUrlLogout,
76
profileContext,
@@ -13,6 +12,7 @@ import {
1312
import styles from './ProfilePanel.module.scss'
1413

1514
interface ProfilePanelProps {
15+
settingsTitle: string
1616
toggleProfilePanel: () => void
1717
}
1818

@@ -34,9 +34,9 @@ const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
3434
<Link
3535
className={styles.profile}
3636
onClick={() => props.toggleProfilePanel()}
37-
to={getPath(SETTINGS_TITLE)}
37+
to={getPath(props.settingsTitle)}
3838
>
39-
{SETTINGS_TITLE}
39+
{props.settingsTitle}
4040
</Link>
4141
<a href={authUrlLogout} className={styles.logout}>
4242
Log Out

0 commit comments

Comments
 (0)