Skip to content

Commit

Permalink
remove feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator committed Aug 19, 2024
1 parent 3887238 commit acc2b9a
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions packages/web/hooks/use-feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export type AvailableFlags =
| "multiBridgeProviders"
| "earnPage"
| "transactionsPage"
| "sidecarRouter"
| "legacyRouter"
| "tfmRouter"
| "osmosisUpdatesPopUp"
| "aprBreakdown"
| "topAnnouncementBanner"
Expand All @@ -34,22 +31,14 @@ export type AvailableFlags =
| "cypherCard"
| "newPortfolioPage";

type ModifiedFlags =
| Exclude<AvailableFlags, "mobileNotifications">
| "_isInitialized"
| "_isClientIDPresent";

const defaultFlags: Record<ModifiedFlags, boolean> = {
const defaultFlags: Record<AvailableFlags, boolean> = {
staking: true,
swapsAdBanner: true,
tokenInfo: true,
sidebarOsmoChangeAndChart: true,
multiBridgeProviders: true,
earnPage: false,
transactionsPage: true,
sidecarRouter: true,
legacyRouter: true,
tfmRouter: true,
osmosisUpdatesPopUp: false,
aprBreakdown: true,
topAnnouncementBanner: true,
Expand All @@ -63,8 +52,6 @@ const defaultFlags: Record<ModifiedFlags, boolean> = {
oneClickTrading: false,
limitOrders: true,
advancedChart: false,
_isInitialized: false,
_isClientIDPresent: false,
cypherCard: false,
newPortfolioPage: false,
};
Expand All @@ -74,7 +61,7 @@ const LIMIT_ORDER_COUNTRY_CODES =
s.trim()
) ?? [];

export const useFeatureFlags = () => {
export function useFeatureFlags() {
const launchdarklyFlags: Record<AvailableFlags, boolean> = useFlags();
const { isMobile } = useWindowSize();
const [isInitialized, setIsInitialized] = useState(false);
Expand Down Expand Up @@ -122,5 +109,8 @@ export const useFeatureFlags = () => {
launchdarklyFlags.limitOrders &&
(LIMIT_ORDER_COUNTRY_CODES.length === 0 ||
LIMIT_ORDER_COUNTRY_CODES.includes(levanaGeoblock?.countryCode ?? "")),
} as Record<ModifiedFlags, boolean>;
};
} as Record<
AvailableFlags | "_isInitialized" | "_isClientIDPresent",
boolean
>;
}

0 comments on commit acc2b9a

Please sign in to comment.