diff --git a/packages/frontend/src/components/navigation.tsx b/packages/frontend/src/components/navigation.tsx index 9779e28..3eba5de 100644 --- a/packages/frontend/src/components/navigation.tsx +++ b/packages/frontend/src/components/navigation.tsx @@ -18,6 +18,7 @@ import { useAuthentication } from '../hooks/use-authentication' import strings from '../locales/localization' import Avatar from './avatar' import Dropdown from './dropdown' +import { isWikiFeatureEnabled } from '../helper/wiki-helper' const Navigation: React.FC = () => { const { data, loading } = useNavigationDataQuery() @@ -69,9 +70,11 @@ const Navigation: React.FC = () => { {strings.navigation.settings} - - {strings.navigation.wiki} - + {isWikiFeatureEnabled() && ( + + {strings.navigation.wiki} + + )} ) diff --git a/packages/frontend/src/global.d.ts b/packages/frontend/src/global.d.ts index 4c1c8fc..9f2d983 100644 --- a/packages/frontend/src/global.d.ts +++ b/packages/frontend/src/global.d.ts @@ -28,6 +28,7 @@ declare const ENVIRONMENT: { backendUrl: string frontendUrl: string supportMail: string + nodeEnv: string } declare const REVISION: string diff --git a/packages/frontend/src/helper/wiki-helper.ts b/packages/frontend/src/helper/wiki-helper.ts new file mode 100644 index 0000000..50fd70a --- /dev/null +++ b/packages/frontend/src/helper/wiki-helper.ts @@ -0,0 +1,3 @@ +export const isWikiFeatureEnabled = (): boolean => { + return ENVIRONMENT.nodeEnv === 'development' || ENVIRONMENT.nodeEnv === 'staging' +} diff --git a/packages/frontend/src/routes.tsx b/packages/frontend/src/routes.tsx index 3db591b..4883c08 100644 --- a/packages/frontend/src/routes.tsx +++ b/packages/frontend/src/routes.tsx @@ -24,6 +24,7 @@ import SupportPage from './pages/support-page' import TraineePage from './pages/trainee-page' import TrainerReportsPage from './pages/trainer-reports-page' import AzubiWikiPage from './pages/azubi-wiki-page' +import { isWikiFeatureEnabled } from './helper/wiki-helper' type RoutesProps = { currentUser?: @@ -72,7 +73,7 @@ const AppRoutes: React.FunctionComponent = ({ currentUser }) => { } /> } /> } /> - } /> + {isWikiFeatureEnabled() && } />} ) : ( } />