File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 11import { FC , useContext } from 'react'
22
3+ import { SETTINGS_TITLE } from '../../../../config'
34import { profileContext , ProfileContextData } from '../../../../lib'
45import '../../../../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}
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ import {
1111import { ProfilePanel } from './profile-panel'
1212import 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}
Original file line number Diff line number Diff line change 11import { FC , useContext } from 'react'
22import { Link } from 'react-router-dom'
33
4- import { SETTINGS_TITLE } from '../../../../../../config'
54import {
65 authUrlLogout ,
76 profileContext ,
@@ -13,6 +12,7 @@ import {
1312import styles from './ProfilePanel.module.scss'
1413
1514interface 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
You can’t perform that action at this time.
0 commit comments