From 89549c98573607b3250e75975c2fc013e49c9b58 Mon Sep 17 00:00:00 2001 From: Lucas Doell Date: Thu, 26 Feb 2026 23:13:57 -0500 Subject: [PATCH 1/4] Add FeatureFlagsProvider component for managing feature flags in the application --- src/components/feature-flags-provider.tsx | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/components/feature-flags-provider.tsx diff --git a/src/components/feature-flags-provider.tsx b/src/components/feature-flags-provider.tsx new file mode 100644 index 000000000..847b888bc --- /dev/null +++ b/src/components/feature-flags-provider.tsx @@ -0,0 +1,27 @@ +"use client"; + +import { createContext, use, useMemo } from "react"; + +type FeatureFlags = { + scoutingEnabled: boolean; +}; + +const FeatureFlagsContext = createContext({ + scoutingEnabled: false, +}); + +export function FeatureFlagsProvider({ + children, + scoutingEnabled, +}: { + children: React.ReactNode; + scoutingEnabled: boolean; +}) { + const value = useMemo(() => ({ scoutingEnabled }), [scoutingEnabled]); + + return {children}; +} + +export function useFeatureFlags() { + return use(FeatureFlagsContext); +} From 2061b530add8e9935d72fa4bde2bd2732844e06b Mon Sep 17 00:00:00 2001 From: Lucas Doell Date: Thu, 26 Feb 2026 23:14:29 -0500 Subject: [PATCH 2/4] Wrap DashboardLayout component with FeatureFlagsProvider to manage feature flags and enhance conditional rendering --- src/components/dashboard-layout.tsx | 83 +++++++++++++++-------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/src/components/dashboard-layout.tsx b/src/components/dashboard-layout.tsx index 0263fd93f..8946eabde 100644 --- a/src/components/dashboard-layout.tsx +++ b/src/components/dashboard-layout.tsx @@ -1,6 +1,7 @@ import { MainNav } from "@/components/dashboard/main-nav"; import { Search } from "@/components/dashboard/search"; import { TeamSwitcher } from "@/components/dashboard/team-switcher"; +import { FeatureFlagsProvider } from "@/components/feature-flags-provider"; import { Footer } from "@/components/footer"; import { GuestNav } from "@/components/guest-nav"; import { LocaleSwitcher } from "@/components/locale-switcher"; @@ -26,49 +27,51 @@ export async function DashboardLayout({ const scoutingEnabled = await scoutingTool(); return ( - -
-
-
- - - -
- - - - {session ? ( - <> - - - - ) : ( - - )} + + +
+
+
+ + + +
+ + + + {session ? ( + <> + + + + ) : ( + + )} +
-
-
- -
- - - {session ? ( - <> - - - - ) : ( - - )} +
+ +
+ + + {session ? ( + <> + + + + ) : ( + + )} +
+ {children}
- {children} -
-