diff --git a/src/pages/DexV2/Lock/components/DurationSlider.tsx b/src/pages/DexV2/Lock/components/DurationSlider.tsx index 6757f0a96..173529686 100644 --- a/src/pages/DexV2/Lock/components/DurationSlider.tsx +++ b/src/pages/DexV2/Lock/components/DurationSlider.tsx @@ -3,10 +3,12 @@ import { Box, Flex } from "rebass" import styled from "styled-components" import { TYPE } from "theme" import { useLock } from "../LockProvider" -import { WEEK } from "../constants" +import { FOUR_YEARS_IN_SECONDS, WEEK } from "../constants" +import { formatAmount } from "utils/formatCurrencyAmount" const DurationSlider: React.FC = () => { const { + userInput, duration, setDuration, } = useLock() @@ -33,12 +35,14 @@ const DurationSlider: React.FC = () => { }, ] const weekToShow = Math.round(duration / WEEK) + const durationLabel = `${weekToShow} ${weekToShow > 1 ? 'weeks' : 'week'}` + const votingPower = +userInput * duration / FOUR_YEARS_IN_SECONDS return ( Lock Time - {weekToShow} {weekToShow > 1 ? 'weeks' : 'week'} + {durationLabel} { ))} + + + + Locking for {durationLabel} for {formatAmount(votingPower, 2)} veIXS voting power. + + ) } diff --git a/src/pages/DexV2/Lock/components/LockContent.tsx b/src/pages/DexV2/Lock/components/LockContent.tsx index 811dd981b..2b5767737 100644 --- a/src/pages/DexV2/Lock/components/LockContent.tsx +++ b/src/pages/DexV2/Lock/components/LockContent.tsx @@ -33,7 +33,7 @@ const LockContent: React.FC = () => { const votingEscrowContract = useVotingEscrowContract() const addTransaction = useTransactionAdder() - const [approvalState, approve, refreshAllowance] = useAllowance( + const [approvalState, approve] = useAllowance( IXS_ADDRESS[chainId], utils.parseUnits(userInput || '0', currency?.decimals), VOTING_ESCROW_ADDRESS[chainId] diff --git a/src/pages/DexV2/Lock/constants/index.ts b/src/pages/DexV2/Lock/constants/index.ts index 820788371..a329d15dd 100644 --- a/src/pages/DexV2/Lock/constants/index.ts +++ b/src/pages/DexV2/Lock/constants/index.ts @@ -1,2 +1,3 @@ -export const WEEK = 604800 \ No newline at end of file +export const WEEK = 604800 +export const FOUR_YEARS_IN_SECONDS = 126230400 \ No newline at end of file