Skip to content

Commit

Permalink
Disable switch to borrow on yield loops
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk committed Jul 10, 2024
1 parent 10312df commit 6f58351
Showing 1 changed file with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ import { circle_close, circle_exchange, circle_slider } from 'theme/icons'
export function OmniMultiplyFormController({ txHandler }: { txHandler: () => () => void }) {
const { t } = useTranslation()
const {
environment: { collateralToken, isOpening, quoteToken, collateralIcon, quoteIcon },
environment: {
collateralToken,
isOpening,
quoteToken,
collateralIcon,
quoteIcon,
isYieldLoopWithData,
},
steps: { currentStep },
} = useOmniGeneralContext()
const {
Expand Down Expand Up @@ -86,17 +93,21 @@ export function OmniMultiplyFormController({ txHandler }: { txHandler: () => ()
updateState('action', OmniMultiplyFormAction.PaybackMultiply)
},
},
{
label: t('system.actions.multiply.switch-to-borrow'),
icon: circle_exchange,
iconShrink: 2,
panel: OmniMultiplyPanel.Switch,
action: () => {
dispatch({ type: 'reset' })
updateState('uiDropdown', OmniMultiplyPanel.Switch)
updateState('action', OmniMultiplyFormAction.SwitchMultiply)
},
},
...(!isYieldLoopWithData
? [
{
label: t('system.actions.multiply.switch-to-borrow'),
icon: circle_exchange,
iconShrink: 2,
panel: OmniMultiplyPanel.Switch,
action: () => {
dispatch({ type: 'reset' })
updateState('uiDropdown', OmniMultiplyPanel.Switch)
updateState('action', OmniMultiplyFormAction.SwitchMultiply)
},
},
]
: []),
...(!debtAmount.isZero()
? [
{
Expand Down

0 comments on commit 6f58351

Please sign in to comment.