mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-04 05:07:48 +03:00
fix(frontend): upgrade to plus button (#2324)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
This commit is contained in:
parent
96f1308d9b
commit
276dcd20e1
@ -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 ({
|
||||
<body
|
||||
className={`bg-white text-black h-screen flex flex-col dark:bg-black dark:text-white w-full ${inter.className}`}
|
||||
>
|
||||
<FeatureFlagsProvider>
|
||||
<ToastProvider>
|
||||
<SupabaseProvider session={session}>
|
||||
<App>{children}</App>
|
||||
</SupabaseProvider>
|
||||
</ToastProvider>
|
||||
<VercelAnalytics />
|
||||
</FeatureFlagsProvider>
|
||||
<ToastProvider>
|
||||
<SupabaseProvider session={session}>
|
||||
<App>{children}</App>
|
||||
</SupabaseProvider>
|
||||
</ToastProvider>
|
||||
<VercelAnalytics />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
@ -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<string, FeatureDefinition>;
|
||||
}>(growthBookUrl);
|
||||
growthBook.setFeatures(growthBookInitResponse.data.features);
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<GrowthBookProvider growthbook={growthBook}>{children}</GrowthBookProvider>
|
||||
);
|
||||
};
|
@ -1,2 +0,0 @@
|
||||
export { FeatureFlagsProvider } from './FeatureFlagsProvider';
|
||||
|
@ -1,4 +1,3 @@
|
||||
export * from "./BrainProvider";
|
||||
export * from "./ChatProvider";
|
||||
export * from "./FeatureFlagProvider";
|
||||
export * from "./KnowledgeToFeedProvider";
|
||||
|
Loading…
Reference in New Issue
Block a user