Commit dd62b6e3 authored by tom's avatar tom

update token placeholder

parent 7ecf96d7
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.224 8.076V6.048h9.557v2.028H13.22v9.608h-2.432V8.076H7.224Z" fill="currentColor"/>
</svg>
...@@ -26,7 +26,6 @@ test('daily txs chart +@mobile +@dark-mode +@dark-mode-mobile', async({ mount, p ...@@ -26,7 +26,6 @@ test('daily txs chart +@mobile +@dark-mode +@dark-mode-mobile', async({ mount, p
<ChainIndicators/> <ChainIndicators/>
</TestApp>, </TestApp>,
); );
await page.waitForResponse(STATS_API_URL),
await page.hover('.ChartOverlay', { position: { x: 100, y: 100 } }); await page.hover('.ChartOverlay', { position: { x: 100, y: 100 } });
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
......
...@@ -30,7 +30,5 @@ test('with indexing alert +@mobile', async({ mount, page }) => { ...@@ -30,7 +30,5 @@ test('with indexing alert +@mobile', async({ mount, page }) => {
</TestApp>, </TestApp>,
); );
await page.waitForResponse(API_URL),
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
import { Image, Center, chakra, useColorModeValue } from '@chakra-ui/react'; import { Image, chakra, useColorModeValue, Icon } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import appConfig from 'configs/app/config'; import appConfig from 'configs/app/config';
import tokenPlaceholderIcon from 'icons/token-placeholder.svg';
const EmptyElement = ({ className, letter }: { className?: string; letter: string }) => { const EmptyElement = ({ className }: { className?: string }) => {
const bgColor = useColorModeValue('gray.200', 'gray.600'); const bgColor = useColorModeValue('gray.200', 'gray.600');
const color = useColorModeValue('gray.400', 'gray.200'); const color = useColorModeValue('gray.400', 'gray.200');
return ( return (
<Center <Icon
className={ className } className={ className }
fontWeight={ 600 } fontWeight={ 600 }
bgColor={ bgColor } bgColor={ bgColor }
color={ color } color={ color }
borderRadius="base" borderRadius="base"
> as={ tokenPlaceholderIcon }
{ letter.toUpperCase() } />
</Center>
); );
}; };
...@@ -41,7 +41,7 @@ const TokenLogo = ({ hash, name, className }: Props) => { ...@@ -41,7 +41,7 @@ const TokenLogo = ({ hash, name, className }: Props) => {
className={ className } className={ className }
src={ logoSrc } src={ logoSrc }
alt={ `${ name || 'token' } logo` } alt={ `${ name || 'token' } logo` }
fallback={ <EmptyElement className={ className } letter={ name?.slice(0, 1) || 'U' }/> } fallback={ <EmptyElement className={ className }/> }
/> />
); );
}; };
......
...@@ -9,12 +9,13 @@ interface Props { ...@@ -9,12 +9,13 @@ interface Props {
hash: string; hash: string;
name?: string | null; name?: string | null;
className?: string; className?: string;
logoSize?: number;
} }
const TokenSnippet = ({ symbol, hash, name, className }: Props) => { const TokenSnippet = ({ symbol, hash, name, className, logoSize = 6 }: Props) => {
return ( return (
<Flex className={ className } alignItems="center" columnGap={ 1 } w="100%"> <Flex className={ className } alignItems="center" columnGap={ 2 } w="100%">
<TokenLogo boxSize={ 5 } hash={ hash } name={ name }/> <TokenLogo boxSize={ logoSize } hash={ hash } name={ name }/>
<AddressLink hash={ hash } alias={ name } type="token"/> <AddressLink hash={ hash } alias={ name } type="token"/>
{ symbol && <Text variant="secondary">({ symbol })</Text> } { symbol && <Text variant="secondary">({ symbol })</Text> }
</Flex> </Flex>
......
...@@ -26,7 +26,7 @@ const NftTokenTransferSnippet = ({ value, name, hash, symbol, tokenId }: Props) ...@@ -26,7 +26,7 @@ const NftTokenTransferSnippet = ({ value, name, hash, symbol, tokenId }: Props)
<Link href={ url } fontWeight={ 600 }>{ tokenId }</Link> <Link href={ url } fontWeight={ 600 }>{ tokenId }</Link>
</Box> </Box>
{ name ? ( { name ? (
<TokenSnippet symbol={ symbol } hash={ hash } name={ name } w="auto"/> <TokenSnippet symbol={ symbol } hash={ hash } name={ name } w="auto" logoSize={ 5 } columnGap={ 1 }/>
) : ( ) : (
<AddressLink hash={ hash } truncation="constant" type="token"/> <AddressLink hash={ hash } truncation="constant" type="token"/>
) } ) }
......
...@@ -25,7 +25,15 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => { ...@@ -25,7 +25,15 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
<Text fontWeight={ 500 } as="span">For:{ space } <Text fontWeight={ 500 } as="span">For:{ space }
<CurrencyValue value={ payload.value } exchangeRate={ token.exchange_rate } fontWeight={ 600 }/> <CurrencyValue value={ payload.value } exchangeRate={ token.exchange_rate } fontWeight={ 600 }/>
</Text> </Text>
<TokenSnippet symbol={ token.symbol } hash={ token.address } name={ token.name } w="auto" flexGrow="1"/> <TokenSnippet
symbol={ token.symbol }
hash={ token.address }
name={ token.name }
w="auto"
flexGrow="1"
columnGap={ 1 }
logoSize={ 5 }
/>
</Flex> </Flex>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment