Skip to content

Commit

Permalink
feat: Add gauge-voting feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
karelianpie committed Aug 24, 2023
1 parent f69dc54 commit 063c3a0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pages/veyfi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,34 @@ import {formatAmount} from '@yearn-finance/web-lib/utils/format.number';
import {PageProgressBar} from '@common/components/PageProgressBar';
import {SummaryData} from '@common/components/SummaryData';
import {Tabs} from '@common/components/Tabs';
import {useFeatureFlag} from '@common/hooks/useFeatureFlag';
import {formatDateShort} from '@common/utils';

import type {NextRouter} from 'next/router';
import type {ReactElement} from 'react';

function Index(): ReactElement {
const {votingEscrow, positions, isLoading} = useVotingEscrow();
const [isGaugeVotingFeatureEnabled] = useFeatureFlag('gauge-voting');

const totalLockedYFI = formatToNormalizedValue(toBigInt(votingEscrow?.supply), 18);
const yourLockedYFI = formatToNormalizedValue(toBigInt(positions?.deposit?.underlyingBalance), 18);

const tabs = [
{id: 'lock', label: 'Lock YFI', content: <LockTab />},
{id: 'manage', label: 'Manage lock', content: <ManageLockTab />},
{id: 'lock', label: 'Lock YFI', content: <LockTab />},
{id: 'manage', label: 'Manage lock', content: <ManageLockTab />},
{id: 'claim', label: 'Claim', content: <ClaimTab />},
{id: 'gauges', label: 'Stake / Unstake', content: <GaugesTab />},
{id: 'rewards', label: 'Rewards', content: <RewardsTab />},
{id: 'redeem', label: 'Redeem oYFI', content: <RedeemTab />},
{id: 'vote', label: 'Vote for Gauge', content: <VoteTab />}
];
...isGaugeVotingFeatureEnabled ? [
{id: 'gauges', label: 'Stake / Unstake', content: <GaugesTab />},
{id: 'rewards', label: 'Rewards', content: <RewardsTab />},
{id: 'redeem', label: 'Redeem oYFI', content: <RedeemTab />},
{id: 'vote', label: 'Vote for Gauge', content: <VoteTab />}
] : []
].filter(Boolean);

return (
<>
<PageProgressBar isLoading={isLoading}/>
<PageProgressBar isLoading={isLoading} />

<h1 className={'w-full text-center text-8xl font-bold'}>
{'veYFI'}
Expand Down

0 comments on commit 063c3a0

Please sign in to comment.