Skip to content

Commit

Permalink
feat: disabled features
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoDex committed Dec 23, 2024
1 parent 68d95f4 commit 099be0e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/providers/FeatureToggleProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from "react";
import { FlagProvider } from "@unleash/proxy-client-react";
import { FlagProvider, IConfig } from "@unleash/proxy-client-react";

const config = {
const config: IConfig = {
url: "https://unleash.spark-defi.com/unleash/api/frontend/",
clientKey: import.meta.env.VITE_FEATURE_TOGGLE_CLIENT_KEY ?? "",
refreshInterval: 15,
Expand All @@ -12,6 +12,16 @@ interface FeatureProviderProps {
children: ReactNode;
}

const isFeaturesDisabled = true;

export const FeatureToggleProvider: React.FC<FeatureProviderProps> = ({ children }) => {
return <FlagProvider config={config}>{children}</FlagProvider>;
if (isFeaturesDisabled) {
return children;
}

return (
<FlagProvider config={config} startClient>
{children}
</FlagProvider>
);
};

0 comments on commit 099be0e

Please sign in to comment.