Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/frontend/src/components/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -69,9 +70,11 @@ const Navigation: React.FC = () => {
<StyledNavItem to="/settings" onClick={toggleMenu} isMobile={isMobile}>
{strings.navigation.settings}
</StyledNavItem>
<StyledNavItem to="/wiki" onClick={toggleMenu} isMobile={isMobile}>
{strings.navigation.wiki}
</StyledNavItem>
{isWikiFeatureEnabled() && (
<StyledNavItem to="/wiki" onClick={toggleMenu} isMobile={isMobile}>
{strings.navigation.wiki}
</StyledNavItem>
)}
</>
)

Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare const ENVIRONMENT: {
backendUrl: string
frontendUrl: string
supportMail: string
nodeEnv: string
}

declare const REVISION: string
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/helper/wiki-helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const isWikiFeatureEnabled = (): boolean => {
return ENVIRONMENT.nodeEnv === 'development' || ENVIRONMENT.nodeEnv === 'staging'
}
3 changes: 2 additions & 1 deletion packages/frontend/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?:
Expand Down Expand Up @@ -72,7 +73,7 @@ const AppRoutes: React.FunctionComponent<RoutesProps> = ({ currentUser }) => {
<Route path="/report/:year/:week" element={<ReportPage />} />
<Route path="/report/missing" element={<MissingPage />} />
<Route path="/alexa" element={<AlexaPage />} />
<Route path="/wiki" element={<AzubiWikiPage />} />
{isWikiFeatureEnabled() && <Route path="/wiki" element={<AzubiWikiPage />} />}
</>
) : (
<Route path="/" element={<OnboardingPage />} />
Expand Down