Commit 5b61cd3d authored by tom's avatar tom

fixes, thanks to pw

parent 7eb809cc
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.094 19.3c-.58 0-1.116-.223-1.517-.625l-5.936-5.94a2.13 2.13 0 0 1 0-3.036L9.585 1.75c.714-.714 2.008-1.25 2.99-1.25h5.088c1.16 0 2.142.982 2.142 2.143v5.091c0 .983-.536 2.278-1.25 2.992l-7.944 7.949a2.125 2.125 0 0 1-1.517.625Zm3.481-17.46c-.625 0-1.607.402-2.053.848l-7.944 7.949a.782.782 0 0 0 0 1.116l5.936 5.94c.312.312.848.312 1.115 0l7.944-7.95c.447-.446.848-1.384.848-2.053V2.599a.8.8 0 0 0-.803-.804h-5.043v.045Z" fill="currentColor"/>
<path d="M14.45 8.493a2.639 2.639 0 0 1-2.634-2.634 2.639 2.639 0 0 1 2.633-2.635 2.639 2.639 0 0 1 2.634 2.635 2.639 2.639 0 0 1-2.633 2.634Zm0-4.019a1.39 1.39 0 0 0-1.384 1.385c0 .759.625 1.384 1.383 1.384a1.39 1.39 0 0 0 1.384-1.384 1.39 1.39 0 0 0-1.383-1.385Z" fill="currentColor"/>
<svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.61 25a2.262 2.262 0 0 1-1.615-.665l-6.318-6.318a2.265 2.265 0 0 1 0-3.23l8.456-8.457c.76-.76 2.138-1.33 3.183-1.33h5.416c1.235 0 2.28 1.045 2.28 2.28v5.416c0 1.045-.57 2.423-1.33 3.183l-8.456 8.456A2.262 2.262 0 0 1 13.61 25Zm3.706-18.575c-.665 0-1.71.428-2.185.903l-8.456 8.456a.832.832 0 0 0 0 1.187l6.318 6.319c.332.332.902.332 1.188 0l8.456-8.456c.475-.475.902-1.473.902-2.185V7.232a.852.852 0 0 0-.855-.855h-5.368v.047Z" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
<path d="M19.311 13.504a2.808 2.808 0 0 1-2.803-2.803 2.808 2.808 0 0 1 2.803-2.803 2.808 2.808 0 0 1 2.803 2.803 2.808 2.808 0 0 1-2.803 2.803Zm0-4.276a1.48 1.48 0 0 0-1.473 1.473 1.48 1.48 0 0 0 1.473 1.473 1.48 1.48 0 0 0 1.473-1.473 1.48 1.48 0 0 0-1.473-1.473Z" fill="currentColor" stroke="currentColor" stroke-width=".5"/>
</svg>
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.094 19.3c-.58 0-1.116-.223-1.517-.625l-5.936-5.94a2.13 2.13 0 0 1 0-3.036L9.585 1.75c.714-.714 2.008-1.25 2.99-1.25h5.088c1.16 0 2.142.982 2.142 2.143v5.091c0 .983-.536 2.278-1.25 2.992l-7.944 7.949a2.125 2.125 0 0 1-1.517.625Zm3.481-17.46c-.625 0-1.607.402-2.053.848l-7.944 7.949a.782.782 0 0 0 0 1.116l5.936 5.94c.312.312.848.312 1.115 0l7.944-7.95c.447-.446.848-1.384.848-2.053V2.599a.8.8 0 0 0-.803-.804h-5.043v.045Z" fill="currentColor"/>
<path d="M14.45 8.493a2.639 2.639 0 0 1-2.634-2.634 2.639 2.639 0 0 1 2.633-2.635 2.639 2.639 0 0 1 2.634 2.635 2.639 2.639 0 0 1-2.633 2.634Zm0-4.019a1.39 1.39 0 0 0-1.384 1.385 1.39 1.39 0 0 0 1.383 1.384 1.39 1.39 0 0 0 1.384-1.384 1.39 1.39 0 0 0-1.383-1.385Z" fill="currentColor"/>
</svg>
......@@ -102,10 +102,9 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
address={{ hash: data.creator_address_hash }}
truncation="constant"
noIcon
noCopy
/>
<Text whiteSpace="pre"> at txn </Text>
<TxEntity hash={ data.creation_tx_hash } truncation="constant" noIcon/>
<TxEntity hash={ data.creation_tx_hash } truncation="constant" noIcon noCopy={ false }/>
</DetailsInfoItem>
) }
{ data.is_contract && data.implementation_address && (
......@@ -118,7 +117,6 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
address={{ hash: data.implementation_address, name: data.implementation_name, is_contract: true }}
isLoading={ addressQuery.isPlaceholderData }
noIcon
noCopy
/>
</DetailsInfoItem>
) }
......
......@@ -38,7 +38,7 @@ const coinPriceIndicator: TChainIndicator<'homepage_chart_market'> = {
id: 'coin_price',
title: `${ config.chain.currency.symbol } price`,
value: (stats) => '$' + Number(stats.coin_price).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 6 }),
icon: <TokenEntity.Icon token={ nativeTokenData } iconSize="24"/>,
icon: <TokenEntity.Icon token={ nativeTokenData } boxSize={ 6 } marginRight={ 0 }/>,
hint: `${ config.chain.currency.symbol } token daily price in USD.`,
api: {
resourceName: 'homepage_chart_market',
......
......@@ -5,7 +5,7 @@ import type { SearchResultItem } from 'types/api/search';
import { route } from 'nextjs-routes';
import labelIcon from 'icons/publictags.svg';
import labelIcon from 'icons/publictags_slim.svg';
import iconSuccess from 'icons/status/success.svg';
import verifiedToken from 'icons/verified_token.svg';
import dayjs from 'lib/date/dayjs';
......
......@@ -5,7 +5,7 @@ import type { SearchResultItem } from 'types/api/search';
import { route } from 'nextjs-routes';
import labelIcon from 'icons/publictags.svg';
import labelIcon from 'icons/publictags_slim.svg';
import iconSuccess from 'icons/status/success.svg';
import verifiedToken from 'icons/verified_token.svg';
import dayjs from 'lib/date/dayjs';
......
......@@ -22,7 +22,7 @@ const AddressHeadingInfo = ({ address, token, isLinkDisabled, isLoading }: Props
return (
<Flex alignItems="center">
<AddressEntity
address={ address }
address={{ ...address, name: '' }}
isLoading={ isLoading }
fontFamily="heading"
fontSize="lg"
......
export type IconSize = 'md' | 'lg' | '24';
export type IconSize = 'md' | 'lg';
export function getIconProps(size: IconSize = 'md') {
switch (size) {
......@@ -12,10 +12,5 @@ export function getIconProps(size: IconSize = 'md') {
boxSize: '30px', // for headings
};
}
case '24': {
return {
boxSize: '24px', // deprecated
};
}
}
}
import type { As } from '@chakra-ui/react';
import type { As, ChakraProps } from '@chakra-ui/react';
import { Image, Skeleton, chakra } from '@chakra-ui/react';
import _omit from 'lodash/omit';
import React from 'react';
......@@ -30,16 +30,18 @@ const Link = chakra((props: LinkProps) => {
type IconProps = Pick<EntityProps, 'token' | 'isLoading' | 'iconSize' | 'noIcon' | 'className'> & {
asProp?: As;
marginRight?: ChakraProps['marginRight'];
boxSize?: ChakraProps['boxSize'];
};
const Icon = chakra((props: IconProps) => {
const Icon = (props: IconProps) => {
if (props.noIcon) {
return null;
}
const styles = {
...getIconProps(props.iconSize),
marginRight: 2,
marginRight: props.marginRight ?? 2,
boxSize: props.boxSize ?? getIconProps(props.iconSize).boxSize,
borderRadius: 'base',
};
......@@ -56,7 +58,7 @@ const Icon = chakra((props: IconProps) => {
fallback={ <TokenLogoPlaceholder { ...styles }/> }
/>
);
});
};
type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps, 'token' | 'jointSymbol' | 'onlySymbol'>;
......
import { Box, Text, Grid, Flex } from '@chakra-ui/react';
import { Box, Text, Flex } from '@chakra-ui/react';
import React from 'react';
import type { SearchResultAddressOrContract } from 'types/api/search';
......@@ -35,7 +35,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm }: Props) => {
if (isMobile) {
return (
<>
<Grid templateColumns="24px 1fr">
<Flex alignItems="center">
{ icon }
<Box
as={ shouldHighlightHash ? 'mark' : 'span' }
......@@ -46,7 +46,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm }: Props) => {
>
{ address }
</Box>
</Grid>
</Flex>
{ name }
</>
);
......@@ -54,18 +54,18 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm }: Props) => {
return (
<Flex alignItems="center">
{ icon }
<Box
as={ shouldHighlightHash ? 'mark' : 'span' }
display="block"
overflow="hidden"
whiteSpace="nowrap"
fontWeight={ 700 }
w="450px"
mr={ 2 }
>
{ address }
</Box>
<Flex alignItems="center" w="450px" mr={ 2 }>
{ icon }
<Box
as={ shouldHighlightHash ? 'mark' : 'span' }
display="block"
overflow="hidden"
whiteSpace="nowrap"
fontWeight={ 700 }
>
{ address }
</Box>
</Flex>
{ name }
</Flex>
);
......
......@@ -3,7 +3,7 @@ import React from 'react';
import type { SearchResultLabel } from 'types/api/search';
import labelIcon from 'icons/publictags.svg';
import labelIcon from 'icons/publictags_slim.svg';
import iconSuccess from 'icons/status/success.svg';
import highlightText from 'lib/highlightText';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
......
......@@ -56,7 +56,7 @@ const TokensTableItem = ({
</Skeleton>
</GridItem>
</Grid>
<Flex justifyContent="space-between" alignItems="center" width="150px" ml={ 8 } mt={ -2 }>
<Flex justifyContent="space-between" alignItems="center" width="150px" ml={ 7 } mt={ -2 }>
<AddressEntity
address={{ hash: address }}
isLoading={ isLoading }
......
......@@ -65,7 +65,7 @@ const TokensTableItem = ({
fontSize="sm"
fontWeight="700"
/>
<Box ml={ 8 } mt={ 2 }>
<Box ml={ 7 } mt={ 2 }>
<Flex>
<AddressEntity
address={ tokenAddress }
......
......@@ -250,7 +250,7 @@ const TxDetails = () => {
isLoading={ isPlaceholderData }
noIcon
/>
<span> created]</span>
<span>created]</span>
{ executionSuccessBadge }
{ executionFailedBadge }
</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