From 5aff6db9e7010d31899a6d5b11a1b206cf7dd6c3 Mon Sep 17 00:00:00 2001 From: Onno Visser Date: Tue, 3 Aug 2021 16:05:03 +0200 Subject: [PATCH 01/11] add underlines to tooltips --- tinlake-ui/components/Header/index.tsx | 6 +- .../components/Overview/OverviewHeader.tsx | 68 ++++++++------- tinlake-ui/components/PoolsMetrics/index.tsx | 31 +++---- tinlake-ui/components/Tooltip/index.tsx | 84 +++++++++++-------- tinlake-ui/containers/ClaimRewards/index.tsx | 4 +- .../Investment/View/EpochOverview.tsx | 42 +++++++--- .../Investment/View/InvestmentOverview.tsx | 35 +++++--- tinlake-ui/containers/Portfolio/index.tsx | 6 +- .../containers/SetCentAccount/index.tsx | 4 +- 9 files changed, 171 insertions(+), 109 deletions(-) diff --git a/tinlake-ui/components/Header/index.tsx b/tinlake-ui/components/Header/index.tsx index 55a1ab5731..677696a0e4 100644 --- a/tinlake-ui/components/Header/index.tsx +++ b/tinlake-ui/components/Header/index.tsx @@ -1,4 +1,3 @@ -import { Tooltip as AxisTooltip } from '@centrifuge/axis-tooltip' import { baseToDisplay } from '@centrifuge/tinlake-js' import { Box, Button, Layer } from 'grommet' import { Close as CloseIcon, Menu as MenuIcon } from 'grommet-icons' @@ -19,6 +18,7 @@ import { getAddressLink } from '../../utils/etherscanLinkGenerator' import { toDynamicPrecision } from '../../utils/toDynamicPrecision' import { useCFGRewards } from '../../utils/useCFGRewards' import { useQueryDebugEthAddress } from '../../utils/useQueryDebugEthAddress' +import { Tooltip } from '../Tooltip' import { Web3Wallet } from '../Web3Wallet' const { isDemo } = config @@ -159,11 +159,11 @@ const Header: React.FC = (props: Props) => { - {rewardsLink} + {rewardsLink} {address && ( - {portfolioLink} + {portfolioLink} )} diff --git a/tinlake-ui/components/Overview/OverviewHeader.tsx b/tinlake-ui/components/Overview/OverviewHeader.tsx index 3fbc1db4d9..8ff556af25 100644 --- a/tinlake-ui/components/Overview/OverviewHeader.tsx +++ b/tinlake-ui/components/Overview/OverviewHeader.tsx @@ -116,37 +116,43 @@ const OverviewHeader: React.FC = (props: Props) => { {props.selectedPool.metadata.asset} Asset type - - - {props.selectedPool.metadata.assetMaturity} - Asset maturity - - - - - - - {toPrecision(feeToInterestRate(dropRate || '0'), 2)} - % - - DROP APR - - - - - - - {addThousandsSeparators( - toPrecision( - baseToDisplay((poolData?.netAssetValue || new BN(0)).add(poolData?.reserve || new BN(0)), 18), - 0 - ) - )} - {props.selectedPool.metadata.currencySymbol} - - Pool Value - - + + {props.selectedPool.metadata.assetMaturity} + + + Asset maturity + + + + + + + {toPrecision(feeToInterestRate(dropRate || '0'), 2)} + % + + + + DROP APR + + + + + + + {addThousandsSeparators( + toPrecision( + baseToDisplay((poolData?.netAssetValue || new BN(0)).add(poolData?.reserve || new BN(0)), 18), + 0 + ) + )} + {props.selectedPool.metadata.currencySymbol} + + + + Pool Value + + + {'addresses' in props.selectedPool && config.featureFlagNewOnboardingPools.includes(props.selectedPool.addresses.ROOT_CONTRACT) ? ( diff --git a/tinlake-ui/components/PoolsMetrics/index.tsx b/tinlake-ui/components/PoolsMetrics/index.tsx index 80a27300f7..76c936cb37 100644 --- a/tinlake-ui/components/PoolsMetrics/index.tsx +++ b/tinlake-ui/components/PoolsMetrics/index.tsx @@ -1,16 +1,16 @@ -import { Tooltip as AxisTooltip } from '@centrifuge/axis-tooltip' import { baseToDisplay, ITinlake } from '@centrifuge/tinlake-js' import { Box, Button } from 'grommet' import { useRouter } from 'next/router' import * as React from 'react' import { useDispatch, useSelector } from 'react-redux' -import { Area, AreaChart, ResponsiveContainer, Tooltip, YAxis } from 'recharts' +import { Area, AreaChart, ResponsiveContainer, Tooltip as ChartTooltip, YAxis } from 'recharts' import { PoolsDailyData, PoolsData } from '../../ducks/pools' import { maybeLoadRewards } from '../../ducks/rewards' import { getWCFGPrice } from '../../ducks/userRewards' import { dateToYMD } from '../../utils/date' import { useCFGYield } from '../../utils/hooks' import NumberDisplay from '../NumberDisplay' +import { Tooltip } from '../Tooltip' import { Cont, Label, TokenLogo, Unit, Value } from './styles' interface Props { @@ -88,7 +88,7 @@ const PoolsMetrics: React.FC = (props: Props) => { - } /> + } /> {/* dateToYMD(val)} /> */} = (props: Props) => { justify="center" > - - <> - - - - - {' '} - % - + <> + + + + + {' '} + % + + - - + +