From 65d881335d77e10c35b1af74d5e01d5fd760e558 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Wed, 29 Jan 2025 09:10:55 +0100 Subject: [PATCH] refactor: rename `notify` calls --- .../PageVeCrv/components/FormLockCreate.tsx | 6 +- .../PageVeCrv/components/FormLockCrv.tsx | 6 +- .../PageVeCrv/components/FormLockDate.tsx | 4 +- .../components/Compensation.tsx | 4 +- .../components/FormLockCreate.tsx | 6 +- .../PageCrvLocker/components/FormLockCrv.tsx | 6 +- .../PageCrvLocker/components/FormLockDate.tsx | 4 +- .../components/FormClaimFeesButtons.tsx | 4 +- .../PageDashboard/components/FormVecrv.tsx | 4 +- .../Deposit/components/FormDeposit.tsx | 6 +- .../Deposit/components/FormDepositStake.tsx | 6 +- .../PagePool/Deposit/components/FormStake.tsx | 6 +- .../dex/components/PagePool/Swap/index.tsx | 6 +- .../Withdraw/components/FormClaim.tsx | 4 +- .../Withdraw/components/FormUnstake.tsx | 4 +- .../Withdraw/components/FormWithdraw.tsx | 6 +- .../dex/components/PageRouterSwap/index.tsx | 6 +- .../dex/entities/gauge/lib/reward-actions.ts | 14 ++-- .../src/dex/store/createCreatePoolSlice.ts | 28 ++++---- .../src/dex/store/createDeployGaugeSlice.ts | 64 +++++++++---------- .../PageLoanCreate/LoanFormCreate/index.tsx | 6 +- .../PageLoanManage/LoanBorrowMore/index.tsx | 6 +- .../LoanCollateralAdd/index.tsx | 6 +- .../LoanCollateralRemove/index.tsx | 4 +- .../PageLoanManage/LoanRepay/index.tsx | 6 +- .../LoanSelfLiquidation/index.tsx | 6 +- .../components/PageVault/VaultClaim/index.tsx | 4 +- .../PageVault/VaultDepositMint/index.tsx | 6 +- .../components/PageVault/VaultStake/index.tsx | 6 +- .../PageVault/VaultUnstake/index.tsx | 4 +- .../PageVault/VaultWithdrawRedeem/index.tsx | 4 +- .../PageLoanCreate/LoanFormCreate/index.tsx | 6 +- .../CollateralDecrease/index.tsx | 4 +- .../CollateralIncrease/index.tsx | 6 +- .../PageLoanManage/LoanDecrease/index.tsx | 6 +- .../PageLoanManage/LoanDeleverage/index.tsx | 4 +- .../PageLoanManage/LoanIncrease/index.tsx | 6 +- .../PageLoanManage/LoanLiquidate/index.tsx | 6 +- .../PageLoanManage/LoanSwap/index.tsx | 6 +- .../components/PegKeeperForm.tsx | 4 +- 40 files changed, 150 insertions(+), 150 deletions(-) diff --git a/apps/main/src/dao/components/PageVeCrv/components/FormLockCreate.tsx b/apps/main/src/dao/components/PageVeCrv/components/FormLockCreate.tsx index 6e64dbad9..eeaea5d8f 100644 --- a/apps/main/src/dao/components/PageVeCrv/components/FormLockCreate.tsx +++ b/apps/main/src/dao/components/PageVeCrv/components/FormLockCreate.tsx @@ -24,7 +24,7 @@ import FieldLockedAmt from '@/dao/components/PageVeCrv/components/FieldLockedAmt import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dao/types/dao.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -100,7 +100,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => const handleBtnClickApproval = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please approve spending your CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, rFormType, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -112,7 +112,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => if (formValues.utcDate) { const localUtcDate = formValues.calcdUtcDate || formatDisplayDate(formValues.utcDate.toString()) const notifyMessage = t`Please confirm locking ${formatNumber(formValues.lockedAmt)} CRV until ${localUtcDate}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepCreate(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dao/components/PageVeCrv/components/FormLockCrv.tsx b/apps/main/src/dao/components/PageVeCrv/components/FormLockCrv.tsx index 250f6fb85..0c7da87bd 100644 --- a/apps/main/src/dao/components/PageVeCrv/components/FormLockCrv.tsx +++ b/apps/main/src/dao/components/PageVeCrv/components/FormLockCrv.tsx @@ -19,7 +19,7 @@ import FieldLockedAmt from '@/dao/components/PageVeCrv/components/FieldLockedAmt import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dao/types/dao.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -51,7 +51,7 @@ const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const handleBtnClickApproval = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please approve spending your CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, rFormType, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -61,7 +61,7 @@ const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const handleBtnClickIncrease = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please confirm increasing lock amount by ${formValues.lockedAmt} CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepIncreaseCrv(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dao/components/PageVeCrv/components/FormLockDate.tsx b/apps/main/src/dao/components/PageVeCrv/components/FormLockDate.tsx index 6d54d8e15..c590fe85f 100644 --- a/apps/main/src/dao/components/PageVeCrv/components/FormLockDate.tsx +++ b/apps/main/src/dao/components/PageVeCrv/components/FormLockDate.tsx @@ -23,7 +23,7 @@ import FieldDatePicker from '@/dao/components/PageVeCrv/components/FieldDatePick import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dao/types/dao.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockDate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -116,7 +116,7 @@ const FormLockDate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { if (formValues.utcDate) { const localUtcDate = formValues.calcdUtcDate || formatDisplayDate(formValues.utcDate.toString()) const notifyMessage = t`Please confirm changing unlock date to ${localUtcDate}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepIncreaseTime(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dex/components/PageCompensation/components/Compensation.tsx b/apps/main/src/dex/components/PageCompensation/components/Compensation.tsx index 5eda9c70e..e640b9637 100644 --- a/apps/main/src/dex/components/PageCompensation/components/Compensation.tsx +++ b/apps/main/src/dex/components/PageCompensation/components/Compensation.tsx @@ -15,7 +15,7 @@ import ExternalLink from '@ui/Link/ExternalLink' import Icon from '@ui/Icon' import TxInfoBar from '@ui/TxInfoBar' import { ChainId, CurveApi, Provider } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const Compensation = ({ rChainId, @@ -56,7 +56,7 @@ const Compensation = ({ async (activeKey: string, contract: EtherContract['contract'], balance: number) => { if (!curve) return const notifyMessage = t`Please confirm claim ${balance} compensation.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') try { setStep('claiming') diff --git a/apps/main/src/dex/components/PageCrvLocker/components/FormLockCreate.tsx b/apps/main/src/dex/components/PageCrvLocker/components/FormLockCreate.tsx index 9c8beca3e..d35701c52 100644 --- a/apps/main/src/dex/components/PageCrvLocker/components/FormLockCreate.tsx +++ b/apps/main/src/dex/components/PageCrvLocker/components/FormLockCreate.tsx @@ -21,7 +21,7 @@ import FieldLockedAmt from '@/dex/components/PageCrvLocker/components/FieldLocke import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -96,7 +96,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => const handleBtnClickApproval = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please approve spending your CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, rFormType, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -108,7 +108,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => if (formValues.utcDate) { const localUtcDate = formValues.calcdUtcDate || formatDisplayDate(formValues.utcDate.toString()) const notifyMessage = t`Please confirm locking ${formatNumber(formValues.lockedAmt)} CRV until ${localUtcDate}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepCreate(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dex/components/PageCrvLocker/components/FormLockCrv.tsx b/apps/main/src/dex/components/PageCrvLocker/components/FormLockCrv.tsx index 4556317c3..a2316082b 100644 --- a/apps/main/src/dex/components/PageCrvLocker/components/FormLockCrv.tsx +++ b/apps/main/src/dex/components/PageCrvLocker/components/FormLockCrv.tsx @@ -15,7 +15,7 @@ import FieldLockedAmt from '@/dex/components/PageCrvLocker/components/FieldLocke import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -48,7 +48,7 @@ const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const handleBtnClickApproval = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please approve spending your CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, rFormType, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -58,7 +58,7 @@ const FormLockCrv = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const handleBtnClickIncrease = useCallback( async (activeKey: string, curve: CurveApi, formValues: FormValues) => { const notifyMessage = t`Please confirm increasing lock amount by ${formValues.lockedAmt} CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepIncreaseCrv(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dex/components/PageCrvLocker/components/FormLockDate.tsx b/apps/main/src/dex/components/PageCrvLocker/components/FormLockDate.tsx index e8b25018c..b6275834d 100644 --- a/apps/main/src/dex/components/PageCrvLocker/components/FormLockDate.tsx +++ b/apps/main/src/dex/components/PageCrvLocker/components/FormLockDate.tsx @@ -20,7 +20,7 @@ import FieldDatePicker from '@/dex/components/PageCrvLocker/components/FieldDate import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormLockDate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { const isSubscribed = useRef(false) @@ -112,7 +112,7 @@ const FormLockDate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => { if (formValues.utcDate) { const localUtcDate = formValues.calcdUtcDate || formatDisplayDate(formValues.utcDate.toString()) const notifyMessage = t`Please confirm changing unlock date to ${localUtcDate}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepIncreaseTime(activeKey, curve, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dex/components/PageDashboard/components/FormClaimFeesButtons.tsx b/apps/main/src/dex/components/PageDashboard/components/FormClaimFeesButtons.tsx index cb9eec534..bb76689c1 100644 --- a/apps/main/src/dex/components/PageDashboard/components/FormClaimFeesButtons.tsx +++ b/apps/main/src/dex/components/PageDashboard/components/FormClaimFeesButtons.tsx @@ -9,7 +9,7 @@ import useStore from '@/dex/store/useStore' import Button from '@ui/Button' import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormClaimFeesButtons = ({ activeKey, @@ -61,7 +61,7 @@ const FormClaimFeesButtons = ({ const { scanTxPath } = network const notifyMessage = t`Please approve claim veCRV rewards.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') // loading state setClaimingKey(key) diff --git a/apps/main/src/dex/components/PageDashboard/components/FormVecrv.tsx b/apps/main/src/dex/components/PageDashboard/components/FormVecrv.tsx index 51acbef0d..6fb8712eb 100644 --- a/apps/main/src/dex/components/PageDashboard/components/FormVecrv.tsx +++ b/apps/main/src/dex/components/PageDashboard/components/FormVecrv.tsx @@ -23,7 +23,7 @@ import Button from '@ui/Button' import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' // TODO uncomment locker link code once it is ready const FormVecrv = () => { @@ -61,7 +61,7 @@ const FormVecrv = () => { const handleBtnClickWithdraw = useCallback( async (activeKey: string, curve: CurveApi, lockedAmount: string) => { const notifyMessage = t`Please confirm withdraw of ${lockedAmount} CRV.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepWithdraw(activeKey, curve, walletAddress) if (isSubscribed.current && resp && resp.hash && resp.walletAddress === walletAddress && network) { diff --git a/apps/main/src/dex/components/PagePool/Deposit/components/FormDeposit.tsx b/apps/main/src/dex/components/PagePool/Deposit/components/FormDeposit.tsx index 621bf4ed6..9c95be880 100644 --- a/apps/main/src/dex/components/PagePool/Deposit/components/FormDeposit.tsx +++ b/apps/main/src/dex/components/PagePool/Deposit/components/FormDeposit.tsx @@ -21,7 +21,7 @@ import Stepper from '@ui/Stepper' import TransferActions from '@/dex/components/PagePool/components/TransferActions' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormDeposit = ({ chainIdPoolId, @@ -86,7 +86,7 @@ const FormDeposit = ({ const handleApproveClick = useCallback( async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues) => { const notifyMessage = t`Please approve spending your ${tokensDescription(formValues.amounts)}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, 'DEPOSIT', poolData.pool, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -97,7 +97,7 @@ const FormDeposit = ({ async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues, maxSlippage: string) => { const tokenText = amountsDescription(formValues.amounts) const notifyMessage = t`Please confirm deposit of ${tokenText} at max ${maxSlippage}% slippage.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepDeposit(activeKey, curve, poolData, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { diff --git a/apps/main/src/dex/components/PagePool/Deposit/components/FormDepositStake.tsx b/apps/main/src/dex/components/PagePool/Deposit/components/FormDepositStake.tsx index 71f28774b..e5d6a1ed5 100644 --- a/apps/main/src/dex/components/PagePool/Deposit/components/FormDepositStake.tsx +++ b/apps/main/src/dex/components/PagePool/Deposit/components/FormDepositStake.tsx @@ -23,7 +23,7 @@ import Stepper from '@ui/Stepper' import TransferActions from '@/dex/components/PagePool/components/TransferActions' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi, Pool, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormDepositStake = ({ chainIdPoolId, @@ -89,7 +89,7 @@ const FormDepositStake = ({ const handleApproveClick = useCallback( async (activeKey: string, curve: CurveApi, pool: Pool, formValues: FormValues) => { const notifyMessage = t`Please approve spending your ${tokensDescription(formValues.amounts)}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, 'DEPOSIT_STAKE', pool, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -100,7 +100,7 @@ const FormDepositStake = ({ async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues, maxSlippage: string) => { const tokenText = amountsDescription(formValues.amounts) const notifyMessage = t`Please confirm deposit and staking of ${tokenText} LP Tokens at max ${maxSlippage}% slippage.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepDepositStake(activeKey, curve, poolData, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/dex/components/PagePool/Deposit/components/FormStake.tsx b/apps/main/src/dex/components/PagePool/Deposit/components/FormStake.tsx index 038ca3958..a3e7ff40e 100644 --- a/apps/main/src/dex/components/PagePool/Deposit/components/FormStake.tsx +++ b/apps/main/src/dex/components/PagePool/Deposit/components/FormStake.tsx @@ -19,7 +19,7 @@ import Stepper from '@ui/Stepper' import TransferActions from '@/dex/components/PagePool/components/TransferActions' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi, Pool, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormStake = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, userPoolBalances }: TransferProps) => { const isSubscribed = useRef(false) @@ -55,7 +55,7 @@ const FormStake = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, us const handleApproveClick = useCallback( async (activeKey: string, curve: CurveApi, pool: Pool, formValues: FormValues) => { const notifyMessage = t`Please approve spending your LP Tokens.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, 'STAKE', pool, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -65,7 +65,7 @@ const FormStake = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, us const handleStakeClick = useCallback( async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues) => { const notifyMessage = t`Please confirm staking of ${formValues.lpToken} LP Tokens` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepStake(activeKey, curve, poolData, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { diff --git a/apps/main/src/dex/components/PagePool/Swap/index.tsx b/apps/main/src/dex/components/PagePool/Swap/index.tsx index 831358844..445c09988 100644 --- a/apps/main/src/dex/components/PagePool/Swap/index.tsx +++ b/apps/main/src/dex/components/PagePool/Swap/index.tsx @@ -35,7 +35,7 @@ import TransferActions from '@/dex/components/PagePool/components/TransferAction import TxInfoBar from '@ui/TxInfoBar' import WarningModal from '@/dex/components/PagePool/components/WarningModal' import { Balances, CurveApi, PoolAlert, PoolData, TokensMapper } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const Swap = ({ chainIdPoolId, @@ -126,7 +126,7 @@ const Swap = ({ ) => { const { fromAmount, fromToken, toToken } = formValues const notifyMessage = t`Please confirm swap ${fromAmount} ${fromToken} for ${toToken} at max slippage ${maxSlippage}%.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepSwap(actionActiveKey, curve, poolData, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { @@ -179,7 +179,7 @@ const Swap = ({ content: isApprove ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending your ${formValues.fromToken}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(actionActiveKey, curve, poolData.pool, formValues, maxSlippage) if (typeof dismiss === 'function') dismiss() }, diff --git a/apps/main/src/dex/components/PagePool/Withdraw/components/FormClaim.tsx b/apps/main/src/dex/components/PagePool/Withdraw/components/FormClaim.tsx index 1dac3f95f..29ad57ef1 100644 --- a/apps/main/src/dex/components/PagePool/Withdraw/components/FormClaim.tsx +++ b/apps/main/src/dex/components/PagePool/Withdraw/components/FormClaim.tsx @@ -18,7 +18,7 @@ import Stepper from '@ui/Stepper' import TransferActions from '@/dex/components/PagePool/components/TransferActions' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormClaim = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, userPoolBalances }: TransferProps) => { const isSubscribed = useRef(false) @@ -60,7 +60,7 @@ const FormClaim = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, us rewardsNeedNudging: boolean | undefined, ) => { const notifyMessage = getClaimText(formValues, formStatus, 'notify', rewardsNeedNudging) - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepClaim(activeKey, curve, poolData) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { diff --git a/apps/main/src/dex/components/PagePool/Withdraw/components/FormUnstake.tsx b/apps/main/src/dex/components/PagePool/Withdraw/components/FormUnstake.tsx index 10222a371..3e1a7014d 100644 --- a/apps/main/src/dex/components/PagePool/Withdraw/components/FormUnstake.tsx +++ b/apps/main/src/dex/components/PagePool/Withdraw/components/FormUnstake.tsx @@ -14,7 +14,7 @@ import TransferActions from '@/dex/components/PagePool/components/TransferAction import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { CurveApi, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormUnstake = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, userPoolBalances }: TransferProps) => { const isSubscribed = useRef(false) @@ -47,7 +47,7 @@ const FormUnstake = ({ curve, poolData, poolDataCacheOrApi, routerParams, seed, const handleUnstakeClick = useCallback( async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues) => { const notifyMessage = t`Please confirm unstaking of ${formValues.stakedLpToken} LP Tokens` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepUnstake(activeKey, curve, poolData, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { diff --git a/apps/main/src/dex/components/PagePool/Withdraw/components/FormWithdraw.tsx b/apps/main/src/dex/components/PagePool/Withdraw/components/FormWithdraw.tsx index a13e1d8ce..42ddf4f89 100644 --- a/apps/main/src/dex/components/PagePool/Withdraw/components/FormWithdraw.tsx +++ b/apps/main/src/dex/components/PagePool/Withdraw/components/FormWithdraw.tsx @@ -32,7 +32,7 @@ import TransferActions from '@/dex/components/PagePool/components/TransferAction import TxInfoBar from '@ui/TxInfoBar' import WarningModal from '@/dex/components/PagePool/components/WarningModal' import { CurveApi, Pool, PoolData } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const FormWithdraw = ({ chainIdPoolId, @@ -91,7 +91,7 @@ const FormWithdraw = ({ const handleApproveClick = useCallback( async (activeKey: string, curve: CurveApi, pool: Pool, formValues: FormValues) => { const notifyMessage = t`Please approve spending your LP Tokens.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, 'WITHDRAW', pool, formValues) if (typeof dismiss === 'function') dismiss() }, @@ -102,7 +102,7 @@ const FormWithdraw = ({ async (activeKey: string, curve: CurveApi, poolData: PoolData, formValues: FormValues, maxSlippage: string) => { const tokenText = amountsDescription(formValues.amounts) const notifyMessage = t`Please confirm withdrawal of ${formValues.lpToken} LP Tokens at max ${maxSlippage}% slippage.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepWithdraw(activeKey, curve, poolData, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && network) { diff --git a/apps/main/src/dex/components/PageRouterSwap/index.tsx b/apps/main/src/dex/components/PageRouterSwap/index.tsx index 7768f6307..33e1277c1 100644 --- a/apps/main/src/dex/components/PageRouterSwap/index.tsx +++ b/apps/main/src/dex/components/PageRouterSwap/index.tsx @@ -39,7 +39,7 @@ import TxInfoBar from '@ui/TxInfoBar' import WarningModal from '@/dex/components/PagePool/components/WarningModal' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { ChainId, CurveApi, Token, TokensMapper } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const QuickSwap = ({ pageLoaded, @@ -163,7 +163,7 @@ const QuickSwap = ({ const notifyMessage = t`swap ${fromAmount} ${fromToken} for ${ isExpectedToAmount ? toAmountOutput : toAmount } ${toToken} at max slippage ${maxSlippage}%.` - const { dismiss } = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const { dismiss } = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar(Pending {notifyMessage}) const resp = await fetchStepSwap(actionActiveKey, curve, formValues, searchedParams, maxSlippage) @@ -213,7 +213,7 @@ const QuickSwap = ({ content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending your ${fromToken}.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, formValues, searchedParams, globalMaxSlippage) if (typeof dismiss === 'function') dismiss() }, diff --git a/apps/main/src/dex/entities/gauge/lib/reward-actions.ts b/apps/main/src/dex/entities/gauge/lib/reward-actions.ts index a80126cf1..f9fdf3e26 100644 --- a/apps/main/src/dex/entities/gauge/lib/reward-actions.ts +++ b/apps/main/src/dex/entities/gauge/lib/reward-actions.ts @@ -24,7 +24,7 @@ import type { import { queryClient } from '@ui-kit/lib/api/query-client' import { GaugeParams } from '@ui-kit/lib/model/query' import useTokensMapper from '@/dex/hooks/useTokensMapper' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' export const useAddRewardToken = ({ chainId, @@ -37,7 +37,7 @@ export const useAddRewardToken = ({ onSuccess: (resp, { rewardTokenId }) => { if (resp) { const txDescription = t`Added reward token ${rewardTokenId ? tokensMapper[rewardTokenId]?.symbol : ''}` - notifyNotification(txDescription, 'success') + notify(txDescription, 'success') } return Promise.all([ @@ -47,7 +47,7 @@ export const useAddRewardToken = ({ }, onError: (error) => { console.error('Error adding reward:', error) - notifyNotification(t`Failed to add reward token`, 'error') + notify(t`Failed to add reward token`, 'error') }, }) } @@ -77,7 +77,7 @@ export const useDepositRewardApprove = ({ onSuccess: (resp, { rewardTokenId, amount }) => { if (resp) { const notifyMessage = t`Approve spending ${rewardTokenId ? tokensMapper[rewardTokenId]?.symbol : ''}` - notifyNotification(notifyMessage, 'success', 15000) + notify(notifyMessage, 'success', 15000) } return queryClient.invalidateQueries({ queryKey: keys.depositRewardIsApproved({ chainId, poolId, rewardTokenId, amount }), @@ -85,7 +85,7 @@ export const useDepositRewardApprove = ({ }, onError: (error) => { console.error('Error approving deposit reward:', error) - notifyNotification(t`Failed to approve deposit reward`, 'error', 15000) + notify(t`Failed to approve deposit reward`, 'error', 15000) }, }) } @@ -114,13 +114,13 @@ export const useDepositReward = ({ onSuccess: (resp, { rewardTokenId }) => { if (resp) { const txDescription = t`Deposited reward token ${rewardTokenId ? tokensMapper[rewardTokenId]?.symbol : ''}` - notifyNotification(txDescription, 'success', 15000) + notify(txDescription, 'success', 15000) } return queryClient.invalidateQueries({ queryKey: keys.isDepositRewardAvailable({ chainId, poolId }) }) }, onError: (error) => { console.error('Error depositing reward:', error) - notifyNotification(t`Failed to deposit reward`, 'error', 15000) + notify(t`Failed to deposit reward`, 'error', 15000) }, }) } diff --git a/apps/main/src/dex/store/createCreatePoolSlice.ts b/apps/main/src/dex/store/createCreatePoolSlice.ts index 516b40ead..165b12a07 100644 --- a/apps/main/src/dex/store/createCreatePoolSlice.ts +++ b/apps/main/src/dex/store/createCreatePoolSlice.ts @@ -11,7 +11,7 @@ import type { GetState, SetState } from 'zustand' import produce from 'immer' import { BigNumber } from 'bignumber.js' import { t } from '@lingui/macro' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import type { State } from '@/dex/store/useStore' import { CRYPTOSWAP, @@ -794,7 +794,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ let dismissNotificationHandler const notifyPendingMessage = t`Please confirm to create pool ${poolName}.` - const { dismiss: dismissConfirm } = notifyNotification(notifyPendingMessage, 'pending') + const { dismiss: dismissConfirm } = notify(notifyPendingMessage, 'pending') dismissNotificationHandler = dismissConfirm @@ -841,7 +841,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.tricryptoFactory.getDeployedPoolAddress(deployPoolTx) @@ -858,7 +858,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.tricryptoFactory.fetchRecentlyDeployedPool(poolAddress) set( @@ -922,7 +922,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.twocryptoFactory.getDeployedPoolAddress(deployPoolTx) @@ -939,7 +939,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.twocryptoFactory.fetchRecentlyDeployedPool(poolAddress) set( @@ -1020,7 +1020,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.stableNgFactory.getDeployedMetaPoolAddress(deployPoolTx) @@ -1038,7 +1038,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.stableNgFactory.fetchRecentlyDeployedPool(poolAddress) set( @@ -1091,7 +1091,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.factory.getDeployedMetaPoolAddress(deployPoolTx) @@ -1108,7 +1108,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.factory.fetchRecentlyDeployedPool(poolAddress) set( @@ -1180,7 +1180,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.stableNgFactory.getDeployedPlainPoolAddress(deployPoolTx) @@ -1197,7 +1197,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.stableNgFactory.fetchRecentlyDeployedPool(poolAddress) set( @@ -1259,7 +1259,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up deploying message dismissConfirm() const deployingNotificationMessage = t`Deploying pool ${poolName}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying const poolAddress = await curve.factory.getDeployedPlainPoolAddress(deployPoolTx) @@ -1277,7 +1277,7 @@ const createCreatePoolSlice = (set: SetState, get: GetState) => ({ // set up success message dismissDeploying() const successNotificationMessage = t`Pool ${poolName} deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) const poolId = await curve.factory.fetchRecentlyDeployedPool(poolAddress) set( diff --git a/apps/main/src/dex/store/createDeployGaugeSlice.ts b/apps/main/src/dex/store/createDeployGaugeSlice.ts index 5656bb415..d4d514d16 100644 --- a/apps/main/src/dex/store/createDeployGaugeSlice.ts +++ b/apps/main/src/dex/store/createDeployGaugeSlice.ts @@ -6,7 +6,7 @@ import produce from 'immer' import { t } from '@lingui/macro' import { shortenTokenAddress } from '@/dex/utils' import { ChainId, CurveApi } from '@/dex/types/main.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' type NetworkWithFactory = { chainId: ChainId @@ -187,7 +187,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( let dismissNotificationHandler const notifyPendingMessage = t`Please confirm to deploy gauge for ${shortenAddress}.` - const { dismiss: dismissConfirm } = notifyNotification(notifyPendingMessage, 'pending') + const { dismiss: dismissConfirm } = notify(notifyPendingMessage, 'pending') dismissNotificationHandler = dismissConfirm @@ -213,7 +213,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -225,7 +225,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mainnet gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -250,7 +250,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -262,7 +262,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mainnet gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -287,7 +287,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -299,7 +299,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mainnet gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -324,7 +324,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -336,7 +336,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mainnet gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -360,7 +360,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -372,7 +372,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mainnet gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -406,7 +406,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying sidechain gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -420,7 +420,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Sidechain gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -444,7 +444,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying sidechain gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -458,7 +458,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Sidechain gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -482,7 +482,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying sidechain gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -496,7 +496,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Sidechain gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -520,7 +520,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying sidechain gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -534,7 +534,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Sidechain gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -558,7 +558,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying sidechain gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -572,7 +572,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Sidechain gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -609,7 +609,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying mirror gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -621,7 +621,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mirror gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -648,7 +648,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying mirror gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -660,7 +660,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mirror gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -687,7 +687,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying mirror gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -699,7 +699,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mirror gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -726,7 +726,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying mirror gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -738,7 +738,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mirror gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( @@ -762,7 +762,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissConfirm() const deployingNotificationMessage = t`Deploying mirror gauge for ${shortenAddress}...` - const { dismiss: dismissDeploying } = notifyNotification(deployingNotificationMessage, 'pending') + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') dismissNotificationHandler = dismissDeploying @@ -774,7 +774,7 @@ const createDeployGaugeSlice = (set: SetState, get: GetState) => ( ) dismissDeploying() const successNotificationMessage = t`Mirror gauge deployment successful.` - notifyNotification(successNotificationMessage, 'success', 15000) + notify(successNotificationMessage, 'success', 15000) } catch (error) { dismissNotificationHandler() set( diff --git a/apps/main/src/lend/components/PageLoanCreate/LoanFormCreate/index.tsx b/apps/main/src/lend/components/PageLoanCreate/LoanFormCreate/index.tsx index 7ea15de58..dc773f7d2 100644 --- a/apps/main/src/lend/components/PageLoanCreate/LoanFormCreate/index.tsx +++ b/apps/main/src/lend/components/PageLoanCreate/LoanFormCreate/index.tsx @@ -36,7 +36,7 @@ import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Api, HealthMode, PageContentProps } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const LoanCreate = ({ isLeverage = false, ...pageProps }: PageContentProps & { isLeverage?: boolean }) => { const { rChainId, rOwmId, isLoaded, api, market, userActiveKey } = pageProps @@ -102,7 +102,7 @@ const LoanCreate = ({ isLeverage = false, ...pageProps }: PageContentProps & { i maxSlippage: string, isLeverage: boolean, ) => { - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepCreate(payloadActiveKey, api, market, maxSlippage, formValues, isLeverage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && !resp.error) { @@ -172,7 +172,7 @@ const LoanCreate = ({ isLeverage = false, ...pageProps }: PageContentProps & { i onClick: async () => { const tokensMessage = getStepTokensStr(formValues, market).symbolList const notifyMessage = t`Please approve spending your ${tokensMessage}.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, api, market, maxSlippage, formValues, isLeverage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageLoanManage/LoanBorrowMore/index.tsx b/apps/main/src/lend/components/PageLoanManage/LoanBorrowMore/index.tsx index b1a753d8d..9314592b4 100644 --- a/apps/main/src/lend/components/PageLoanManage/LoanBorrowMore/index.tsx +++ b/apps/main/src/lend/components/PageLoanManage/LoanBorrowMore/index.tsx @@ -33,7 +33,7 @@ import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Api, HealthMode, PageContentProps } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const LoanBorrowMore = ({ rChainId, @@ -106,7 +106,7 @@ const LoanBorrowMore = ({ ) => { const { chainId } = api - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepIncrease(payloadActiveKey, api, market, formValues, maxSlippage, isLeverage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && !resp.error) { @@ -185,7 +185,7 @@ const LoanBorrowMore = ({ onClick: async () => { const tokensMessage = getStepTokensStr(formValues, market).symbolList const notifyMessage = t`Please approve spending of ${tokensMessage}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, api, market, formValues, maxSlippage, isLeverage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageLoanManage/LoanCollateralAdd/index.tsx b/apps/main/src/lend/components/PageLoanManage/LoanCollateralAdd/index.tsx index d2ccf2827..559fb8b68 100644 --- a/apps/main/src/lend/components/PageLoanManage/LoanCollateralAdd/index.tsx +++ b/apps/main/src/lend/components/PageLoanManage/LoanCollateralAdd/index.tsx @@ -26,7 +26,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import { Api, PageContentProps } from '@/lend/types/lend.types' const LoanCollateralAdd = ({ rChainId, rOwmId, api, isLoaded, market, userActiveKey }: PageContentProps) => { @@ -64,7 +64,7 @@ const LoanCollateralAdd = ({ rChainId, rOwmId, api, isLoaded, market, userActive async (payloadActiveKey: string, api: Api, market: OneWayMarketTemplate, formValues: FormValues) => { const { chainId } = api - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepIncrease(payloadActiveKey, api, market, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && !resp.error) { @@ -120,7 +120,7 @@ const LoanCollateralAdd = ({ rChainId, rOwmId, api, isLoaded, market, userActive content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${market.collateral_token.symbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, api, market, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageLoanManage/LoanCollateralRemove/index.tsx b/apps/main/src/lend/components/PageLoanManage/LoanCollateralRemove/index.tsx index cfd2bae64..5662aff24 100644 --- a/apps/main/src/lend/components/PageLoanManage/LoanCollateralRemove/index.tsx +++ b/apps/main/src/lend/components/PageLoanManage/LoanCollateralRemove/index.tsx @@ -27,7 +27,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import { Api, HealthMode, PageContentProps } from '@/lend/types/lend.types' const LoanCollateralRemove = ({ rChainId, rOwmId, isLoaded, api, market, userActiveKey }: PageContentProps) => { @@ -69,7 +69,7 @@ const LoanCollateralRemove = ({ rChainId, rOwmId, isLoaded, api, market, userAct const handleBtnClickRemove = useCallback( async (payloadActiveKey: string, api: Api, market: OneWayMarketTemplate, formValues: FormValues) => { - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepDecrease(payloadActiveKey, api, market, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && !resp.error) { diff --git a/apps/main/src/lend/components/PageLoanManage/LoanRepay/index.tsx b/apps/main/src/lend/components/PageLoanManage/LoanRepay/index.tsx index 2e8ff8025..0bac95c0b 100644 --- a/apps/main/src/lend/components/PageLoanManage/LoanRepay/index.tsx +++ b/apps/main/src/lend/components/PageLoanManage/LoanRepay/index.tsx @@ -36,7 +36,7 @@ import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Api, HealthMode, PageContentProps } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const LoanRepay = ({ rChainId, rOwmId, isLoaded, api, market, userActiveKey }: PageContentProps) => { const isSubscribed = useRef(false) @@ -94,7 +94,7 @@ const LoanRepay = ({ rChainId, rOwmId, isLoaded, api, market, userActiveKey }: P formValues: FormValues, maxSlippage: string, ) => { - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepRepay(payloadActiveKey, api, market, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey && !resp.error) { @@ -182,7 +182,7 @@ const LoanRepay = ({ rChainId, rOwmId, isLoaded, api, market, userActiveKey }: P onClick: async () => { const tokensMessage = getStepTokensStr(formValues, market).symbolList const notifyMessage = t`Please approve spending your ${tokensMessage}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, api, market, formValues, maxSlippage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageLoanManage/LoanSelfLiquidation/index.tsx b/apps/main/src/lend/components/PageLoanManage/LoanSelfLiquidation/index.tsx index b5673e60c..931c61daa 100644 --- a/apps/main/src/lend/components/PageLoanManage/LoanSelfLiquidation/index.tsx +++ b/apps/main/src/lend/components/PageLoanManage/LoanSelfLiquidation/index.tsx @@ -32,7 +32,7 @@ import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Api, PageContentProps, UserLoanState } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const LoanSelfLiquidation = ({ rChainId, rOwmId, isLoaded, api, market, userActiveKey }: PageContentProps) => { const isSubscribed = useRef(false) @@ -109,7 +109,7 @@ const LoanSelfLiquidation = ({ rChainId, rOwmId, isLoaded, api, market, userActi content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${market.borrowed_token.symbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(api, market, maxSlippage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() @@ -121,7 +121,7 @@ const LoanSelfLiquidation = ({ rChainId, rOwmId, isLoaded, api, market, userActi type: 'action', content: isComplete ? t`Self-liquidated` : t`Self-liquidate`, onClick: async () => { - const notify = notifyNotification(NOFITY_MESSAGE.pendingConfirm, 'pending') + const notify = notify(NOFITY_MESSAGE.pendingConfirm, 'pending') const resp = await fetchStepLiquidate(api, market, liquidationAmt, maxSlippage) if (isSubscribed.current && resp && resp.hash && !resp.loanExists && !resp.error) { diff --git a/apps/main/src/lend/components/PageVault/VaultClaim/index.tsx b/apps/main/src/lend/components/PageVault/VaultClaim/index.tsx index 21c36f68b..e8be1f482 100644 --- a/apps/main/src/lend/components/PageVault/VaultClaim/index.tsx +++ b/apps/main/src/lend/components/PageVault/VaultClaim/index.tsx @@ -22,7 +22,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { Api, MarketClaimable, PageContentProps } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const VaultClaim = ({ isLoaded, api, market, userActiveKey }: PageContentProps) => { const isSubscribed = useRef(false) @@ -64,7 +64,7 @@ const VaultClaim = ({ isLoaded, api, market, userActiveKey }: PageContentProps) const amount = type === 'crv' ? `${crv} CRV` : _getRewardsAmount(rewards) const notifyMessage = t`claim rewards ${amount}` - const notify = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const notify = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar(Pending {notifyMessage}) const resp = await fetchStepClaim(payloadActiveKey, api, market, type) diff --git a/apps/main/src/lend/components/PageVault/VaultDepositMint/index.tsx b/apps/main/src/lend/components/PageVault/VaultDepositMint/index.tsx index 8d603175f..54525071e 100644 --- a/apps/main/src/lend/components/PageVault/VaultDepositMint/index.tsx +++ b/apps/main/src/lend/components/PageVault/VaultDepositMint/index.tsx @@ -1,4 +1,4 @@ -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import type { FormStatus, FormValues, StepKey } from '@/lend/components/PageVault/VaultDepositMint/types' import type { Step } from '@ui/Stepper/types' import React, { useCallback, useEffect, useRef, useState } from 'react' @@ -79,7 +79,7 @@ const VaultDepositMint = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, const { amount } = formValues const notifyMessage = t`deposit ${amount} ${borrowed_token?.symbol}` - const notify = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const notify = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar(Pending {notifyMessage}) const resp = await fetchStepDepositMint(payloadActiveKey, rFormType, api, market, formValues) @@ -124,7 +124,7 @@ const VaultDepositMint = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${symbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, rFormType, api, market, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageVault/VaultStake/index.tsx b/apps/main/src/lend/components/PageVault/VaultStake/index.tsx index 67754305e..f484baaf9 100644 --- a/apps/main/src/lend/components/PageVault/VaultStake/index.tsx +++ b/apps/main/src/lend/components/PageVault/VaultStake/index.tsx @@ -1,4 +1,4 @@ -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import type { FormStatus, FormValues, StepKey } from '@/lend/components/PageVault/VaultStake/types' import type { Step } from '@ui/Stepper/types' import React, { useCallback, useEffect, useRef, useState } from 'react' @@ -71,7 +71,7 @@ const VaultStake = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, userAc const { amount } = formValues const notifyMessage = t`stake ${amount} vault shares` - const notify = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const notify = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar(Pending {notifyMessage}) const resp = await fetchStepStake(payloadActiveKey, rFormType, api, market, formValues) @@ -111,7 +111,7 @@ const VaultStake = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, userAc content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of vault shares` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, rFormType, api, market, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/lend/components/PageVault/VaultUnstake/index.tsx b/apps/main/src/lend/components/PageVault/VaultUnstake/index.tsx index 02c6ee673..6400a05fd 100644 --- a/apps/main/src/lend/components/PageVault/VaultUnstake/index.tsx +++ b/apps/main/src/lend/components/PageVault/VaultUnstake/index.tsx @@ -19,7 +19,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { OneWayMarketTemplate } from '@curvefi/lending-api/lib/markets' import { Api, PageContentProps } from '@/lend/types/lend.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const VaultUnstake = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, userActiveKey }: PageContentProps) => { const isSubscribed = useRef(false) @@ -69,7 +69,7 @@ const VaultUnstake = ({ rChainId, rOwmId, rFormType, isLoaded, api, market, user const { amount } = formValues const notifyMessage = t`unstake ${amount} vault shares` - const notify = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const notify = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar(Pending {notifyMessage}) const resp = await fetchStepUnstake(payloadActiveKey, rFormType, api, market, formValues) diff --git a/apps/main/src/lend/components/PageVault/VaultWithdrawRedeem/index.tsx b/apps/main/src/lend/components/PageVault/VaultWithdrawRedeem/index.tsx index b7bfd2a1f..4a8e3c6c4 100644 --- a/apps/main/src/lend/components/PageVault/VaultWithdrawRedeem/index.tsx +++ b/apps/main/src/lend/components/PageVault/VaultWithdrawRedeem/index.tsx @@ -1,4 +1,4 @@ -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import type { FormStatus, FormValues, StepKey } from '@/lend/components/PageVault/VaultWithdrawRedeem/types' import type { Step } from '@ui/Stepper/types' import React, { useCallback, useEffect, useRef, useState } from 'react' @@ -99,7 +99,7 @@ const VaultWithdrawRedeem = ({ notifyMessage = t`a full withdraw of ${vaultShares} vault shares` } - const notify = notifyNotification(`Please confirm ${notifyMessage}`, 'pending') + const notify = notify(`Please confirm ${notifyMessage}`, 'pending') setTxInfoBar({`Pending ${notifyMessage}`}) const resp = await fetchStepWithdrawRedeem(payloadActiveKey, rFormType, api, market, formValues, vaultShares) diff --git a/apps/main/src/loan/components/PageLoanCreate/LoanFormCreate/index.tsx b/apps/main/src/loan/components/PageLoanCreate/LoanFormCreate/index.tsx index 1c74d6743..25110f486 100644 --- a/apps/main/src/loan/components/PageLoanCreate/LoanFormCreate/index.tsx +++ b/apps/main/src/loan/components/PageLoanCreate/LoanFormCreate/index.tsx @@ -29,7 +29,7 @@ import TxInfoBar from '@ui/TxInfoBar' import DialogHealthLeverageWarning from '@/loan/components/PageLoanCreate/LoanFormCreate/components/DialogHealthLeverageWarning' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { CollateralAlert, Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' const LoanCreate = ({ collateralAlert, @@ -119,7 +119,7 @@ const LoanCreate = ({ maxSlippage: string, ) => { const notifyMessage = t`Please confirm deposit of ${formValues.collateral} ${llamma.collateralSymbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepCreate(payloadActiveKey, curve, isLeverage, llamma, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { @@ -161,7 +161,7 @@ const LoanCreate = ({ content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending your ${llamma.collateralSymbol}.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, curve, isLeverage, llamma, formValues, maxSlippage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/loan/components/PageLoanManage/CollateralDecrease/index.tsx b/apps/main/src/loan/components/PageLoanManage/CollateralDecrease/index.tsx index 50b403eab..0255deedf 100644 --- a/apps/main/src/loan/components/PageLoanManage/CollateralDecrease/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/CollateralDecrease/index.tsx @@ -27,7 +27,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' interface Props extends Pick {} @@ -95,7 +95,7 @@ const CollateralDecrease = ({ curve, llamma, llammaId, rChainId }: Props) => { const handleBtnClickRemove = useCallback( async (payloadActiveKey: string, curve: Curve, llamma: Llamma, formValues: FormValues) => { const notifyMessage = t`Please confirm removal of ${formValues.collateral} ${llamma.collateralSymbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepDecrease(payloadActiveKey, curve, llamma, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/loan/components/PageLoanManage/CollateralIncrease/index.tsx b/apps/main/src/loan/components/PageLoanManage/CollateralIncrease/index.tsx index e1cfdf340..346cac01f 100644 --- a/apps/main/src/loan/components/PageLoanManage/CollateralIncrease/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/CollateralIncrease/index.tsx @@ -28,7 +28,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' interface Props extends Pick {} @@ -99,7 +99,7 @@ const CollateralIncrease = ({ curve, isReady, llamma, llammaId }: Props) => { async (payloadActiveKey: string, curve: Curve, llamma: Llamma, formValues: FormValues) => { const chainId = curve.chainId const notifyMessage = t`Please confirm depositing ${formValues.collateral} ${llamma.collateralSymbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepIncrease(payloadActiveKey, curve, llamma, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { @@ -140,7 +140,7 @@ const CollateralIncrease = ({ curve, isReady, llamma, llammaId }: Props) => { content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${llamma.collateralSymbol}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, curve, llamma, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/loan/components/PageLoanManage/LoanDecrease/index.tsx b/apps/main/src/loan/components/PageLoanManage/LoanDecrease/index.tsx index 540423aa4..9e37c6c9f 100644 --- a/apps/main/src/loan/components/PageLoanManage/LoanDecrease/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/LoanDecrease/index.tsx @@ -29,7 +29,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' interface Props extends Pick {} @@ -109,7 +109,7 @@ const LoanDecrease = ({ curve, llamma, llammaId, params, rChainId }: Props) => { const notifyMessage = isFullRepay ? t`Please approve full repay.` : t`Please approve a repayment of ${debt} ${getTokenName(llamma).stablecoin}.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepDecrease(payloadActiveKey, curve, llamma, formValues) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { @@ -159,7 +159,7 @@ const LoanDecrease = ({ curve, llamma, llammaId, params, rChainId }: Props) => { content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending your ${getTokenName(llamma).stablecoin}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, curve, llamma, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/loan/components/PageLoanManage/LoanDeleverage/index.tsx b/apps/main/src/loan/components/PageLoanManage/LoanDeleverage/index.tsx index 16cbe4247..26c13326e 100644 --- a/apps/main/src/loan/components/PageLoanManage/LoanDeleverage/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/LoanDeleverage/index.tsx @@ -45,7 +45,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' // Loan Deleverage const LoanDeleverage = ({ @@ -109,7 +109,7 @@ const LoanDeleverage = ({ const fTokenName = `${collateral} ${collateralName}` const notifyMessage = t`Please approve deleverage with ${fTokenName} at ${maxSlippage}% max slippage.` - const { dismiss } = notifyNotification(notifyMessage, 'pending') + const { dismiss } = notify(notifyMessage, 'pending') const resp = await fetchStepRepay(payloadActiveKey, curve, llamma, formValues, maxSlippage) if (isSubscribed.current && resp && resp.hash && resp.activeKey === activeKey) { diff --git a/apps/main/src/loan/components/PageLoanManage/LoanIncrease/index.tsx b/apps/main/src/loan/components/PageLoanManage/LoanIncrease/index.tsx index 4bb0fe0e6..b1a28a972 100644 --- a/apps/main/src/loan/components/PageLoanManage/LoanIncrease/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/LoanIncrease/index.tsx @@ -34,7 +34,7 @@ import TxInfoBar from '@ui/TxInfoBar' import AlertFormError from '@/loan/components/AlertFormError' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' interface Props extends Pick {} @@ -120,7 +120,7 @@ const LoanIncrease = ({ curve, isReady, llamma, llammaId }: Props) => { } ${llamma.collateralSymbol}.` : t`Please confirm borrowing of ${formValues.debt} ${getTokenName(llamma).stablecoin}.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepIncrease(payloadActiveKey, curve, llamma, formValues) @@ -163,7 +163,7 @@ const LoanIncrease = ({ curve, isReady, llamma, llammaId }: Props) => { content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${formValues.collateral}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(payloadActiveKey, curve, llamma, formValues) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/loan/components/PageLoanManage/LoanLiquidate/index.tsx b/apps/main/src/loan/components/PageLoanManage/LoanLiquidate/index.tsx index cb444f030..8a34ae683 100644 --- a/apps/main/src/loan/components/PageLoanManage/LoanLiquidate/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/LoanLiquidate/index.tsx @@ -25,7 +25,7 @@ import Stepper from '@ui/Stepper' import TxInfoBar from '@ui/TxInfoBar' import { useUserProfileStore } from '@ui-kit/features/user-profile' import { Curve, Llamma, UserWalletBalances } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' interface Props extends Pick {} @@ -101,7 +101,7 @@ const LoanLiquidate = ({ curve, llamma, llammaId, params, rChainId }: Props) => content: isApproved ? t`Spending Approved` : t`Approve Spending`, onClick: async () => { const notifyMessage = t`Please approve spending of ${getTokenName(llamma).stablecoin}` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(curve, llamma, maxSlippage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() @@ -115,7 +115,7 @@ const LoanLiquidate = ({ curve, llamma, llammaId, params, rChainId }: Props) => onClick: async () => { const stablecoinName = getTokenName(llamma).stablecoin const notifyMessage = t`Please confirm ${stablecoinName} self-liquidation at max ${maxSlippage}% slippage.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepLiquidate(curve, llamma, liquidationAmt, maxSlippage) diff --git a/apps/main/src/loan/components/PageLoanManage/LoanSwap/index.tsx b/apps/main/src/loan/components/PageLoanManage/LoanSwap/index.tsx index da1e77006..e1a5cd9b6 100644 --- a/apps/main/src/loan/components/PageLoanManage/LoanSwap/index.tsx +++ b/apps/main/src/loan/components/PageLoanManage/LoanSwap/index.tsx @@ -1,7 +1,7 @@ import type { FormStatus, FormValues, StepKey } from '@/loan/components/PageLoanManage/LoanSwap/types' import type { FormEstGas, PageLoanManageProps } from '@/loan/components/PageLoanManage/types' import type { Step } from '@ui/Stepper/types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' import { t } from '@lingui/macro' import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { DEFAULT_DETAIL_INFO, DEFAULT_FORM_STATUS, DEFAULT_FORM_VALUES } from '@/loan/store/createLoanSwap' @@ -111,7 +111,7 @@ const Swap = ({ curve, llamma, llammaId, rChainId }: Props) => { const { item1Name } = getItemsName(llamma, formValues) const swapAmount = formValues.item1 === '' ? detailInfo.amount : formValues.item1 const notifyMessage = t`Please confirm swapping ${swapAmount} ${item1Name} at max ${maxSlippage} slippage.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchStepSwap( payloadActiveKey, @@ -163,7 +163,7 @@ const Swap = ({ curve, llamma, llammaId, rChainId }: Props) => { const { item1Name } = getItemsName(llamma, formValues) const swapAmount = formValues.item1 === '' ? detailInfo.amount : formValues.item1 const notifyMessage = t`Please approve spending your ${item1Name}.` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') await fetchStepApprove(activeKey, curve, llamma, { ...formValues, item1: swapAmount }, maxSlippage) if (notify && typeof notify.dismiss === 'function') notify.dismiss() diff --git a/apps/main/src/loan/components/PagePegKeepers/components/PegKeeperForm.tsx b/apps/main/src/loan/components/PagePegKeepers/components/PegKeeperForm.tsx index 4b9d4fb7d..efaa2c6b3 100644 --- a/apps/main/src/loan/components/PagePegKeepers/components/PegKeeperForm.tsx +++ b/apps/main/src/loan/components/PagePegKeepers/components/PegKeeperForm.tsx @@ -11,7 +11,7 @@ import IconTooltip from '@ui/Tooltip/TooltipIcon' import LoanFormConnect from '@/loan/components/LoanFormConnect' import TxInfoBar from '@ui/TxInfoBar' import { ChainId, Curve } from '@/loan/types/loan.types' -import { notify as notifyNotification } from '@ui-kit/features/connect-wallet' +import { notify } from '@ui-kit/features/connect-wallet' type Props = { rChainId: ChainId @@ -36,7 +36,7 @@ const PegKeeperForm = ({ rChainId, poolName, pegKeeperAddress }: Props) => { setTxInfoBar(null) const notifyMessage = t`Please confirm update ${poolName} pool` - const notify = notifyNotification(notifyMessage, 'pending') + const notify = notify(notifyMessage, 'pending') const resp = await fetchUpdate(curve, pegKeeperAddress) if (isSubscribed.current && resp) {