Skip to content

Commit

Permalink
feature flag pools tab in inventory drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Jun 5, 2024
1 parent 4deba51 commit 38ca3ad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
"ui show tokens given out": false,
"ui show trade rewards": false,
"ui show utility incentives": false,
"ui show yield over time": false
"ui show yield over time": false,
"ui show pools tab": false,
}
3 changes: 2 additions & 1 deletion web/src/app/_layout/FeatureFlagConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const featureFlagsLabels: { key: keyof FeatureFlags; label: string }[] = [
{ key: "ui show pool reward range", label: "UI Pool Reward Range"},
{ key: "ui show claim yield", label: "UI Show Claim Yield"},
{ key: "ui show earned fees apr", label: "UI Show Earned Fees Apr"},
{ key: "ui show pool filters", label: "UI Show Pool Filters"}
{ key: "ui show pool filters", label: "UI Show Pool Filters"},
{ key: "ui show pools tab", label: "UI Show Pools Tab"}
];

export const FeatureFlagConfig = () => {
Expand Down
14 changes: 9 additions & 5 deletions web/src/components/InventoryContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import { InventoryHeader } from "@/components/InventoryContent/InventoryHeader";
import { cn } from "@/lib/utils";
import { useInventorySettings } from "@/components/InventoryContent/useInventorySettings";
import { InventorySettings } from "@/components/InventoryContent/InventorySettings";
import { useFeatureFlag } from "@/hooks/useFeatureFlag";

export const InventoryContent = () => {
const [content, setContent] = useState<"pools" | "trade">("trade");

const showPoolsTab = useFeatureFlag("ui show pools tab");

const settings = useInventorySettings((s) => s.settings);

return (
Expand All @@ -37,11 +40,12 @@ export const InventoryContent = () => {
value: "trade" as const,
ref: useRef(),
},
{
label: "Pools",
value: "pools" as const,
ref: useRef(),
},
...showPoolsTab ?
[{
label: "Pools",
value: "pools" as const,
ref: useRef(),
}] : [],
]}
/>
</div>
Expand Down
5 changes: 5 additions & 0 deletions web/src/hooks/useFeatureFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export interface FeatureFlags {
* Show claim all yield button, and functionality.
*/
"ui show claim all yield": boolean;

/**
* Show pools tab in inventory drawer.
*/
"ui show pools tab": boolean;
}

/**
Expand Down

0 comments on commit 38ca3ad

Please sign in to comment.