diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index 2e1ed3c01..56fa421bb 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -4,7 +4,6 @@ import { Outfit } from "next/font/google"; import { cookies, headers } from "next/headers"; import { ToastProvider } from "@/lib/components/ui/Toast"; -import { FeatureFlagsProvider } from "@/lib/context"; import { SupabaseProvider } from "@/lib/context/SupabaseProvider"; import { App } from "./App"; @@ -37,14 +36,12 @@ const RootLayout = async ({ - - - - {children} - - - - + + + {children} + + + ); diff --git a/frontend/lib/context/FeatureFlagProvider/FeatureFlagsProvider.tsx b/frontend/lib/context/FeatureFlagProvider/FeatureFlagsProvider.tsx deleted file mode 100644 index 5174cbd54..000000000 --- a/frontend/lib/context/FeatureFlagProvider/FeatureFlagsProvider.tsx +++ /dev/null @@ -1,38 +0,0 @@ -"use client" -import type { FeatureDefinition } from "@growthbook/growthbook"; -import { GrowthBook, GrowthBookProvider } from "@growthbook/growthbook-react"; -import axios from "axios"; -import { useAsync } from "react-use"; - - -const growthBook = new GrowthBook({ - apiHost: "https://cdn.growthbook.io", - clientKey:process.env.NEXT_PUBLIC_GROWTHBOOK_CLIENT_KEY, - enableDevMode: true, -}); - - - -const unauthenticatedClient = axios.create(); - -export const FeatureFlagsProvider = ({ - children, -}: { - children?: React.ReactNode; - }): JSX.Element => { - - const growthBookUrl = process.env.NEXT_PUBLIC_GROWTHBOOK_URL; - - useAsync(async () => { - if (growthBookUrl !== undefined) { - const growthBookInitResponse = await unauthenticatedClient.get<{ - features: Record; - }>(growthBookUrl); - growthBook.setFeatures(growthBookInitResponse.data.features); - } - }); - - return ( - {children} - ); -}; diff --git a/frontend/lib/context/FeatureFlagProvider/index.ts b/frontend/lib/context/FeatureFlagProvider/index.ts deleted file mode 100644 index a3c7c6ee4..000000000 --- a/frontend/lib/context/FeatureFlagProvider/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FeatureFlagsProvider } from './FeatureFlagsProvider'; - diff --git a/frontend/lib/context/index.tsx b/frontend/lib/context/index.tsx index 5b42c24ae..e20130cc0 100644 --- a/frontend/lib/context/index.tsx +++ b/frontend/lib/context/index.tsx @@ -1,4 +1,3 @@ export * from "./BrainProvider"; export * from "./ChatProvider"; -export * from "./FeatureFlagProvider"; export * from "./KnowledgeToFeedProvider";