Skip to content

Commit

Permalink
feat: add W/OETH balances, update CTA labels
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Oct 3, 2023
1 parent 71d0f52 commit 54b3c78
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/oeth/redeem/src/views/RedeemView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function RedeemViewWrapped() {
? intl.formatMessage({ defaultMessage: 'Enter an amount' })
: amountIn > balOeth?.value
? intl.formatMessage({ defaultMessage: 'Insufficient funds' })
: intl.formatMessage({ defaultMessage: 'Redeem for mix' });
: intl.formatMessage({ defaultMessage: 'Redeem' });
const redeemButtonDisabled =
isBalOethLoading ||
isEstimateLoading ||
Expand Down
2 changes: 2 additions & 0 deletions libs/oeth/shared/src/components/AccountPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import type { StackProps } from '@mui/material';
import type { Token } from '@origin/shared/contracts';

const balanceTokens = [
tokens.mainnet.OETH,
tokens.mainnet.WOETH,
tokens.mainnet.WETH,
tokens.mainnet.rETH,
tokens.mainnet.frxETH,
Expand Down
16 changes: 14 additions & 2 deletions libs/oeth/swap/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,26 @@ export const routeActionLabel: Record<SwapAction, MessageDescriptor> = {
'mint-vault': defineMessage({ defaultMessage: 'Mint with Vault' }),
'swap-curve': defineMessage({ defaultMessage: 'Swap with Curve' }),
'swap-curve-eth': defineMessage({ defaultMessage: 'Swap with CurvePool' }),
'swap-zapper-eth': defineMessage({ defaultMessage: 'Zap + Mint with Vault' }),
'swap-zapper-eth': defineMessage({ defaultMessage: 'Mint with Vault' }),
'swap-zapper-sfrxeth': defineMessage({
defaultMessage: 'Zap + Mint with Vault',
defaultMessage: 'Mint with Vault',
}),
'unwrap-woeth': defineMessage({ defaultMessage: 'Unwrap with Origin' }),
'wrap-oeth': defineMessage({ defaultMessage: 'Wrap with Origin' }),
};

export const buttonActionLabel: Record<SwapAction, MessageDescriptor> = {
'mint-vault': defineMessage({ defaultMessage: 'Mint' }),
'swap-curve': defineMessage({ defaultMessage: 'Swap' }),
'swap-curve-eth': defineMessage({ defaultMessage: 'Swap' }),
'swap-zapper-eth': defineMessage({ defaultMessage: 'Mint' }),
'swap-zapper-sfrxeth': defineMessage({
defaultMessage: 'Mint',
}),
'unwrap-woeth': defineMessage({ defaultMessage: 'Unwrap' }),
'wrap-oeth': defineMessage({ defaultMessage: 'Wrap' }),
};

export const swapRoutes = [
// Mint
{
Expand Down
4 changes: 2 additions & 2 deletions libs/oeth/swap/src/views/SwapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { mainnet, useAccount, useBalance, useNetwork } from 'wagmi';
import { ApyHeader } from '../components/ApyHeader';
import { SwapRoute } from '../components/SwapRoute';
import { TokenSelectModal } from '../components/TokenSelectModal';
import { routeActionLabel } from '../constants';
import { buttonActionLabel } from '../constants';
import {
useHandleAmountInChange,
useHandleApprove,
Expand Down Expand Up @@ -135,7 +135,7 @@ function SwapViewWrapped() {
: amountIn > balTokenIn?.value
? intl.formatMessage({ defaultMessage: 'Insufficient funds' })
: !isNilOrEmpty(selectedSwapRoute)
? intl.formatMessage(routeActionLabel[selectedSwapRoute?.action])
? intl.formatMessage(buttonActionLabel[selectedSwapRoute?.action])
: '';
const amountInInputDisabled = isSwapLoading || isApprovalLoading;
const approveButtonDisabled =
Expand Down

0 comments on commit 54b3c78

Please sign in to comment.