Skip to content

Commit

Permalink
put map page behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vmork committed Sep 13, 2024
1 parent f47386f commit 779e972
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/app/student/map/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ import {
} from "@/app/student/map/lib/booths"
import { LocationId, locations } from "@/app/student/map/lib/locations"
import { fetchExhibitors } from "@/components/shared/hooks/api/useExhibitors"
import { feature } from "@/components/shared/feature"
import { notFound } from "next/navigation"

export default async function Page() {
if (!feature("MAP_PAGE")) {
return notFound()
}

const exhibitors = await fetchExhibitors({
year: 2024,
next: { revalidate: 3600 * 24 * 6 /* 6 days */ }
Expand All @@ -29,16 +35,13 @@ export default async function Page() {
boothsByLocation.get(booth.location)!.set(id, booth)
})

const editorMode = false

return (
// TODO: pt-16 is to account for the navbar, will break if navbar size changes
<div className="flex h-screen pt-16">
<MainView
exhibitorsById={exhibitorsByID}
boothsByLocation={boothsByLocation}
boothsById={boothsById}
editorMode={editorMode}
/>
</div>
)
Expand Down
8 changes: 7 additions & 1 deletion src/components/shared/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ const studentLinks: NavigationLink[] = [
href: "/student/recruitment",
description: `Join Armada ${DateTime.now().year}. See which roles are available`,
enabled: true
}
},
{
title: "Map",
href: "/student/map",
description: "Find your way around the fair",
enabled: feature("MAP_PAGE")
},
]

const aboutLinks: NavigationLink[] = [
Expand Down
10 changes: 9 additions & 1 deletion src/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ export const FEATURE_FLAG_DEFINITIONS = {
{ value: true, label: "Show" },
{ value: false, label: "Hidden" }
]
},
MAP_PAGE: {
description: "Access to Map Page",
options: [
{ value: true, label: "Show" },
{ value: false, label: "Hidden" }
]
}
} satisfies FlagDefinitionsType

export const FEATURE_FLAGS: Record<
keyof typeof FEATURE_FLAG_DEFINITIONS,
boolean
> = {
EVENT_PAGE: false
EVENT_PAGE: false,
MAP_PAGE: true
}

export default FEATURE_FLAGS

0 comments on commit 779e972

Please sign in to comment.