File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,6 @@ const SettingsModal = dynamic(() => import('@components/SettingsModal'), {
4646 ssr : false ,
4747} ) ;
4848
49- type ActivePage = 'uxcore' | 'uxcg' | 'uxcp' | 'uxcat' | null ;
50-
5149type TToolHeader = {
5250 homepageLinkTarget ?: '_blank' | '_self' ;
5351 openPodcast ?: boolean ;
@@ -100,7 +98,7 @@ const ToolHeader: FC<TToolHeader> = ({
10098 const [ token , setToken ] = useState < string | null > ( null ) ;
10199 const [ usernameIsTakenError , setUsernameIsTakenError ] = useState ( '' ) ;
102100 const [ changedTitle , setChangedTitle ] = useState ( false ) ;
103- const [ activePage , setActivePage ] = useState < ActivePage > ( null ) ;
101+ const [ activePage , setActivePage ] = useState < string > ( router . asPath ) ;
104102
105103 const {
106104 ourProjects,
@@ -145,7 +143,7 @@ const ToolHeader: FC<TToolHeader> = ({
145143 const title = changedTitle ? userInfo ?. title : userInfo ?. user ?. title ;
146144 const normalizePath = ( p : string ) => p . replace ( / \/ + $ / , '' ) || '/' ;
147145
148- const getActiveFromPath = ( pathname : string ) : ActivePage => {
146+ const getActiveFromPath = ( pathname : string ) => {
149147 const path = normalizePath ( pathname ) ;
150148
151149 const pathWithBypass = / ^ \/ u x c p $ / i. test ( path ) ? '/uxcp/' : path ;
You can’t perform that action at this time.
0 commit comments