From 0ac7bb5f0358c08fddebf47b97a0d05e42e61c9a Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Tue, 15 Feb 2022 13:59:35 +0000 Subject: [PATCH] terminology updates --- nym-wallet/src/components/InfoToolTip.tsx | 12 ++++--- nym-wallet/src/components/index.ts | 1 + nym-wallet/src/pages/balance/vesting.tsx | 36 ++++++++++--------- .../src/pages/settings/system-variables.tsx | 2 +- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/nym-wallet/src/components/InfoToolTip.tsx b/nym-wallet/src/components/InfoToolTip.tsx index bd65d584ca..573eca7788 100644 --- a/nym-wallet/src/components/InfoToolTip.tsx +++ b/nym-wallet/src/components/InfoToolTip.tsx @@ -1,15 +1,17 @@ +import React from 'react' import { InfoOutlined } from '@mui/icons-material' import { Tooltip, TooltipProps } from '@mui/material' -import React from 'react' export const InfoTooltip = ({ title, - placement = 'bottom', + tooltipPlacement = 'bottom', + light, }: { title: string - placement?: TooltipProps['placement'] + tooltipPlacement?: TooltipProps['placement'] + light?: boolean }) => ( - - + + ) diff --git a/nym-wallet/src/components/index.ts b/nym-wallet/src/components/index.ts index c8f8b8c7a3..1ac97c6f10 100644 --- a/nym-wallet/src/components/index.ts +++ b/nym-wallet/src/components/index.ts @@ -12,3 +12,4 @@ export * from './Fee' export * from './AppBar' export * from './NetworkSelector' export * from './ClientAddress' +export * from './InfoToolTip' diff --git a/nym-wallet/src/pages/balance/vesting.tsx b/nym-wallet/src/pages/balance/vesting.tsx index 3e7af935f2..5e6096d8c7 100644 --- a/nym-wallet/src/pages/balance/vesting.tsx +++ b/nym-wallet/src/pages/balance/vesting.tsx @@ -15,7 +15,7 @@ import { } from '@mui/material' import { InfoOutlined, Refresh } from '@mui/icons-material' import { useSnackbar } from 'notistack' -import { NymCard } from '../../components' +import { NymCard, InfoTooltip } from '../../components' import { ClientContext } from '../../context/main' import { withdrawVestedCoins } from '../../requests' import { Period } from '../../types' @@ -37,7 +37,7 @@ export const VestingCard = () => { return ( { - Vested tokens + Unlocked tokens { - - Releasable tokens - + + + Transferable tokens + + + { }) } catch (e) { console.log(e) - enqueueSnackbar('Token release failed. You may not have releasable funds at this time', { + enqueueSnackbar('Token transfer failed. You may not have any transferable tokens at this time', { variant: 'error', preventDuplicate: true, }) @@ -111,14 +114,14 @@ export const VestingCard = () => { disabled={isLoading} disableElevation > - Release Tokens + Transfer ) } -const columnsHeaders = ['Vesting', 'Period', 'Percentage Vested', 'Vested'] +const columnsHeaders = ['Locked', 'Period', 'Percentage Vested', 'Unlocked'] const VestingTable = () => { const { userBalance, currency } = useContext(ClientContext) const [vestedPercentage, setVestedPercentage] = useState(0) @@ -153,7 +156,8 @@ const VestingTable = () => { {userBalance.tokenAllocation?.vesting || 'n/a'} {currency?.major} - {vestingPeriod(userBalance.currentVestingPeriod, userBalance.originalVesting?.number_of_periods)} + {vestingPeriod(userBalance.currentVestingPeriod, userBalance.originalVesting?.number_of_periods)} + { ) } +const vestingPeriod = (current?: Period, original?: number) => { + if (current === 'After') return 'Complete' -const vestingPeriod = (current?:Period, original?: number ) => { + if (typeof current === 'object' && typeof original === 'number') return `${current.In + 1}/${original}` - if (current === "After") return "Complete" - - if (typeof current === "object" && typeof original === "number") return `${current.In + 1}/${original}` - - return "N/A" -} \ No newline at end of file + return 'N/A' +} diff --git a/nym-wallet/src/pages/settings/system-variables.tsx b/nym-wallet/src/pages/settings/system-variables.tsx index 6977b8a0be..9f819499df 100644 --- a/nym-wallet/src/pages/settings/system-variables.tsx +++ b/nym-wallet/src/pages/settings/system-variables.tsx @@ -132,7 +132,7 @@ const DataField = ({ title, info, Indicator }: { title: string; info: string; In - + {title}