Skip to content

Commit

Permalink
feat: add deposit only switch
Browse files Browse the repository at this point in the history
  • Loading branch information
w84april committed Oct 22, 2024
1 parent 88aaaff commit 4991d5b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion apps/vaults-v3/components/details/VaultActionsTabsWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {VaultDetailsQuickActionsTo} from '@vaults-v3/components/details/actions/
import {RewardsTab} from '@vaults-v3/components/details/RewardsTab';
import {SettingsPopover} from '@vaults-v3/components/SettingsPopover';
import {readContracts} from '@wagmi/core';
import {Switch} from '@common/components/Switch';
import {useYearn} from '@common/contexts/useYearn';
import {IconChevron} from '@common/icons/IconChevron';

Expand Down Expand Up @@ -260,6 +261,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
const {onSwitchSelectedOptions, isDepositing, actionParams} = useActionFlow();
const {address} = useWeb3();
const router = useRouter();
const {isAutoStakingEnabled, set_isAutoStakingEnabled} = useYearn();
const [unstakedBalance, set_unstakedBalance] = useState<TNormalizedBN | undefined>(undefined);
const [possibleTabs, set_possibleTabs] = useState<TTabsOptions[]>([tabs[0], tabs[1]]);
const [hasStakingRewardsLive, set_hasStakingRewardsLive] = useState(true);
Expand Down Expand Up @@ -514,8 +516,20 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
<p className={'hidden text-base md:inline'}>&nbsp;</p>
<div>
<VaultDetailsQuickActionsButtons currentVault={currentVault} />
{hasStakingRewards && (
<div className={'mt-1 flex justify-between'}>
<legend className={'font-number text-xs text-neutral-900/50'}>
{'Deposit only'}
</legend>
<div className={isAutoStakingEnabled ? 'opacity-50' : ''}>
<Switch
isEnabled={!isAutoStakingEnabled}
onSwitch={(): void => set_isAutoStakingEnabled(!isAutoStakingEnabled)}
/>
</div>
</div>
)}
</div>
<legend className={'hidden text-xs md:inline'}>&nbsp;</legend>
</div>
</div>
)}
Expand Down

0 comments on commit 4991d5b

Please sign in to comment.