From c92b93df40c40c7181a1a77ab2f80429b1a79c19 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Mon, 26 Jun 2023 13:08:15 +0100 Subject: [PATCH 01/11] feature: add tooltip to asset cell --- src/components/DataGrid/AssetCell.tsx | 11 +++++++++-- .../AvailableAssetsTable/AvailableAssetsTable.tsx | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/DataGrid/AssetCell.tsx b/src/components/DataGrid/AssetCell.tsx index 90726ce648..30cbbe63e0 100644 --- a/src/components/DataGrid/AssetCell.tsx +++ b/src/components/DataGrid/AssetCell.tsx @@ -1,6 +1,7 @@ import { ReactNode } from 'react'; -import { CoinIcon, Flex, FlexProps, FontSize, IconSize, Span } from '@/component-library'; +import { InformationCircle } from '@/assets/icons'; +import { CoinIcon, Flex, FlexProps, FontSize, IconSize, Span, Tooltip } from '@/component-library'; import { StyledCellTag } from './DataGrid.style'; @@ -10,19 +11,25 @@ type Props = { size?: IconSize; textSize?: FontSize; tag?: ReactNode; + tooltip?: string; }; type InheritAttrs = Omit; type AssetCellProps = Props & InheritAttrs; -const AssetCell = ({ ticker, tickers, size, tag, textSize = 's', ...props }: AssetCellProps): JSX.Element => ( +const AssetCell = ({ ticker, tickers, size, tag, textSize = 's', tooltip, ...props }: AssetCellProps): JSX.Element => ( {ticker} {tag && {tag}} + {tooltip && ( + + + + )} ); diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index 923a7eeec2..1bd6c04499 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -56,6 +56,7 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP textSize={isMobile ? 'base' : undefined} marginBottom={isMobile ? 'spacing4' : undefined} {...getCoinIconProps(currency)} + tooltip='Asset tooltop' /> ); From cc36778bb40e386c2d8864c93860bf5883d59843 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Mon, 26 Jun 2023 13:09:17 +0100 Subject: [PATCH 02/11] fix: typo --- .../components/AvailableAssetsTable/AvailableAssetsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index 1bd6c04499..ab0ebf2196 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -56,7 +56,7 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP textSize={isMobile ? 'base' : undefined} marginBottom={isMobile ? 'spacing4' : undefined} {...getCoinIconProps(currency)} - tooltip='Asset tooltop' + tooltip='Asset tooltip' /> ); From 1b0428144f2d58ccd3089c811c80a6e12b4077b8 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Mon, 26 Jun 2023 13:43:30 +0100 Subject: [PATCH 03/11] wip: ReactNode tooltip so that we can pass in link --- src/components/DataGrid/AssetCell.tsx | 2 +- .../AvailableAssetsTable/AvailableAssetsTable.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DataGrid/AssetCell.tsx b/src/components/DataGrid/AssetCell.tsx index 30cbbe63e0..e127f58e93 100644 --- a/src/components/DataGrid/AssetCell.tsx +++ b/src/components/DataGrid/AssetCell.tsx @@ -11,7 +11,7 @@ type Props = { size?: IconSize; textSize?: FontSize; tag?: ReactNode; - tooltip?: string; + tooltip?: ReactNode; }; type InheritAttrs = Omit; diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index ab0ebf2196..2fff110974 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -56,7 +56,11 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP textSize={isMobile ? 'base' : undefined} marginBottom={isMobile ? 'spacing4' : undefined} {...getCoinIconProps(currency)} - tooltip='Asset tooltip' + tooltip={ + <> + Asset tooltip Google + + } /> ); From b76e94a4d459971db6d874eb478768f87c51e71d Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 09:54:58 +0100 Subject: [PATCH 04/11] feature: add fee asset tooltip --- src/assets/locales/en/translation.json | 1 + src/config/links.ts | 2 ++ .../AvailableAssetsTable.tsx | 24 ++++++++++++++----- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/assets/locales/en/translation.json b/src/assets/locales/en/translation.json index beb8032ab9..33768471d4 100644 --- a/src/assets/locales/en/translation.json +++ b/src/assets/locales/en/translation.json @@ -638,6 +638,7 @@ }, "wallet": { "available_assets": "Available assets", + "get_asset": "Get {{token}}", "no_assets_available": "No assets available", "total_governance_locked": "Total {{token}} Locked", "available_to_stake": "Available to stake", diff --git a/src/config/links.ts b/src/config/links.ts index b187b40006..aaef5d2310 100644 --- a/src/config/links.ts +++ b/src/config/links.ts @@ -11,6 +11,7 @@ const INTERLAY_TERMS_AND_CONDITIONS_LINK = const KINTSUGI_TERMS_AND_CONDITIONS_LINK = 'https://github.com/interlay/terms/blob/master/kintsugi-dapp-terms-of-use.pdf'; const INTERLAY_USE_WRAPPED_CURRENCY_LINK = 'https://docs.interlay.io/#/interlay/earn-with-ibtc'; +const INTERLAY_GET_ASSETS_LINK = 'https://docs.interlay.io/#/guides/assets'; const KINTSUGI_USE_WRAPPED_CURRENCY_LINK = 'https://docs.interlay.io/#/kintsugi/Earn-With-kBTC'; const INTERLAY_GOVERNANCE_LINK = 'https://interlay.subsquare.io/'; const KINTSUGI_GOVERNANCE_LINK = 'https://kintsugi.subsquare.io'; @@ -35,6 +36,7 @@ export { INTERLAY_DOCS_LINK, INTERLAY_DOS_AND_DONTS_DOCS_LINK, INTERLAY_EMAIL_LINK, + INTERLAY_GET_ASSETS_LINK, INTERLAY_GITHUB_LINK, INTERLAY_GOVERNANCE_LINK, INTERLAY_SUBSCAN_LINK, diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index 7e358d5f4e..22aa518247 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -3,10 +3,11 @@ import { ReactNode, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { convertMonetaryAmountToValueInUSD, formatUSD } from '@/common/utils/utils'; -import { P, Switch, theme } from '@/component-library'; +import { P, Switch, TextLink, theme } from '@/component-library'; import { useMediaQuery } from '@/component-library/utils/use-media-query'; import { Cell } from '@/components'; import { AssetCell, DataGrid } from '@/components/DataGrid'; +import { INTERLAY_GET_ASSETS_LINK } from '@/config/links'; import { GOVERNANCE_TOKEN, WRAPPED_TOKEN } from '@/config/relay-chains'; import { FEE_TICKERS } from '@/utils/constants/currency'; import { getCoinIconProps } from '@/utils/helpers/coin-icon'; @@ -43,13 +44,16 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP const { data: vestingData } = useGetVestingData(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); + const isFeeToken = (ticker: string) => FEE_TICKERS.includes(ticker); + const [showAllBalances, setShowAllBalances] = useState(false); const rows: AvailableAssetsRows[] = useMemo(() => { const data = balances ? Object.values(balances) : []; + const filteredData = showAllBalances ? data - : data.filter((balance) => FEE_TICKERS.includes(balance.currency.ticker) || !balance.transferable.isZero()); + : data.filter((balance) => isFeeToken(balance.currency.ticker) || !balance.transferable.isZero()); return filteredData.map( ({ currency, transferable }): AvailableAssetsRows => { @@ -60,9 +64,17 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP marginBottom={isMobile ? 'spacing4' : undefined} {...getCoinIconProps(currency)} tooltip={ - <> - Asset tooltip Google - + isFeeToken(currency.ticker) && ( + + {t('wallet.get_asset', { token: currency.ticker })} + + ) } /> ); @@ -108,7 +120,7 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP }; } ); - }, [balances, showAllBalances, isMobile, prices, pooledTickers, vestingData?.isClaimable]); + }, [balances, showAllBalances, isMobile, prices, pooledTickers, vestingData?.isClaimable, t]); const actions = ( setShowAllBalances(e.target.checked)}> From 8dbd6f52900773eebe0702b9dfaf76fe1602bf4d Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 10:50:58 +0100 Subject: [PATCH 05/11] update text link component --- src/component-library/TextLink/TextLink.tsx | 4 +--- src/components/AuthModal/Disclaimer.tsx | 2 +- .../NotificationsPopover/NotificationsPopover.tsx | 2 +- src/components/TransactionModal/TransactionModal.tsx | 2 +- src/config/relay-chains.tsx | 5 +++++ .../components/CreateVaultWizard/DisclaimerStep.tsx | 6 +++--- .../AvailableAssetsTable/AvailableAssetsTable.tsx | 11 +++++++++-- src/utils/constants/links.ts | 12 +++++++++++- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/component-library/TextLink/TextLink.tsx b/src/component-library/TextLink/TextLink.tsx index 7bb6cb05ab..60a6da804f 100644 --- a/src/component-library/TextLink/TextLink.tsx +++ b/src/component-library/TextLink/TextLink.tsx @@ -20,9 +20,7 @@ type TextLinkProps = Props & NativeAttrs; // TODO: merge this with CTALink const TextLink = forwardRef( ({ color = 'primary', external, to, underlined, size, weight, icon, children, ...props }, ref): JSX.Element => { - const linkProps: TextLinkProps = external - ? { to: { pathname: to as string }, target: '_blank', rel: 'noreferrer' } - : { to }; + const linkProps: TextLinkProps = external ? { to, target: '_blank', rel: 'noreferrer' } : { to }; return ( {

