File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import client from './apolloClient';
55import { usePageTracking } from './hooks/usePageTracking' ;
66import { CompetitionLayout } from './layouts/CompetitionLayout' ;
77import { RootLayout } from './layouts/RootLayout' ;
8+ import { FEATURE_FLAGS } from './lib/featureFlags' ;
89import About from './pages/About' ;
910import CompetitionAdmin from './pages/Competition/Admin' ;
1011import CompetitionEvents from './pages/Competition/ByGroup/Events' ;
@@ -169,9 +170,16 @@ const Navigation = () => {
169170 < Route path = "*" element = { < p > Path not resolved</ p > } />
170171 </ Route >
171172 < Route path = "/users/:userId" element = { < UserLogin /> } />
172- < Route path = "/me" element = { < Navigate to = "/me/competitions" replace /> } />
173- < Route path = "/me/results/:resultsMode" element = { < Navigate to = "/me/results" replace /> } />
174- < Route path = "/me/:tab" element = { < UserPage /> } />
173+ { FEATURE_FLAGS . personalUserPage && (
174+ < >
175+ < Route path = "/me" element = { < Navigate to = "/me/competitions" replace /> } />
176+ < Route
177+ path = "/me/results/:resultsMode"
178+ element = { < Navigate to = "/me/results" replace /> }
179+ />
180+ < Route path = "/me/:tab" element = { < UserPage /> } />
181+ </ >
182+ ) }
175183 < Route path = "about" element = { < About /> } />
176184 < Route path = "live-activities" element = { < LiveActivitiesAbout /> } />
177185 < Route path = "settings" element = { < Settings /> } />
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Link, useParams } from 'react-router-dom';
55import { Popover } from 'react-tiny-popover' ;
66import { useCompetition } from '@/hooks/queries/useCompetition' ;
77import { UserCompsResponse } from '@/lib/api' ;
8+ import { FEATURE_FLAGS } from '@/lib/featureFlags' ;
89import { useAuth } from '@/providers/AuthProvider' ;
910import { useWCIF } from '@/providers/WCIFProvider' ;
1011
@@ -76,9 +77,11 @@ export default function Header() {
7677 < div
7778 className = "z-50 mt-2 border-2 shadow-xl bg-panel border-tertiary-weak"
7879 onClick = { ( ) => setIsPopoverOpen ( ! isPopoverOpen ) } >
79- < Link to = "/me" className = "block w-32 px-3 py-2 link-inline hover-bg-tertiary" >
80- My profile
81- </ Link >
80+ { FEATURE_FLAGS . personalUserPage && (
81+ < Link to = "/me" className = "block w-32 px-3 py-2 link-inline hover-bg-tertiary" >
82+ My profile
83+ </ Link >
84+ ) }
8285 < Link to = "/settings" className = "block w-32 px-3 py-2 link-inline hover-bg-tertiary" >
8386 Settings
8487 </ Link >
Original file line number Diff line number Diff line change 1+ const enabledValues = new Set ( [ '1' , 'true' , 'yes' , 'on' ] ) ;
2+
3+ const isEnabled = ( value : string | undefined ) =>
4+ value ? enabledValues . has ( value . toLowerCase ( ) ) : false ;
5+
6+ export const FEATURE_FLAGS = {
7+ personalUserPage : isEnabled ( import . meta. env . VITE_FEATURE_PERSONAL_USER_PAGE ) ,
8+ } ;
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ interface ImportMetaEnv {
88 readonly VITE_NOTIFY_COMP_ORIGIN ?: string ;
99 readonly VITE_NOTIFYCOMP_API_ORIGIN ?: string ;
1010 readonly VITE_NOTIFYCOMP_WS_ORIGIN ?: string ;
11+ readonly VITE_FEATURE_PERSONAL_USER_PAGE ?: string ;
1112}
You can’t perform that action at this time.
0 commit comments