From 099be0edc5f12fd7728568890b4939bc08696059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B8b=C4=97rt=C3=B8?= <106074508+EchoDex@users.noreply.github.com> Date: Mon, 23 Dec 2024 11:13:04 +0400 Subject: [PATCH] feat: disabled features --- src/providers/FeatureToggleProvider.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/providers/FeatureToggleProvider.tsx b/src/providers/FeatureToggleProvider.tsx index d74423dd..d512b48a 100644 --- a/src/providers/FeatureToggleProvider.tsx +++ b/src/providers/FeatureToggleProvider.tsx @@ -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, @@ -12,6 +12,16 @@ interface FeatureProviderProps { children: ReactNode; } +const isFeaturesDisabled = true; + export const FeatureToggleProvider: React.FC = ({ children }) => { - return {children}; + if (isFeaturesDisabled) { + return children; + } + + return ( + + {children} + + ); };