diff --git a/src/custom/pages/Claim/ClaimsTable.tsx b/src/custom/pages/Claim/ClaimsTable.tsx
index c4e3f8c4e..412772293 100644
--- a/src/custom/pages/Claim/ClaimsTable.tsx
+++ b/src/custom/pages/Claim/ClaimsTable.tsx
@@ -4,7 +4,7 @@ import { ClaimTable, ClaimBreakdown, TokenLogo } from 'pages/Claim/styled'
import CowProtocolLogo from 'components/CowProtocolLogo'
import { ClaimStatus } from 'state/claim/actions'
// import { UserClaimDataDetails } from './types' TODO: fix in another PR
-import { formatSmartLocaleAware } from 'utils/format'
+import { formatMax, formatSmartLocaleAware } from 'utils/format'
import { EnhancedUserClaimData } from './types'
import { useAllClaimingTransactionIndices } from 'state/enhancedTransactions/hooks'
import { useUserEnhancedClaimData } from 'state/claim/hooks'
@@ -85,22 +85,27 @@ const ClaimsTableRow = ({
{!isFree && with {currencyAmount?.currency?.symbol}}
- {formatSmartLocaleAware(claimAmount, AMOUNT_PRECISION) || 0} vCOW |
+
+ {formatSmartLocaleAware(claimAmount, AMOUNT_PRECISION) || 0} vCOW
+ |
{!isFree ||
(price && (
- Price: {`${formatSmartLocaleAware(price) || 0} vCOW per ${currencyAmount?.currency?.symbol}`}
+ Price:{' '}
+ {`${formatSmartLocaleAware(price) || 0} vCOW per ${
+ currencyAmount?.currency?.symbol
+ }`}
))}
Cost:{' '}
-
+
{' '}
{isFree ? (
Free!
) : (
- `${formatSmartLocaleAware(cost, AMOUNT_PRECISION) || 0} ${currencyAmount?.currency?.symbol}`
+ `${formatSmartLocaleAware(cost, AMOUNT_PRECISION) || 0} ${cost?.currency?.symbol}`
)}
diff --git a/src/custom/pages/Claim/InvestmentFlow/InvestOption.tsx b/src/custom/pages/Claim/InvestmentFlow/InvestOption.tsx
index acfe1df63..ba3385a7a 100644
--- a/src/custom/pages/Claim/InvestmentFlow/InvestOption.tsx
+++ b/src/custom/pages/Claim/InvestmentFlow/InvestOption.tsx
@@ -4,7 +4,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import CowProtocolLogo from 'components/CowProtocolLogo'
import { InvestTokenGroup, TokenLogo, InvestSummary, InvestInput, InvestAvailableBar, UnderlineButton } from '../styled'
-import { formatSmartLocaleAware } from 'utils/format'
+import { formatMax, formatSmartLocaleAware } from 'utils/format'
import Row from 'components/Row'
import CheckCircle from 'assets/cow-swap/check.svg'
import { InvestmentFlowProps } from '.'
@@ -163,7 +163,7 @@ export default function InvestOption({ claim, optionIndex, openModal, closeModal
} finally {
setApproving(false)
}
- }, [handleCloseError, handleSetError, revokeApprovalCallback, token?.symbol])
+ }, [handleCloseError, handleSetError, revokeApprovalCallback, token?.symbol])
*/
const vCowAmount = useMemo(
@@ -270,15 +270,15 @@ export default function InvestOption({ claim, optionIndex, openModal, closeModal
Price{' '}
-
+
{formatSmartLocaleAware(price) || '0'} vCOW per {currencyAmount?.currency?.symbol}
Max. investment available{' '}
-
- {formatSmartLocaleAware(maxCost, AMOUNT_PRECISION) || '0'} {currencyAmount?.currency?.symbol}
+
+ {formatSmartLocaleAware(maxCost, AMOUNT_PRECISION) || '0'} {maxCost?.currency?.symbol}
@@ -320,7 +320,7 @@ export default function InvestOption({ claim, optionIndex, openModal, closeModal
)}
)}
- {/*
+ {/*
// CURRENTLY TEST ONLY
approveState === ApprovalState.APPROVED && (
@@ -343,8 +343,8 @@ export default function InvestOption({ claim, optionIndex, openModal, closeModal
- Receive: {formatSmartLocaleAware(vCowAmount, AMOUNT_PRECISION) || 0} vCOW
+
+ Receive: {formatSmartLocaleAware(vCowAmount, AMOUNT_PRECISION) || 0} vCOW
+
{/* Insufficient balance validation error */}
{inputError && {inputError}}
{inputWarning && {inputWarning}}
diff --git a/src/custom/pages/Claim/InvestmentFlow/InvestSummaryRow.tsx b/src/custom/pages/Claim/InvestmentFlow/InvestSummaryRow.tsx
index 57255fcbf..21fb641dc 100644
--- a/src/custom/pages/Claim/InvestmentFlow/InvestSummaryRow.tsx
+++ b/src/custom/pages/Claim/InvestmentFlow/InvestSummaryRow.tsx
@@ -3,7 +3,7 @@ import { calculatePercentage } from 'state/claim/hooks/utils'
import { TokenLogo, InvestAvailableBar } from 'pages/Claim/styled'
import { ClaimWithInvestmentData } from 'pages/Claim/types'
import CowProtocolLogo from 'components/CowProtocolLogo'
-import { formatSmartLocaleAware } from 'utils/format'
+import { formatMax, formatSmartLocaleAware } from 'utils/format'
import { ONE_HUNDRED_PERCENT } from 'constants/misc'
import { AMOUNT_PRECISION } from 'constants/index'
@@ -17,6 +17,9 @@ export function InvestSummaryRow(props: Props): JSX.Element | null {
const symbol = isFree ? '' : (currencyAmount?.currency?.symbol as string)
const formattedCost = formatSmartLocaleAware(investmentCost, AMOUNT_PRECISION) || '0'
+ const formattedCostMaxPrecision = investmentCost
+ ? `${formatMax(investmentCost, currencyAmount?.currency?.decimals)} ${symbol}`
+ : ''
const percentage = investmentCost && cost && calculatePercentage(investmentCost, cost)
@@ -43,12 +46,14 @@ export function InvestSummaryRow(props: Props): JSX.Element | null {
|
- {formatSmartLocaleAware(vCowAmount, AMOUNT_PRECISION) || '0'} vCOW
+
+ {formatSmartLocaleAware(vCowAmount, AMOUNT_PRECISION) || '0'} vCOW
+
{!isFree && (
Investment amount:{' '}
-
+
{formattedCost} {symbol}
@@ -65,13 +70,13 @@ export function InvestSummaryRow(props: Props): JSX.Element | null {
{!isFree && (
Price:{' '}
-
+
{formatSmartLocaleAware(price) || '0'} vCOW per {symbol}
)}
- Cost: {isFree ? 'Free!' : `${formattedCost} ${symbol}`}
+ Cost: {isFree ? 'Free!' : `${formattedCost} ${symbol}`}
Vesting:
diff --git a/src/custom/state/claim/hooks/index.ts b/src/custom/state/claim/hooks/index.ts
index c55782caf..a88beb543 100644
--- a/src/custom/state/claim/hooks/index.ts
+++ b/src/custom/state/claim/hooks/index.ts
@@ -560,7 +560,7 @@ export function useClaimCallback(account: string | null | undefined): {
summary: `Claim ${formattedVCowAmount} vCOW`,
claim: { recipient: account, indices: args[0] as number[] },
})
- return formattedVCowAmount
+ return vCowAmount.quotient.toString()
})
},
[account, addTransaction, chainId, connectedAccount, estimateGasCallback, getClaimArgs, vCowContract, vCowToken]
|