diff --git a/configs/app/features/pools.ts b/configs/app/features/pools.ts index 13a694074f..310100da4f 100644 --- a/configs/app/features/pools.ts +++ b/configs/app/features/pools.ts @@ -3,9 +3,9 @@ import type { Feature } from './types'; import { getEnvValue } from '../utils'; const contractInfoApiHost = getEnvValue('NEXT_PUBLIC_CONTRACT_INFO_API_HOST'); -const dexPoolsEnabled = getEnvValue('NEXT_PUBLIC_DEX_POOLS_ENABLED'); +const dexPoolsEnabled = getEnvValue('NEXT_PUBLIC_DEX_POOLS_ENABLED') === 'true'; -const title = 'Pools'; +const title = 'DEX Pools'; const config: Feature<{ api: { endpoint: string; basePath: string } }> = (() => { if (contractInfoApiHost && dexPoolsEnabled) { diff --git a/lib/getItemIndex.ts b/lib/getItemIndex.ts new file mode 100644 index 0000000000..6103c23ddd --- /dev/null +++ b/lib/getItemIndex.ts @@ -0,0 +1,5 @@ +const DEFAULT_PAGE_SIZE = 50; + +export default function getItemIndex(index: number, page: number, pageSize: number = DEFAULT_PAGE_SIZE) { + return (page - 1) * pageSize + index + 1; +}; diff --git a/lib/pools/getPoolLinks.ts b/lib/pools/getPoolLinks.ts new file mode 100644 index 0000000000..19d738f01e --- /dev/null +++ b/lib/pools/getPoolLinks.ts @@ -0,0 +1,21 @@ +import type { Pool } from 'types/api/pools'; + +type PoolLink = { + url: string; + image: string; + title: string; +}; + +export default function getPoolLinks(pool?: Pool): Array { + if (!pool) { + return []; + } + + return [ + { + url: pool.coin_gecko_terminal_url, + image: '/static/gecko_terminal.png', + title: 'GeckoTerminal', + }, + ].filter(link => Boolean(link.url)); +} diff --git a/lib/pools/getPoolTitle.ts b/lib/pools/getPoolTitle.ts new file mode 100644 index 0000000000..1e4db61ac6 --- /dev/null +++ b/lib/pools/getPoolTitle.ts @@ -0,0 +1,5 @@ +import type { Pool } from 'types/api/pools'; + +export const getPoolTitle = (pool: Pool) => { + return `${ pool.base_token_symbol } / ${ pool.quote_token_symbol } ${ pool.fee ? `(${ pool.fee }%)` : '' }`; +}; diff --git a/mocks/pools/pool.ts b/mocks/pools/pool.ts index 34a990a0c3..78dce73b1d 100644 --- a/mocks/pools/pool.ts +++ b/mocks/pools/pool.ts @@ -13,6 +13,7 @@ export const base: Pool = { market_cap_usd: '139312819076.195', liquidity: '2099941.2238', dex: { id: 'sushiswap', name: 'SushiSwap' }, + fee: '0.03', coin_gecko_terminal_url: 'https://www.geckoterminal.com/eth/pools/0x06da0fd433c1a5d7a4faa01111c044910a184553', }; diff --git a/pages/pools/index.tsx b/pages/pools/index.tsx index cf32aae817..10530b11bd 100644 --- a/pages/pools/index.tsx +++ b/pages/pools/index.tsx @@ -8,7 +8,7 @@ const Pools = dynamic(() => import('ui/pages/Pools'), { ssr: false }); const Page: NextPage = () => { return ( - + ); diff --git a/types/api/pools.tsx b/types/api/pools.tsx index 679196e158..21560f6735 100644 --- a/types/api/pools.tsx +++ b/types/api/pools.tsx @@ -22,5 +22,6 @@ export type Pool = { id: string; name: string; }; + fee?: string; coin_gecko_terminal_url: string; }; diff --git a/ui/marketplace/MarketplaceAppInfo.pw.tsx b/ui/marketplace/MarketplaceAppInfo.pw.tsx index 17e686ab33..1d15158a03 100644 --- a/ui/marketplace/MarketplaceAppInfo.pw.tsx +++ b/ui/marketplace/MarketplaceAppInfo.pw.tsx @@ -16,7 +16,7 @@ test.describe('mobile', () => { test('base view', async({ render, page }) => { await render(); - await page.getByLabel('Show project info').click(); + await page.getByLabel('Show info').click(); await expect(page).toHaveScreenshot(); }); }); diff --git a/ui/marketplace/MarketplaceAppInfo/TriggerButton.tsx b/ui/marketplace/MarketplaceAppInfo/TriggerButton.tsx deleted file mode 100644 index 172cb4f32a..0000000000 --- a/ui/marketplace/MarketplaceAppInfo/TriggerButton.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { Button } from '@chakra-ui/react'; -import React from 'react'; - -import IconSvg from 'ui/shared/IconSvg'; - -interface Props { - onClick: () => void; - onlyIcon?: boolean; - isActive?: boolean; -} - -const TriggerButton = ({ onClick, onlyIcon, isActive }: Props, ref: React.ForwardedRef) => { - return ( - - ); -}; - -export default React.forwardRef(TriggerButton); diff --git a/ui/pages/Accounts.tsx b/ui/pages/Accounts.tsx index 987e1aa8d2..602cb676b0 100644 --- a/ui/pages/Accounts.tsx +++ b/ui/pages/Accounts.tsx @@ -2,6 +2,7 @@ import { Hide, Show } from '@chakra-ui/react'; import BigNumber from 'bignumber.js'; import React from 'react'; +import getItemIndex from 'lib/getItemIndex'; import { TOP_ADDRESS } from 'stubs/address'; import { generateListStub } from 'stubs/utils'; import AddressesListItem from 'ui/addresses/AddressesListItem'; @@ -12,8 +13,6 @@ import PageTitle from 'ui/shared/Page/PageTitle'; import Pagination from 'ui/shared/pagination/Pagination'; import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages'; -const PAGE_SIZE = 50; - const Accounts = () => { const { isError, isPlaceholderData, data, pagination } = useQueryWithPages({ resourceName: 'addresses', @@ -39,7 +38,7 @@ const Accounts = () => { ); - const pageStartIndex = (pagination.page - 1) * PAGE_SIZE + 1; + const pageStartIndex = getItemIndex(0, pagination.page); const totalSupply = React.useMemo(() => { return BigNumber(data?.total_supply || '0'); }, [ data?.total_supply ]); diff --git a/ui/pages/Pool.pw.tsx b/ui/pages/Pool.pw.tsx index 1b71eadc91..ea5d553232 100644 --- a/ui/pages/Pool.pw.tsx +++ b/ui/pages/Pool.pw.tsx @@ -1,6 +1,7 @@ import React from 'react'; import config from 'configs/app'; +import * as addressMock from 'mocks/address/address'; import * as poolMock from 'mocks/pools/pool'; import { test, expect } from 'playwright/lib'; @@ -16,6 +17,7 @@ const hooksConfig = { test('base view +@mobile +@dark-mode', async({ render, mockApiResponse, mockTextAd, mockAssetResponse }) => { await mockTextAd(); await mockApiResponse('pool', poolMock.base, { pathParams: { chainId: config.chain.id, hash: addressHash } }); + await mockApiResponse('address', addressMock.contract, { pathParams: { hash: poolMock.base.contract_address } }); await mockAssetResponse(poolMock.base.quote_token_icon_url as string, './playwright/mocks/image_s.jpg'); await mockAssetResponse(poolMock.base.base_token_icon_url as string, './playwright/mocks/image_md.jpg'); const component = await render(, { hooksConfig }); diff --git a/ui/pages/Pool.tsx b/ui/pages/Pool.tsx index 9718ca8af2..d88877857d 100644 --- a/ui/pages/Pool.tsx +++ b/ui/pages/Pool.tsx @@ -1,4 +1,4 @@ -import { Tag, Box, Flex, Image } from '@chakra-ui/react'; +import { Tag, Box, Flex, Image, Skeleton } from '@chakra-ui/react'; import { useRouter } from 'next/router'; import React from 'react'; @@ -6,6 +6,8 @@ import config from 'configs/app'; import useApiQuery from 'lib/api/useApiQuery'; import { useAppContext } from 'lib/contexts/app'; import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError'; +import getPoolLinks from 'lib/pools/getPoolLinks'; +import { getPoolTitle } from 'lib/pools/getPoolTitle'; import getQueryParamString from 'lib/router/getQueryParamString'; import * as addressStubs from 'stubs/address'; import { POOL } from 'stubs/pools'; @@ -61,12 +63,7 @@ const Pool = () => { ); })(); - // More links can be added here - const externalLinks = [ { - url: data?.coin_gecko_terminal_url, - image: '/static/gecko_terminal.png', - title: 'GeckoTerminal', - } ].filter(link => Boolean(link.url)); + const externalLinks = getPoolLinks(data); const hasLinks = externalLinks.length > 0; const externalLinksComponents = React.useMemo(() => { @@ -91,7 +88,7 @@ const Pool = () => { { hasLinks && ( @@ -113,7 +110,7 @@ const Pool = () => { }; }, [ appProps.referrer ]); - const poolTitle = data ? `${ data.base_token_symbol } / ${ data.quote_token_symbol }` : ''; + const poolTitle = data ? getPoolTitle(data) : ''; return ( <> @@ -127,7 +124,7 @@ const Pool = () => { size="lg" /> ) : null } - contentAfter={ Pool } + contentAfter={ Pool } secondRow={ titleSecondRow } isLoading={ isPlaceholderData } withTextAd diff --git a/ui/pages/Pools.pw.tsx b/ui/pages/Pools.pw.tsx index d7e7830ddd..3af9cc8080 100644 --- a/ui/pages/Pools.pw.tsx +++ b/ui/pages/Pools.pw.tsx @@ -2,11 +2,11 @@ import React from 'react'; import config from 'configs/app'; import * as poolMock from 'mocks/pools/pool'; -import { test, expect } from 'playwright/lib'; +import { test, expect, devices } from 'playwright/lib'; import Pools from './Pools'; -test('base view +@mobile +@dark-mode', async({ render, mockApiResponse, mockTextAd, mockAssetResponse }) => { +test('base view +@dark-mode', async({ render, mockApiResponse, mockTextAd, mockAssetResponse }) => { await mockTextAd(); await mockApiResponse( 'pools', @@ -18,3 +18,20 @@ test('base view +@mobile +@dark-mode', async({ render, mockApiResponse, mockText const component = await render(); await expect(component).toHaveScreenshot(); }); + +test.describe('mobile', () => { + test.use({ viewport: devices['iPhone 13 Pro'].viewport }); + + test('base view', async({ render, mockApiResponse, mockTextAd, mockAssetResponse }) => { + await mockTextAd(); + await mockApiResponse( + 'pools', + { items: [ poolMock.base, poolMock.noIcons, poolMock.base ], next_page_params: null }, + { pathParams: { chainId: config.chain.id } }, + ); + await mockAssetResponse(poolMock.base.quote_token_icon_url as string, './playwright/mocks/image_s.jpg'); + await mockAssetResponse(poolMock.base.base_token_icon_url as string, './playwright/mocks/image_s.jpg'); + const component = await render(); + await expect(component).toHaveScreenshot(); + }); +}); diff --git a/ui/pages/Pools.tsx b/ui/pages/Pools.tsx index e7170082d8..7879092ef6 100644 --- a/ui/pages/Pools.tsx +++ b/ui/pages/Pools.tsx @@ -1,4 +1,4 @@ -import { Show, Hide } from '@chakra-ui/react'; +import { Show, Hide, Flex } from '@chakra-ui/react'; import { useRouter } from 'next/router'; import React from 'react'; @@ -28,7 +28,7 @@ const Pools = () => { pathParams: { chainId: config.chain.id }, filters: { query: debouncedSearchTerm }, options: { - placeholderData: { items: Array(50).fill(POOL), next_page_params: null }, + placeholderData: { items: Array(50).fill(POOL), next_page_params: { page_token: 'a', page_size: 50 } }, }, }); @@ -70,10 +70,20 @@ const Pools = () => { ); const actionBar = ( - - { filter } - - + <> + + { filter } + + + + { filter } + + + + ); return ( @@ -90,7 +100,7 @@ const Pools = () => { actionBar={ actionBar } filterProps={{ emptyFilteredText: `Couldn${ apos }t find pools that matches your filter query.`, - hasActiveFilters: Boolean(searchTerm), + hasActiveFilters: Boolean(debouncedSearchTerm), }} /> diff --git a/ui/pages/Token.pw.tsx b/ui/pages/Token.pw.tsx index b2987b38b7..4f1aa483ab 100644 --- a/ui/pages/Token.pw.tsx +++ b/ui/pages/Token.pw.tsx @@ -56,7 +56,7 @@ test('with verified info', async({ render, page, createSocket, mockApiResponse, const channel = await socketServer.joinChannel(socket, `tokens:${ hash }`); socketServer.sendMessage(socket, channel, 'total_supply', { total_supply: 10 ** 20 }); - await page.getByRole('button', { name: /project info/i }).click(); + await page.getByLabel('Show info').click(); await expect(component).toHaveScreenshot({ mask: [ page.locator(pwConfig.adsBannerSelector) ], diff --git a/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_dark-color-mode_base-view-dark-mode-1.png b/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_dark-color-mode_base-view-dark-mode-1.png index bb1ea3e2d6..c86f9687ba 100644 Binary files a/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_dark-color-mode_base-view-dark-mode-1.png and b/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_dark-color-mode_base-view-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_default_base-view-dark-mode-1.png b/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_default_base-view-dark-mode-1.png index 45d5a9e54b..f6f872df39 100644 Binary files a/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_default_base-view-dark-mode-1.png and b/ui/pages/__screenshots__/MarketplaceApp.pw.tsx_default_base-view-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pool.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pool.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png index b5fb6bf481..3f05bb9e09 100644 Binary files a/ui/pages/__screenshots__/Pool.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/Pool.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pool.pw.tsx_default_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pool.pw.tsx_default_base-view-mobile-dark-mode-1.png index ddd95607d4..9a1d6e1c5a 100644 Binary files a/ui/pages/__screenshots__/Pool.pw.tsx_default_base-view-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/Pool.pw.tsx_default_base-view-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pool.pw.tsx_mobile_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pool.pw.tsx_mobile_base-view-mobile-dark-mode-1.png index 1e15a4fbae..6014df238e 100644 Binary files a/ui/pages/__screenshots__/Pool.pw.tsx_mobile_base-view-mobile-dark-mode-1.png and b/ui/pages/__screenshots__/Pool.pw.tsx_mobile_base-view-mobile-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-dark-mode-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-dark-mode-1.png new file mode 100644 index 0000000000..d9bf9df153 Binary files /dev/null and b/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png deleted file mode 100644 index e1953311d7..0000000000 Binary files a/ui/pages/__screenshots__/Pools.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png and /dev/null differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-dark-mode-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-dark-mode-1.png new file mode 100644 index 0000000000..cd86cf3bcb Binary files /dev/null and b/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-dark-mode-1.png differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-mobile-dark-mode-1.png deleted file mode 100644 index b0383d89c6..0000000000 Binary files a/ui/pages/__screenshots__/Pools.pw.tsx_default_base-view-mobile-dark-mode-1.png and /dev/null differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_default_mobile-base-view-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_default_mobile-base-view-1.png new file mode 100644 index 0000000000..84ed179a77 Binary files /dev/null and b/ui/pages/__screenshots__/Pools.pw.tsx_default_mobile-base-view-1.png differ diff --git a/ui/pages/__screenshots__/Pools.pw.tsx_mobile_base-view-mobile-dark-mode-1.png b/ui/pages/__screenshots__/Pools.pw.tsx_mobile_base-view-mobile-dark-mode-1.png deleted file mode 100644 index 0a7b4c5cc9..0000000000 Binary files a/ui/pages/__screenshots__/Pools.pw.tsx_mobile_base-view-mobile-dark-mode-1.png and /dev/null differ diff --git a/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png b/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png index 7292349d1c..ef59ef7cc9 100644 Binary files a/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png and b/ui/pages/__screenshots__/Token.pw.tsx_default_mobile-with-verified-info-1.png differ diff --git a/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png b/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png index 00cade0cab..0796d85fd2 100644 Binary files a/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png and b/ui/pages/__screenshots__/Token.pw.tsx_default_with-verified-info-1.png differ diff --git a/ui/pool/PoolInfo.tsx b/ui/pool/PoolInfo.tsx index 55fd4534b5..fed9a75faf 100644 --- a/ui/pool/PoolInfo.tsx +++ b/ui/pool/PoolInfo.tsx @@ -16,7 +16,7 @@ const PoolInfo = ({ data, isPlaceholderData }: Props) => { return ( diff --git a/ui/pools/PoolsListItem.tsx b/ui/pools/PoolsListItem.tsx index 758908fa8d..4c0f92cdca 100644 --- a/ui/pools/PoolsListItem.tsx +++ b/ui/pools/PoolsListItem.tsx @@ -1,10 +1,12 @@ -import { Skeleton } from '@chakra-ui/react'; +import { Skeleton, Image } from '@chakra-ui/react'; import React from 'react'; import type { Pool } from 'types/api/pools'; +import getPoolLinks from 'lib/pools/getPoolLinks'; import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import PoolEntity from 'ui/shared/entities/pool/PoolEntity'; +import LinkExternal from 'ui/shared/links/LinkExternal'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; type Props = { @@ -13,6 +15,7 @@ type Props = { }; const UserOpsListItem = ({ item, isLoading }: Props) => { + const externalLinks = getPoolLinks(item); return ( @@ -46,6 +49,18 @@ const UserOpsListItem = ({ item, isLoading }: Props) => { ${ Number(item.liquidity).toLocaleString(undefined, { maximumFractionDigits: 2, notation: 'compact' }) } + + View in + + + { externalLinks.map((link) => ( + + { + { link.title } + + )) } + + ); }; diff --git a/ui/pools/PoolsTable.tsx b/ui/pools/PoolsTable.tsx index 3d7183cdf9..167e9ec697 100644 --- a/ui/pools/PoolsTable.tsx +++ b/ui/pools/PoolsTable.tsx @@ -1,10 +1,10 @@ -import { Table, Tbody, Th, Tr, Flex, Tooltip } from '@chakra-ui/react'; +import { Table, Tbody, Th, Tr, Flex } from '@chakra-ui/react'; import React from 'react'; import type { Pool } from 'types/api/pools'; import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; -import IconSvg from 'ui/shared/IconSvg'; +import Hint from 'ui/shared/Hint'; import { default as Thead } from 'ui/shared/TheadSticky'; import PoolsTableItem from './PoolsTableItem'; @@ -24,18 +24,18 @@ const PoolsTable = ({ items, page, isLoading, top }: Props) => { Pool DEX - + FDV - - - + boxSize={ 5 } + ml={ 1 } + /> Market cap Liquidity + View in diff --git a/ui/pools/PoolsTableItem.tsx b/ui/pools/PoolsTableItem.tsx index 7bf89b3d4f..3f29542136 100644 --- a/ui/pools/PoolsTableItem.tsx +++ b/ui/pools/PoolsTableItem.tsx @@ -1,10 +1,13 @@ -import { Flex, Box, Td, Tr, Skeleton, Text } from '@chakra-ui/react'; +import { Flex, Box, Td, Tr, Skeleton, Text, Image, Tooltip } from '@chakra-ui/react'; import React from 'react'; import type { Pool } from 'types/api/pools'; +import getItemIndex from 'lib/getItemIndex'; +import getPoolLinks from 'lib/pools/getPoolLinks'; import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import PoolEntity from 'ui/shared/entities/pool/PoolEntity'; +import LinkExternal from 'ui/shared/links/LinkExternal'; type Props = { item: Pool; @@ -13,20 +16,20 @@ type Props = { isLoading?: boolean; }; -const PAGE_SIZE = 50; - const PoolsTableItem = ({ item, page, index, isLoading, }: Props) => { + const externalLinks = getPoolLinks(item); + return ( - { index + 1 + (page - 1) * PAGE_SIZE } + { getItemIndex(index, page) } @@ -42,7 +45,7 @@ const PoolsTableItem = ({ ${ Number(item.fully_diluted_valuation_usd).toLocaleString(undefined, { maximumFractionDigits: 2, notation: 'compact' }) } - + ${ Number(item.market_cap_usd).toLocaleString(undefined, { maximumFractionDigits: 2, notation: 'compact' }) } @@ -52,6 +55,19 @@ const PoolsTableItem = ({ ${ Number(item.liquidity).toLocaleString(undefined, { maximumFractionDigits: 2, notation: 'compact' }) } + + + { externalLinks.map((link) => ( + + + + { + + + + )) } + + ); }; diff --git a/ui/shared/InfoButton.tsx b/ui/shared/InfoButton.tsx index df52595309..fde2aea670 100644 --- a/ui/shared/InfoButton.tsx +++ b/ui/shared/InfoButton.tsx @@ -26,15 +26,15 @@ const InfoButton = ({ children }: Props) => { colorScheme="gray" onClick={ onToggle } isActive={ isOpen } - aria-label="Show project info" + aria-label="Show info" fontWeight={ 500 } lineHeight={ 6 } pl={ 1 } - pr={ 2 } + pr={ isMobile ? 1 : 2 } h="32px" > - - Info + + { !isMobile && Info } ); diff --git a/ui/shared/VerifyWith.tsx b/ui/shared/VerifyWith.tsx index ca2c68db5a..2be1e416a6 100644 --- a/ui/shared/VerifyWith.tsx +++ b/ui/shared/VerifyWith.tsx @@ -20,7 +20,7 @@ interface Props { links: Array; label: string; longText: string; - shortText: string; + shortText?: string; } const VerifyWith = ({ className, links, label, longText, shortText }: Props) => { @@ -38,7 +38,7 @@ const VerifyWith = ({ className, links, label, longText, shortText }: Props) => isActive={ isOpen } aria-label={ label } fontWeight={ 500 } - px={ 2 } + px={ shortText ? 2 : 1 } h="32px" flexShrink={ 0 } > @@ -46,9 +46,11 @@ const VerifyWith = ({ className, links, label, longText, shortText }: Props) => { longText } - - { shortText } - + { shortText && ( + + { shortText } + + ) } diff --git a/ui/shared/entities/pool/PoolEntity.tsx b/ui/shared/entities/pool/PoolEntity.tsx index 0e5e16e3cf..eddbc71401 100644 --- a/ui/shared/entities/pool/PoolEntity.tsx +++ b/ui/shared/entities/pool/PoolEntity.tsx @@ -6,6 +6,7 @@ import type { Pool } from 'types/api/pools'; import { route } from 'nextjs-routes'; +import { getPoolTitle } from 'lib/pools/getPoolTitle'; import * as EntityBase from 'ui/shared/entities/base/components'; import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip'; @@ -30,7 +31,6 @@ const Link = chakra((props: LinkProps) => { type IconProps = Pick & EntityBase.IconBaseProps; const Icon = (props: IconProps) => { - // const bgColor = useColorModeValue('gray.200', 'gray.600'); const bgColor = useColorModeValue('white', 'black'); const borderColor = useColorModeValue('whiteAlpha.800', 'blackAlpha.800'); return ( @@ -81,7 +81,7 @@ const Icon = (props: IconProps) => { type ContentProps = Omit & Pick; const Content = chakra((props: ContentProps) => { - const nameString = `${ props.pool.base_token_symbol } / ${ props.pool.quote_token_symbol }`; + const nameString = getPoolTitle(props.pool); return ( diff --git a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_no-icons-dark-mode-1.png b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_no-icons-dark-mode-1.png index 628760593c..5dae996eff 100644 Binary files a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_no-icons-dark-mode-1.png and b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_no-icons-dark-mode-1.png differ diff --git a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_with-icons-dark-mode-1.png b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_with-icons-dark-mode-1.png index bdb6a73a8d..e7390bbe25 100644 Binary files a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_with-icons-dark-mode-1.png and b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_dark-color-mode_with-icons-dark-mode-1.png differ diff --git a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_no-icons-dark-mode-1.png b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_no-icons-dark-mode-1.png index 57c5e05008..50c2f1639d 100644 Binary files a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_no-icons-dark-mode-1.png and b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_no-icons-dark-mode-1.png differ diff --git a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_with-icons-dark-mode-1.png b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_with-icons-dark-mode-1.png index 0ff3a71b5b..836ed25bfd 100644 Binary files a/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_with-icons-dark-mode-1.png and b/ui/shared/entities/pool/__screenshots__/PoolEntity.pw.tsx_default_with-icons-dark-mode-1.png differ diff --git a/ui/token/TokenProjectInfo/TriggerButton.tsx b/ui/token/TokenProjectInfo/TriggerButton.tsx deleted file mode 100644 index fa5a03f317..0000000000 --- a/ui/token/TokenProjectInfo/TriggerButton.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Button } from '@chakra-ui/react'; -import React from 'react'; - -import IconSvg from 'ui/shared/IconSvg'; - -interface Props { - onClick: () => void; - isActive: boolean; -} - -const TriggerButton = ({ onClick, isActive }: Props, ref: React.ForwardedRef) => { - return ( - - ); -}; - -export default React.forwardRef(TriggerButton); diff --git a/ui/tokens/TokensListItem.tsx b/ui/tokens/TokensListItem.tsx index b40a1f0d1c..45f223c3f9 100644 --- a/ui/tokens/TokensListItem.tsx +++ b/ui/tokens/TokensListItem.tsx @@ -5,6 +5,7 @@ import React from 'react'; import type { TokenInfo } from 'types/api/token'; import config from 'configs/app'; +import getItemIndex from 'lib/getItemIndex'; import { getTokenTypeName } from 'lib/token/tokenTypes'; import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet'; import Tag from 'ui/shared/chakra/Tag'; @@ -19,8 +20,6 @@ type Props = { isLoading?: boolean; }; -const PAGE_SIZE = 50; - const bridgedTokensFeature = config.features.bridgedTokens; const TokensTableItem = ({ @@ -65,7 +64,7 @@ const TokensTableItem = ({ { bridgedChainTag && { bridgedChainTag } } - { (page - 1) * PAGE_SIZE + index + 1 } + { getItemIndex(index, page) } diff --git a/ui/tokens/TokensTableItem.tsx b/ui/tokens/TokensTableItem.tsx index 87f5882216..9fd6578517 100644 --- a/ui/tokens/TokensTableItem.tsx +++ b/ui/tokens/TokensTableItem.tsx @@ -5,6 +5,7 @@ import React from 'react'; import type { TokenInfo } from 'types/api/token'; import config from 'configs/app'; +import getItemIndex from 'lib/getItemIndex'; import { getTokenTypeName } from 'lib/token/tokenTypes'; import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet'; import Tag from 'ui/shared/chakra/Tag'; @@ -19,8 +20,6 @@ type Props = { isLoading?: boolean; }; -const PAGE_SIZE = 50; - const bridgedTokensFeature = config.features.bridgedTokens; const TokensTableItem = ({ @@ -70,7 +69,7 @@ const TokensTableItem = ({ mr={ 3 } minW="28px" > - { (page - 1) * PAGE_SIZE + index + 1 } + { getItemIndex(index, page) }