From e0f833835282537275d73c1f151f16a7f69dfc9e Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Sat, 14 Sep 2024 11:38:30 -0400 Subject: [PATCH] Update redemption content --- .../Lend/addRedemptionV2/2-ChooseAmount.tsx | 7 ++++++- .../src/components/Lend/supplyV2/6-Success.tsx | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/huma-widget/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx b/packages/huma-widget/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx index 94fd6c0..514dd43 100644 --- a/packages/huma-widget/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx +++ b/packages/huma-widget/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx @@ -68,13 +68,18 @@ export function ChooseAmount({ lpConfig.withdrawalLockoutPeriodInDays * SECONDS_IN_A_DAY if (nextEpochStartTime < lockupEndTime) { const lockupEndTimeDayjs = dayjs.unix(lockupEndTime).date(1) + const withdrawTime = lockupEndTimeDayjs.add(1, 'month') dispatch(setStep(WIDGET_STEP.Error)) dispatch( setError({ errorReason: 'Redemption too soon', errorMessage: `Your last deposit was on ${timestampToLL( depositRecord!.lastDepositTime.toNumber(), - )}. You can redeem on ${timestampToLL(lockupEndTimeDayjs.unix())}.`, + )}. You can begin submitting redemption requests on ${timestampToLL( + lockupEndTimeDayjs.unix(), + )}, which can be redeemed starting ${timestampToLL( + withdrawTime.unix(), + )}.`, }), ) } diff --git a/packages/huma-widget/src/components/Lend/supplyV2/6-Success.tsx b/packages/huma-widget/src/components/Lend/supplyV2/6-Success.tsx index 522b43d..7a8ba4a 100644 --- a/packages/huma-widget/src/components/Lend/supplyV2/6-Success.tsx +++ b/packages/huma-widget/src/components/Lend/supplyV2/6-Success.tsx @@ -9,10 +9,10 @@ import { import { sendTxAtom } from '@huma-finance/web-shared' import { useWeb3React } from '@web3-react/core' import { useAtom } from 'jotai' -import moment from 'moment' import React, { useCallback, useEffect, useState } from 'react' import { useDispatch } from 'react-redux' +import dayjs from 'dayjs' import { Campaign } from '.' import { useDoesChainSupportNotifi, @@ -90,14 +90,16 @@ export function Success({ ] const getSubContent = () => { - const currentTime = moment().add( - lpConfig.withdrawalLockoutPeriodInDays, - 'days', - ) + const redemptionTime = dayjs() + .add(lpConfig.withdrawalLockoutPeriodInDays, 'day') + .date(1) + const withdrawTime = redemptionTime.add(1, 'month') return [ - `First redemption date: ${timeUtil.timestampToLL( - currentTime.unix(), - )}. You can redeem end of each month after.`, + `You can begin submitting redemption requests on ${timeUtil.timestampToLL( + redemptionTime.unix(), + )}, which can be redeemed starting ${timeUtil.timestampToLL( + withdrawTime.unix(), + )}.`, ] }