Skip to content

Commit

Permalink
Merge pull request #236 from compolabs/feat/disable-features
Browse files Browse the repository at this point in the history
feat: disabled features
  • Loading branch information
EchoDex authored Dec 23, 2024
2 parents 68d95f4 + 201bb63 commit fd94788
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 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,12 @@ interface FeatureProviderProps {
children: ReactNode;
}

const isFeaturesDisabled = true;

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

return <FlagProvider config={config}>{children}</FlagProvider>;
};

0 comments on commit fd94788

Please sign in to comment.