By proceeding you confirm that you have read and accepted the{' '} - + terms and conditions , and represent and warrant that you are not a Resident of the United States or a "U.S. person" within diff --git a/src/components/NotificationsPopover/NotificationsPopover.tsx b/src/components/NotificationsPopover/NotificationsPopover.tsx index 334298a192..2968fe603d 100644 --- a/src/components/NotificationsPopover/NotificationsPopover.tsx +++ b/src/components/NotificationsPopover/NotificationsPopover.tsx @@ -41,7 +41,7 @@ const NotificationsPopover = ({ address, items }: NotificationsPopoverProps): JS {accountTransactionsUrl && ( - + View all transactions diff --git a/src/components/TransactionModal/TransactionModal.tsx b/src/components/TransactionModal/TransactionModal.tsx index 2ae9d82102..47de80cb6a 100644 --- a/src/components/TransactionModal/TransactionModal.tsx +++ b/src/components/TransactionModal/TransactionModal.tsx @@ -98,7 +98,7 @@ const TransactionModal = (): JSX.Element => { )} {url && ( - + View transaction on Subscan )} diff --git a/src/config/relay-chains.tsx b/src/config/relay-chains.tsx index de9302d73f..fc0d3a9737 100644 --- a/src/config/relay-chains.tsx +++ b/src/config/relay-chains.tsx @@ -41,6 +41,7 @@ import { ReactComponent as KintsugiLogoWithTextIcon } from '@/assets/img/kintsug import { ReactComponent as KusamaLogoIcon } from '@/assets/img/kusama-logo.svg'; import { INTERLAY_CROWDLOAN_LINK, + INTERLAY_DOCS_LINK, INTERLAY_GOVERNANCE_LINK, INTERLAY_SUBSCAN_LINK, INTERLAY_TERMS_AND_CONDITIONS_LINK, @@ -68,6 +69,7 @@ let TERMS_AND_CONDITIONS_LINK: string; let USE_WRAPPED_CURRENCY_LINK: string; let GOVERNANCE_LINK: string; let SUBSCAN_LINK: string; +let DOCS_LINK: string; let WRAPPED_TOKEN: WrappedCurrency; let RELAY_CHAIN_NATIVE_TOKEN: RelayChainNativeToken; let GOVERNANCE_TOKEN: GovernanceCurrency; @@ -133,6 +135,7 @@ switch (process.env.REACT_APP_RELAY_CHAIN_NAME) { USE_WRAPPED_CURRENCY_LINK = INTERLAY_USE_WRAPPED_CURRENCY_LINK; GOVERNANCE_LINK = INTERLAY_GOVERNANCE_LINK; SUBSCAN_LINK = INTERLAY_SUBSCAN_LINK; + DOCS_LINK = INTERLAY_DOCS_LINK; WRAPPED_TOKEN = InterBtc; RELAY_CHAIN_NATIVE_TOKEN = Polkadot; GOVERNANCE_TOKEN = Interlay; @@ -179,6 +182,7 @@ switch (process.env.REACT_APP_RELAY_CHAIN_NAME) { USE_WRAPPED_CURRENCY_LINK = KINTSUGI_USE_WRAPPED_CURRENCY_LINK; GOVERNANCE_LINK = KINTSUGI_GOVERNANCE_LINK; SUBSCAN_LINK = KINTSUGI_SUBSCAN_LINK; + DOCS_LINK = INTERLAY_DOCS_LINK; WRAPPED_TOKEN = KBtc; RELAY_CHAIN_NATIVE_TOKEN = Kusama; GOVERNANCE_TOKEN = Kintsugi; @@ -234,6 +238,7 @@ export { BRIDGE_PARACHAIN_NAME, BridgeParachainLogoIcon, CROWDLOAN_LINK, + DOCS_LINK, GOVERNANCE_LINK, GOVERNANCE_TOKEN, GOVERNANCE_TOKEN_SYMBOL, diff --git a/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx b/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx index 913bb98694..9582a11a28 100644 --- a/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx +++ b/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx @@ -44,7 +44,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { Check the - + do's and dont's of correctly operating your vault client @@ -53,7 +53,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { Please check the information about - + risks involved when operating a Vault on Interlay/Kintsugi @@ -64,7 +64,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { By proceeding you confirm that you have read and accepted the - + Terms & Conditions diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index 22aa518247..955f915d37 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -7,9 +7,9 @@ import { P, Switch, TextLink, theme } from '@/component-library'; import { useMediaQuery } from '@/component-library/utils/use-media-query'; import { Cell } from '@/components'; import { AssetCell, DataGrid } from '@/components/DataGrid'; -import { INTERLAY_GET_ASSETS_LINK } from '@/config/links'; import { GOVERNANCE_TOKEN, WRAPPED_TOKEN } from '@/config/relay-chains'; import { FEE_TICKERS } from '@/utils/constants/currency'; +import { EXTERNAL_QUERY_PARAMETERS } from '@/utils/constants/links'; import { getCoinIconProps } from '@/utils/helpers/coin-icon'; import { getTokenPrice } from '@/utils/helpers/prices'; import { BalanceData } from '@/utils/hooks/api/tokens/use-get-balances'; @@ -18,6 +18,8 @@ import { useGetVestingData } from '@/utils/hooks/api/use-get-vesting-data'; import { ActionsCell } from './ActionsCell'; +const queryString = require('query-string'); + enum AvailableAssetsColumns { ASSET = 'asset', PRICE = 'price', @@ -70,7 +72,12 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP size='s' external icon - to={`${INTERLAY_GET_ASSETS_LINK}?id=${currency.ticker.toLowerCase()}`} + to={{ + pathname: 'https://docs.interlay.io/#/guides/assets', + search: queryString.stringify({ + [EXTERNAL_QUERY_PARAMETERS.DOCS.ASSET.ID]: currency.ticker + }) + }} > {t('wallet.get_asset', { token: currency.ticker })} diff --git a/src/utils/constants/links.ts b/src/utils/constants/links.ts index 6a4b1c903e..33648b6c60 100644 --- a/src/utils/constants/links.ts +++ b/src/utils/constants/links.ts @@ -1,5 +1,5 @@ import { BANXA_LINK } from '@/config/links'; -import { SUBSCAN_LINK } from '@/config/relay-chains'; +import { DOCS_LINK, SUBSCAN_LINK } from '@/config/relay-chains'; const URL_PARAMETERS = Object.freeze({ VAULT: { @@ -10,6 +10,8 @@ const URL_PARAMETERS = Object.freeze({ TRANSACTION_HASH: 'transactionHash' }); +console.log('DOCS_LINK', DOCS_LINK); + const PAGES = Object.freeze({ HOME: '/', BRIDGE: '/bridge', @@ -48,6 +50,9 @@ const EXTERNAL_URL_PARAMETERS = Object.freeze({ const EXTERNAL_PAGES = Object.freeze({ BANXA: `${BANXA_LINK}`, + DOCS: { + ASSETS: `${DOCS_LINK}/#/guides/assets` + }, SUBSCAN: { BLOCKS: `${SUBSCAN_LINK}/block`, BLOCK: `${SUBSCAN_LINK}/block/:${EXTERNAL_URL_PARAMETERS.SUBSCAN.BLOCK.HASH}`, @@ -74,6 +79,11 @@ const EXTERNAL_QUERY_PARAMETERS = Object.freeze({ WALLET_ADDRESS: 'walletAddress', FIAT_TYPE: 'fiatType', COIN_TYPE: 'coinType' + }, + DOCS: { + ASSET: { + ID: 'id' + } } }); From af76e59485955a92cb6b5f5215346cde7ba148a1 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 11:10:41 +0100 Subject: [PATCH 06/11] fix: revert changes to text links --- src/components/AuthModal/Disclaimer.tsx | 2 +- src/components/NotificationsPopover/NotificationsPopover.tsx | 2 +- src/components/TransactionModal/TransactionModal.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/AuthModal/Disclaimer.tsx b/src/components/AuthModal/Disclaimer.tsx index 018a9d2d15..62cebc0819 100644 --- a/src/components/AuthModal/Disclaimer.tsx +++ b/src/components/AuthModal/Disclaimer.tsx @@ -14,7 +14,7 @@ const Disclaimer = ({ showSignTerms }: DisclaimerProps): JSX.Element => {

By proceeding you confirm that you have read and accepted the{' '} - + terms and conditions , and represent and warrant that you are not a Resident of the United States or a "U.S. person" within diff --git a/src/components/NotificationsPopover/NotificationsPopover.tsx b/src/components/NotificationsPopover/NotificationsPopover.tsx index 2968fe603d..334298a192 100644 --- a/src/components/NotificationsPopover/NotificationsPopover.tsx +++ b/src/components/NotificationsPopover/NotificationsPopover.tsx @@ -41,7 +41,7 @@ const NotificationsPopover = ({ address, items }: NotificationsPopoverProps): JS {accountTransactionsUrl && ( - + View all transactions diff --git a/src/components/TransactionModal/TransactionModal.tsx b/src/components/TransactionModal/TransactionModal.tsx index 47de80cb6a..2ae9d82102 100644 --- a/src/components/TransactionModal/TransactionModal.tsx +++ b/src/components/TransactionModal/TransactionModal.tsx @@ -98,7 +98,7 @@ const TransactionModal = (): JSX.Element => { )} {url && ( - + View transaction on Subscan )} From 346c3adf06e21868824ec5566bd65967c031df87 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 11:12:32 +0100 Subject: [PATCH 07/11] revert changes to text links --- .../components/CreateVaultWizard/DisclaimerStep.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx b/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx index 9582a11a28..913bb98694 100644 --- a/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx +++ b/src/pages/Vaults/VaultsOverview/components/CreateVaultWizard/DisclaimerStep.tsx @@ -44,7 +44,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { Check the - + do's and dont's of correctly operating your vault client @@ -53,7 +53,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { Please check the information about - + risks involved when operating a Vault on Interlay/Kintsugi @@ -64,7 +64,7 @@ const DisclaimerStep = ({ onClickAgree }: DisclaimerStepProps): JSX.Element => { By proceeding you confirm that you have read and accepted the - + Terms & Conditions From 1c299d1dbf09f12577ee40bef6735e78dd08327c Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 11:37:14 +0100 Subject: [PATCH 08/11] fix: maintain compatibility with existing text links --- src/component-library/TextLink/TextLink.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/component-library/TextLink/TextLink.tsx b/src/component-library/TextLink/TextLink.tsx index 60a6da804f..9c6ced466e 100644 --- a/src/component-library/TextLink/TextLink.tsx +++ b/src/component-library/TextLink/TextLink.tsx @@ -20,7 +20,8 @@ type TextLinkProps = Props & NativeAttrs; // TODO: merge this with CTALink const TextLink = forwardRef( ({ color = 'primary', external, to, underlined, size, weight, icon, children, ...props }, ref): JSX.Element => { - const linkProps: TextLinkProps = external ? { to, target: '_blank', rel: 'noreferrer' } : { to }; + const location = typeof to === 'string' ? { pathname: to as string } : to; + const linkProps: TextLinkProps = external ? { to: location, target: '_blank', rel: 'noreferrer' } : { to }; return ( Date: Fri, 30 Jun 2023 11:56:05 +0100 Subject: [PATCH 09/11] use correct location variable --- src/component-library/TextLink/TextLink.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/component-library/TextLink/TextLink.tsx b/src/component-library/TextLink/TextLink.tsx index 9c6ced466e..ddb8a60af0 100644 --- a/src/component-library/TextLink/TextLink.tsx +++ b/src/component-library/TextLink/TextLink.tsx @@ -21,7 +21,10 @@ type TextLinkProps = Props & NativeAttrs; const TextLink = forwardRef( ({ color = 'primary', external, to, underlined, size, weight, icon, children, ...props }, ref): JSX.Element => { const location = typeof to === 'string' ? { pathname: to as string } : to; - const linkProps: TextLinkProps = external ? { to: location, target: '_blank', rel: 'noreferrer' } : { to }; + + const linkProps: TextLinkProps = external + ? { to: location, target: '_blank', rel: 'noreferrer' } + : { to: location }; return ( Date: Fri, 30 Jun 2023 12:31:16 +0100 Subject: [PATCH 10/11] fix: remove log --- src/utils/constants/links.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/utils/constants/links.ts b/src/utils/constants/links.ts index 33648b6c60..1fa18eb6ec 100644 --- a/src/utils/constants/links.ts +++ b/src/utils/constants/links.ts @@ -10,8 +10,6 @@ const URL_PARAMETERS = Object.freeze({ TRANSACTION_HASH: 'transactionHash' }); -console.log('DOCS_LINK', DOCS_LINK); - const PAGES = Object.freeze({ HOME: '/', BRIDGE: '/bridge', From e58b89c4392b502527f62f9394d1e8673fe32d60 Mon Sep 17 00:00:00 2001 From: Thomas Jeatt Date: Fri, 30 Jun 2023 13:23:13 +0100 Subject: [PATCH 11/11] fix: tooltip const --- .../AvailableAssetsTable.tsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx index 955f915d37..5c7469e636 100644 --- a/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx +++ b/src/pages/Wallet/WalletOverview/components/AvailableAssetsTable/AvailableAssetsTable.tsx @@ -59,30 +59,30 @@ const AvailableAssetsTable = ({ balances, pooledTickers }: AvailableAssetsTableP return filteredData.map( ({ currency, transferable }): AvailableAssetsRows => { + const tooltip = isFeeToken(currency.ticker) && ( + + {t('wallet.get_asset', { token: currency.ticker })} + + ); + const asset = ( - {t('wallet.get_asset', { token: currency.ticker })} - - ) - } + tooltip={tooltip} /> );