Skip to content

Commit

Permalink
refactor: refactor logic for showing feature flags panel
Browse files Browse the repository at this point in the history
  • Loading branch information
aidankinzett committed May 21, 2024
1 parent 90c611c commit 7051946
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/src/app/_layout/FeatureFlagConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const featureFlagsLabels: { key: keyof FeatureFlags; label: string }[] = [
{ key: "ui show feature flags panel", label: "UI Show Feature Flags Panel" },
{ key: "ui show superloop", label: "UI Show Superloop" },
{ key: "ui show fee tier", label: "UI Show Fee Tier" },
{ key: "ui show optimising fee route", label: "UI Show Optimising Fee Route" },
{
key: "ui show optimising fee route",
label: "UI Show Optimising Fee Route",
},
{ key: "ui show single token stake", label: "UI Show Single Token Stake" },
{ key: "ui show campaign banner", label: "UI Show Campaign Banner" },
];
Expand All @@ -36,10 +39,11 @@ export const FeatureFlagConfig = () => {
},
});

const showFeatureFlagsPanel = useFeatureFlag("ui show feature flags panel");
const showFeatureFlagsPanel =
useFeatureFlag("ui show feature flags panel") ||
process.env.NODE_ENV === "development";

if (!(showFeatureFlagsPanel || process.env.NODE_ENV === "development"))
return null;
if (!showFeatureFlagsPanel) return null;

return (
<Popover>
Expand Down

0 comments on commit 7051946

Please sign in to comment.