Skip to content

Commit

Permalink
Update asset value tooltip precision for #344 (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulBit authored Feb 4, 2021
1 parent b2ce20f commit 6d7f671
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
faLongArrowAltUp,
faLongArrowAltDown,
} from '@fortawesome/free-solid-svg-icons';
import { weiTo18 } from '../../../../../utils/blockchain/math-helpers';
import { useTranslation } from 'react-i18next';
import { translations } from '../../../../../locales/i18n';
import { LoadableValue } from '../../../LoadableValue';
Expand Down Expand Up @@ -146,7 +147,7 @@ export function ActiveLoanTableDesktop(props: Props) {
{item.currency}
</>
}
tooltip={item.positionSize}
tooltip={weiTo18(item.positionSize)}
/>
</td>
<td>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/AssetWalletBalance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Asset } from 'types/asset';
import { weiToFixed } from 'utils/blockchain/math-helpers';
import { weiTo18, weiToFixed } from 'utils/blockchain/math-helpers';
import { useAssetBalanceOf } from 'app/hooks/useAssetBalanceOf';
import { useIsConnected } from 'app/hooks/useAccount';
import { translations } from 'locales/i18n';
Expand Down Expand Up @@ -41,7 +41,7 @@ export function AssetWalletBalance(props: Props) {
<LoadableValue
value={weiToFixed(value, 4)}
loading={loading}
tooltip={<>{value}</>}
tooltip={<>{weiTo18(value)}</>}
/>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Text } from '@blueprintjs/core';
import { LoadableValue } from '../../components/LoadableValue';
import { weiTo4 } from '../../../utils/blockchain/math-helpers';
import { weiTo4, weiTo18 } from '../../../utils/blockchain/math-helpers';
import { translations } from '../../../locales/i18n';
import { useExpectedPoolTokens } from '../../hooks/amm/useExpectedPoolTokens';
import { Asset } from '../../../types/asset';
Expand All @@ -28,7 +28,7 @@ export function ExpectedPoolTokens({ pool, asset, amount }: Props) {
{weiTo4(expectedPoolTokens.value)}
</Text>
}
tooltip={expectedPoolTokens.value}
tooltip={weiTo18(expectedPoolTokens.value)}
/>
</div>
<div className="small">{t(translations.liquidity.token)}</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/containers/LiquidityRemoveContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function LiquidityRemoveContainer(props: Props) {
{weiTo4(targetValue[0])} {sourceToken}
</Text>
}
tooltip={targetValue[0]}
tooltip={weiTo18(targetValue[0])}
/>
</div>
<div className="small">
Expand All @@ -153,7 +153,7 @@ export function LiquidityRemoveContainer(props: Props) {
{weiTo4(targetValue[1])} {sourceToken}
</Text>
}
tooltip={targetValue[1]}
tooltip={weiTo18(targetValue[1])}
/>
</div>
<div className="small">{t(translations.liquidity.fee)}</div>
Expand Down
8 changes: 2 additions & 6 deletions src/app/containers/RepayPositionHandler/RepayPositionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ import { TradeButton } from '../../components/TradeButton';
import { AssetWalletBalance } from '../../components/AssetWalletBalance';
import { AssetsDictionary } from '../../../utils/dictionaries/assets-dictionary';
import { useAssetBalanceOf } from '../../hooks/useAssetBalanceOf';
import {
normalizeWei,
weiTo18,
weiTo4,
} from '../../../utils/blockchain/math-helpers';
import { weiTo4, weiTo18 } from '../../../utils/blockchain/math-helpers';
import { DummyField } from '../../components/DummyField';
import { useApproveAndCloseWithDeposit } from '../../hooks/trading/useApproveAndCloseWithDeposit';
import { LoadableValue } from '../../components/LoadableValue';
Expand Down Expand Up @@ -111,7 +107,7 @@ export function RepayPositionForm({ loan }: Props) {
<LoadableValue
loading={false}
value={weiTo4(receiveAmount)}
tooltip={<>{normalizeWei(receiveAmount)}</>}
tooltip={<>{weiTo18(receiveAmount)}</>}
/>{' '}
{collateralAsset}
</small>
Expand Down

0 comments on commit 6d7f671

Please sign in to comment.