Commit 58b6067b authored by tom's avatar tom

refactor Merits dashboard and Entities components

parent 69ca5430
...@@ -4,12 +4,12 @@ import React from 'react'; ...@@ -4,12 +4,12 @@ import React from 'react';
import PageNextJs from 'nextjs/PageNextJs'; import PageNextJs from 'nextjs/PageNextJs';
// const RewardsDashboard = dynamic(() => import('ui/pages/RewardsDashboard'), { ssr: false }); const RewardsDashboard = dynamic(() => import('ui/pages/RewardsDashboard'), { ssr: false });
const Page: NextPage = () => { const Page: NextPage = () => {
return ( return (
<PageNextJs pathname="/account/merits"> <PageNextJs pathname="/account/merits">
{ /* <RewardsDashboard/> */ } <RewardsDashboard/>
</PageNextJs> </PageNextJs>
); );
}; };
......
import type { SmartContractLicenseType } from 'types/api/contract'; import type { SmartContractLicenseType } from 'types/api/contract';
import type { SmartContractVerificationMethod } from 'types/client/contract'; import type { SmartContractVerificationMethod } from 'types/client/contract';
import type { Option } from 'ui/shared/forms/inputs/select/types';
import type { SelectOption } from 'toolkit/chakra/select';
export interface ContractLibrary { export interface ContractLibrary {
name: string; name: string;
...@@ -50,7 +51,7 @@ export interface FormFieldsStandardInputZk extends FormFieldsBase { ...@@ -50,7 +51,7 @@ export interface FormFieldsStandardInputZk extends FormFieldsBase {
export interface FormFieldsSourcify extends FormFieldsBase { export interface FormFieldsSourcify extends FormFieldsBase {
sources: Array<File>; sources: Array<File>;
contract_index?: Option; contract_index?: SelectOption;
} }
export interface FormFieldsMultiPartFile extends FormFieldsBase { export interface FormFieldsMultiPartFile extends FormFieldsBase {
......
...@@ -379,9 +379,7 @@ const AddressPageContent = () => { ...@@ -379,9 +379,7 @@ const AddressPageContent = () => {
<EnsEntity <EnsEntity
domain={ addressQuery.data?.ens_domain_name } domain={ addressQuery.data?.ens_domain_name }
protocol={ !addressEnsDomainsQuery.isPending ? addressMainDomain?.protocol : null } protocol={ !addressEnsDomainsQuery.isPending ? addressMainDomain?.protocol : null }
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
mr={ 1 } mr={ 1 }
maxW="300px" maxW="300px"
/> />
...@@ -395,9 +393,7 @@ const AddressPageContent = () => { ...@@ -395,9 +393,7 @@ const AddressPageContent = () => {
implementations: null, implementations: null,
}} }}
isLoading={ isLoading } isLoading={ isLoading }
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
noLink noLink
isSafeAddress={ isSafeAddress } isSafeAddress={ isSafeAddress }
icon={{ color: isSafeAddress ? { _light: 'black', _dark: 'white' } : undefined }} icon={{ color: isSafeAddress ? { _light: 'black', _dark: 'white' } : undefined }}
......
...@@ -41,7 +41,7 @@ const BlobPageContent = () => { ...@@ -41,7 +41,7 @@ const BlobPageContent = () => {
})(); })();
const titleSecondRow = ( const titleSecondRow = (
<BlobEntity hash={ hash } noLink fontWeight={ 500 } fontFamily="heading"/> <BlobEntity hash={ hash } noLink variant="subheading"/>
); );
return ( return (
......
...@@ -89,9 +89,7 @@ const ContractVerificationForAddress = () => { ...@@ -89,9 +89,7 @@ const ContractVerificationForAddress = () => {
<AddressEntity <AddressEntity
address={{ hash, is_contract: true }} address={{ hash, is_contract: true }}
noLink noLink
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
mb={ 12 } mb={ 12 }
w="min-content" w="min-content"
maxW="100%" maxW="100%"
......
...@@ -50,9 +50,6 @@ const NameDomain = () => { ...@@ -50,9 +50,6 @@ const NameDomain = () => {
<Flex <Flex
columnGap={ 3 } columnGap={ 3 }
rowGap={ 3 } rowGap={ 3 }
fontFamily="heading"
fontSize="lg"
fontWeight={ 500 }
alignItems="center" alignItems="center"
w="100%" w="100%"
flexWrap={{ base: 'wrap', lg: 'nowrap' }} flexWrap={{ base: 'wrap', lg: 'nowrap' }}
...@@ -63,12 +60,14 @@ const NameDomain = () => { ...@@ -63,12 +60,14 @@ const NameDomain = () => {
isLoading={ isLoading } isLoading={ isLoading }
noLink noLink
maxW={{ lg: infoQuery.data?.resolved_address ? '300px' : 'max-content' }} maxW={{ lg: infoQuery.data?.resolved_address ? '300px' : 'max-content' }}
variant="subheading"
/> />
{ infoQuery.data?.resolved_address && ( { infoQuery.data?.resolved_address && (
<Flex alignItems="center" maxW="100%" columnGap={ 3 }> <Flex alignItems="center" maxW="100%" columnGap={ 3 }>
<AddressEntity <AddressEntity
address={ infoQuery.data?.resolved_address } address={ infoQuery.data?.resolved_address }
isLoading={ isLoading } isLoading={ isLoading }
variant="subheading"
/> />
<Tooltip content="Lookup for related domain names"> <Tooltip content="Lookup for related domain names">
<Link <Link
......
...@@ -124,7 +124,7 @@ const Pool = () => { ...@@ -124,7 +124,7 @@ const Pool = () => {
<PoolEntity.Icon <PoolEntity.Icon
pool={ data } pool={ data }
isLoading={ isPlaceholderData } isLoading={ isPlaceholderData }
size="lg" variant="heading"
/> />
) : null } ) : null }
contentAfter={ <Skeleton loading={ isPlaceholderData }><Tag>Pool</Tag></Skeleton> } contentAfter={ <Skeleton loading={ isPlaceholderData }><Tag>Pool</Tag></Skeleton> }
......
import { Flex, Image, Alert } from '@chakra-ui/react'; import { Flex } from '@chakra-ui/react';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import config from 'configs/app'; import config from 'configs/app';
import { useRewardsContext } from 'lib/contexts/rewards'; import { useRewardsContext } from 'lib/contexts/rewards';
import { apos } from 'lib/html-entities'; import { apos } from 'lib/html-entities';
import { Alert } from 'toolkit/chakra/alert';
import { Image } from 'toolkit/chakra/image';
import { Link } from 'toolkit/chakra/link';
import { Skeleton } from 'toolkit/chakra/skeleton';
import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton'; import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton';
import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard'; import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard';
import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue'; import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue';
import RewardsReadOnlyInputWithCopy from 'ui/rewards/RewardsReadOnlyInputWithCopy'; import RewardsReadOnlyInputWithCopy from 'ui/rewards/RewardsReadOnlyInputWithCopy';
import AdBanner from 'ui/shared/ad/AdBanner'; import AdBanner from 'ui/shared/ad/AdBanner';
import Skeleton from 'ui/shared/chakra/Skeleton';
import LinkExternal from 'ui/shared/links/LinkExternal';
import PageTitle from 'ui/shared/Page/PageTitle'; import PageTitle from 'ui/shared/Page/PageTitle';
import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken'; import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken';
...@@ -51,9 +53,9 @@ const RewardsDashboard = () => { ...@@ -51,9 +53,9 @@ const RewardsDashboard = () => {
<span> <span>
The Blockscout Merits Program is just getting started! Learn more about the details, The Blockscout Merits Program is just getting started! Learn more about the details,
features, and future plans in our{ ' ' } features, and future plans in our{ ' ' }
<LinkExternal href="https://www.blog.blockscout.com/blockscout-merits-rewarding-block-explorer-skills"> <Link external href="https://www.blog.blockscout.com/blockscout-merits-rewarding-block-explorer-skills">
blog post blog post
</LinkExternal>. </Link>.
</span> </span>
) } ) }
/> />
...@@ -76,9 +78,9 @@ const RewardsDashboard = () => { ...@@ -76,9 +78,9 @@ const RewardsDashboard = () => {
hint={ ( hint={ (
<> <>
Total number of Merits earned from all activities.{ ' ' } Total number of Merits earned from all activities.{ ' ' }
<LinkExternal href="https://docs.blockscout.com/using-blockscout/merits"> <Link external href="https://docs.blockscout.com/using-blockscout/merits">
More info on Merits More info on Merits
</LinkExternal> </Link>
</> </>
) } ) }
/> />
...@@ -103,12 +105,9 @@ const RewardsDashboard = () => { ...@@ -103,12 +105,9 @@ const RewardsDashboard = () => {
<> <>
Current number of consecutive days you{ apos }ve claimed your daily Merits.{ ' ' } Current number of consecutive days you{ apos }ve claimed your daily Merits.{ ' ' }
The longer your streak, the more daily Merits you can earn.{ ' ' } The longer your streak, the more daily Merits you can earn.{ ' ' }
<LinkExternal <Link external href={ `https://x.com/intent/tweet?text=${ encodeURIComponent(shareText) }` } fontWeight="500">
href={ `https://x.com/intent/tweet?text=${ encodeURIComponent(shareText) }` }
fontWeight="500"
>
Share on X Share on X
</LinkExternal> </Link>
</> </>
) } ) }
direction="column-reverse" direction="column-reverse"
...@@ -124,12 +123,9 @@ const RewardsDashboard = () => { ...@@ -124,12 +123,9 @@ const RewardsDashboard = () => {
hint={ ( hint={ (
<> <>
See the{ ' ' } See the{ ' ' }
<LinkExternal <Link external href="https://docs.blockscout.com/using-blockscout/merits/streak-rewards">
href="https://docs.blockscout.com/using-blockscout/merits/streak-rewards"
isExternal
>
docs docs
</LinkExternal>{ ' ' } </Link>{ ' ' }
to learn how your streak number affects daily rewards to learn how your streak number affects daily rewards
</> </>
) } ) }
...@@ -142,7 +138,7 @@ const RewardsDashboard = () => { ...@@ -142,7 +138,7 @@ const RewardsDashboard = () => {
description={ ( description={ (
<> <>
Refer friends and boost your Merits! You receive a{ ' ' } Refer friends and boost your Merits! You receive a{ ' ' }
<Skeleton as="span" isLoaded={ !rewardsConfigQuery.isPending }> <Skeleton as="span" loading={ rewardsConfigQuery.isPending }>
{ rewardsConfigQuery.data?.rewards.referral_share ? { rewardsConfigQuery.data?.rewards.referral_share ?
`${ Number(rewardsConfigQuery.data?.rewards.referral_share) * 100 }%` : `${ Number(rewardsConfigQuery.data?.rewards.referral_share) * 100 }%` :
'N/A' 'N/A'
...@@ -199,15 +195,16 @@ const RewardsDashboard = () => { ...@@ -199,15 +195,16 @@ const RewardsDashboard = () => {
alt="Badges" alt="Badges"
w="260px" w="260px"
h="86px" h="86px"
fallback={ <Skeleton w="260px" h="86px"/> } fallback={ <Skeleton loading w="260px" h="86px"/> }
/> />
<LinkExternal <Link
external
href="https://merits.blockscout.com/?tab=badges&utm_source=blockscout&utm_medium=dashboard" href="https://merits.blockscout.com/?tab=badges&utm_source=blockscout&utm_medium=dashboard"
fontSize="md" textStyle="md"
fontWeight="500" fontWeight="500"
> >
View badges View badges
</LinkExternal> </Link>
</Flex> </Flex>
</RewardsDashboardCard> </RewardsDashboardCard>
</Flex> </Flex>
......
...@@ -45,9 +45,6 @@ const ValidatorZilliqa = () => { ...@@ -45,9 +45,6 @@ const ValidatorZilliqa = () => {
<Flex <Flex
columnGap={ 3 } columnGap={ 3 }
rowGap={ 3 } rowGap={ 3 }
fontFamily="heading"
fontSize="lg"
fontWeight={ 500 }
alignItems="center" alignItems="center"
w="100%" w="100%"
flexWrap={{ base: 'wrap', lg: 'nowrap' }} flexWrap={{ base: 'wrap', lg: 'nowrap' }}
...@@ -55,6 +52,7 @@ const ValidatorZilliqa = () => { ...@@ -55,6 +52,7 @@ const ValidatorZilliqa = () => {
<ValidatorEntity <ValidatorEntity
id={ query.data?.bls_public_key ?? '' } id={ query.data?.bls_public_key ?? '' }
isLoading={ isLoading } isLoading={ isLoading }
variant="subheading"
noLink noLink
/> />
</Flex> </Flex>
......
import type { AddressMetadataTagType } from 'types/api/addressMetadata'; import type { AddressMetadataTagType } from 'types/api/addressMetadata';
import type { Option } from 'ui/shared/forms/inputs/select/types';
import type { SelectOption } from 'toolkit/chakra/select';
export interface FormFields { export interface FormFields {
requesterName: string; requesterName: string;
...@@ -13,7 +14,7 @@ export interface FormFields { ...@@ -13,7 +14,7 @@ export interface FormFields {
export interface FormFieldTag { export interface FormFieldTag {
name: string; name: string;
type: Array<Option<AddressMetadataTagType>>; type: Array<SelectOption<AddressMetadataTagType>>;
url: string | undefined; url: string | undefined;
bgColor: string | undefined; bgColor: string | undefined;
textColor: string | undefined; textColor: string | undefined;
......
import { Button, useBoolean, Flex, useColorModeValue } from '@chakra-ui/react'; import { Flex } from '@chakra-ui/react';
import React, { useCallback, useEffect, useMemo } from 'react'; import React, { useCallback, useEffect, useMemo } from 'react';
import { SECOND } from 'lib/consts'; import { SECOND } from 'lib/consts';
import { useRewardsContext } from 'lib/contexts/rewards'; import { useRewardsContext } from 'lib/contexts/rewards';
import { Button } from 'toolkit/chakra/button';
import splitSecondsInPeriods from 'ui/blockCountdown/splitSecondsInPeriods'; import splitSecondsInPeriods from 'ui/blockCountdown/splitSecondsInPeriods';
const DailyRewardClaimButton = () => { const DailyRewardClaimButton = () => {
const { balancesQuery, dailyRewardQuery, claim } = useRewardsContext(); const { balancesQuery, dailyRewardQuery, claim } = useRewardsContext();
const [ isClaiming, setIsClaiming ] = useBoolean(false); const [ isClaiming, setIsClaiming ] = React.useState(false);
const [ timeLeft, setTimeLeft ] = React.useState<string>(''); const [ timeLeft, setTimeLeft ] = React.useState<string>('');
const dailyRewardValue = useMemo(() => const dailyRewardValue = useMemo(() =>
...@@ -17,7 +18,7 @@ const DailyRewardClaimButton = () => { ...@@ -17,7 +18,7 @@ const DailyRewardClaimButton = () => {
[ dailyRewardQuery.data ]); [ dailyRewardQuery.data ]);
const handleClaim = useCallback(async() => { const handleClaim = useCallback(async() => {
setIsClaiming.on(); setIsClaiming(true);
try { try {
await claim(); await claim();
await Promise.all([ await Promise.all([
...@@ -25,7 +26,7 @@ const DailyRewardClaimButton = () => { ...@@ -25,7 +26,7 @@ const DailyRewardClaimButton = () => {
dailyRewardQuery.refetch(), dailyRewardQuery.refetch(),
]); ]);
} catch (error) {} } catch (error) {}
setIsClaiming.off(); setIsClaiming(false);
}, [ claim, setIsClaiming, balancesQuery, dailyRewardQuery ]); }, [ claim, setIsClaiming, balancesQuery, dailyRewardQuery ]);
useEffect(() => { useEffect(() => {
...@@ -63,7 +64,6 @@ const DailyRewardClaimButton = () => { ...@@ -63,7 +64,6 @@ const DailyRewardClaimButton = () => {
}, [ dailyRewardQuery ]); }, [ dailyRewardQuery ]);
const isLoading = isClaiming || dailyRewardQuery.isPending || dailyRewardQuery.isFetching; const isLoading = isClaiming || dailyRewardQuery.isPending || dailyRewardQuery.isFetching;
const timerBgColor = useColorModeValue('gray.200', 'gray.800');
return !isLoading && !dailyRewardQuery.data?.available ? ( return !isLoading && !dailyRewardQuery.data?.available ? (
<Flex <Flex
...@@ -72,7 +72,7 @@ const DailyRewardClaimButton = () => { ...@@ -72,7 +72,7 @@ const DailyRewardClaimButton = () => {
justifyContent="center" justifyContent="center"
borderRadius="base" borderRadius="base"
color="gray.500" color="gray.500"
bgColor={ timerBgColor } bgColor={{ _light: 'gray.200', _dark: 'gray.800' }}
fontSize="md" fontSize="md"
fontWeight="600" fontWeight="600"
cursor="default" cursor="default"
...@@ -80,7 +80,7 @@ const DailyRewardClaimButton = () => { ...@@ -80,7 +80,7 @@ const DailyRewardClaimButton = () => {
Next claim in { timeLeft || 'N/A' } Next claim in { timeLeft || 'N/A' }
</Flex> </Flex>
) : ( ) : (
<Button onClick={ handleClaim } isLoading={ isLoading }> <Button onClick={ handleClaim } loading={ isLoading }>
Claim { dailyRewardValue } Merits Claim { dailyRewardValue } Merits
</Button> </Button>
); );
......
import { Flex, Text, useColorModeValue, Tag } from '@chakra-ui/react'; import { Flex, Text } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import { Badge } from 'toolkit/chakra/badge';
type Props = { type Props = {
title?: string; title?: string;
description: string | React.ReactNode; description: string | React.ReactNode;
...@@ -22,7 +24,7 @@ const RewardsDashboardCard = ({ ...@@ -22,7 +24,7 @@ const RewardsDashboardCard = ({
justifyContent={ direction === 'column-reverse' ? 'flex-end' : 'flex-start' } justifyContent={ direction === 'column-reverse' ? 'flex-end' : 'flex-start' }
p={{ base: 1.5, md: 2 }} p={{ base: 1.5, md: 2 }}
border="1px solid" border="1px solid"
borderColor={ useColorModeValue('gray.200', 'whiteAlpha.200') } borderColor={{ _light: 'gray.200', _dark: 'whiteAlpha.200' }}
borderRadius="lg" borderRadius="lg"
gap={{ base: 1, md: direction === 'row' ? 10 : 1 }} gap={{ base: 1, md: direction === 'row' ? 10 : 1 }}
w={ direction === 'row' ? 'full' : 'auto' } w={ direction === 'row' ? 'full' : 'auto' }
...@@ -37,7 +39,7 @@ const RewardsDashboardCard = ({ ...@@ -37,7 +39,7 @@ const RewardsDashboardCard = ({
{ title && ( { title && (
<Flex alignItems="center" gap={ 2 }> <Flex alignItems="center" gap={ 2 }>
<Text fontSize={{ base: 'md', md: 'lg' }} fontWeight="500">{ title }</Text> <Text fontSize={{ base: 'md', md: 'lg' }} fontWeight="500">{ title }</Text>
{ availableSoon && <Tag colorScheme="blue">Available soon</Tag> } { availableSoon && <Badge colorPalette="blue">Available soon</Badge> }
</Flex> </Flex>
) } ) }
<Text as="div" fontSize="sm"> <Text as="div" fontSize="sm">
...@@ -49,7 +51,7 @@ const RewardsDashboardCard = ({ ...@@ -49,7 +51,7 @@ const RewardsDashboardCard = ({
alignItems="center" alignItems="center"
justifyContent="space-around" justifyContent="space-around"
borderRadius={{ base: 'lg', md: '8px' }} borderRadius={{ base: 'lg', md: '8px' }}
backgroundColor={ useColorModeValue('gray.50', 'whiteAlpha.50') } backgroundColor={{ _light: 'gray.50', _dark: 'whiteAlpha.50' }}
minH={{ base: '80px', md: '128px' }} minH={{ base: '80px', md: '128px' }}
filter="auto" filter="auto"
blur={ blurFilter ? '4px' : '0' } blur={ blurFilter ? '4px' : '0' }
......
import { Flex, Text } from '@chakra-ui/react'; import { Flex, Text } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import Skeleton from 'ui/shared/chakra/Skeleton'; import { Skeleton } from 'toolkit/chakra/skeleton';
import HintPopover from 'ui/shared/HintPopover'; import Hint from 'ui/shared/Hint';
import MeritsIcon from '../MeritsIcon'; import MeritsIcon from '../MeritsIcon';
...@@ -18,18 +18,14 @@ const RewardsDashboardCard = ({ label, value, withIcon, hint, isLoading }: Props ...@@ -18,18 +18,14 @@ const RewardsDashboardCard = ({ label, value, withIcon, hint, isLoading }: Props
<Flex key={ label } flexDirection="column" alignItems="center" gap={ 2 }> <Flex key={ label } flexDirection="column" alignItems="center" gap={ 2 }>
<Flex alignItems="center" gap={ 1 }> <Flex alignItems="center" gap={ 1 }>
{ hint && ( { hint && (
<HintPopover <Hint label={ hint }/>
label={ hint }
popoverContentProps={{ maxW: { base: 'calc(100vw - 8px)', lg: '210px' } }}
popoverBodyProps={{ textAlign: 'center' }}
/>
) } ) }
<Text fontSize="xs" fontWeight="500" variant="secondary"> <Text fontSize="xs" fontWeight="500" color="text.secondary">
{ label } { label }
</Text> </Text>
</Flex> </Flex>
<Skeleton <Skeleton
isLoaded={ !isLoading } loading={ isLoading }
display="flex" display="flex"
alignItems="center" alignItems="center"
justifyContent="center" justifyContent="center"
......
...@@ -46,9 +46,7 @@ const DefaultView = () => { ...@@ -46,9 +46,7 @@ const DefaultView = () => {
<> <>
<AddressEntity <AddressEntity
address={{ ...addressMock.token, name: '' }} address={{ ...addressMock.token, name: '' }}
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
/> />
<NetworkExplorers type="token" pathParam={ addressMock.hash } ml="auto"/> <NetworkExplorers type="token" pathParam={ addressMock.hash } ml="auto"/>
</> </>
...@@ -60,7 +58,7 @@ const DefaultView = () => { ...@@ -60,7 +58,7 @@ const DefaultView = () => {
beforeTitle={ ( beforeTitle={ (
<TokenEntity.Icon <TokenEntity.Icon
token={ tokenData } token={ tokenData }
size="lg" variant="heading"
/> />
) } ) }
backLink={ backLink } backLink={ backLink }
......
...@@ -52,7 +52,7 @@ const LongNameAndManyTags = () => { ...@@ -52,7 +52,7 @@ const LongNameAndManyTags = () => {
beforeTitle={ ( beforeTitle={ (
<TokenEntity.Icon <TokenEntity.Icon
token={ tokenData } token={ tokenData }
size="lg" variant="heading"
/> />
) } ) }
contentAfter={ contentAfter } contentAfter={ contentAfter }
......
...@@ -29,7 +29,7 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => { ...@@ -29,7 +29,7 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
hash={ token.address } hash={ token.address }
id={ tokenId } id={ tokenId }
fontWeight={ 600 } fontWeight={ 600 }
icon={{ size: 'md' }} variant="content"
maxW={{ base: '100%', lg: '150px' }} maxW={{ base: '100%', lg: '150px' }}
w="auto" w="auto"
flexShrink={ 0 } flexShrink={ 0 }
......
...@@ -13,17 +13,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -13,17 +13,17 @@ import { test, expect } from 'playwright/lib';
import AddressEntity from './AddressEntity'; import AddressEntity from './AddressEntity';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 180, height: 140 } }); test.use({ viewport: { width: 180, height: 140 } });
test.describe('icon size', () => { test.describe('variant', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<AddressEntity <AddressEntity
address={ addressMock.withoutName } address={ addressMock.withoutName }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -12,7 +12,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -12,7 +12,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import { Tooltip } from 'toolkit/chakra/tooltip'; import { Tooltip } from 'toolkit/chakra/tooltip';
import * as EntityBase from 'ui/shared/entities/base/components'; import * as EntityBase from 'ui/shared/entities/base/components';
import { distributeEntityProps, getIconProps } from '../base/utils'; import { distributeEntityProps, getContentProps, getIconProps } from '../base/utils';
import AddressEntityContentProxy from './AddressEntityContentProxy'; import AddressEntityContentProxy from './AddressEntityContentProxy';
import AddressIconDelegated from './AddressIconDelegated'; import AddressIconDelegated from './AddressIconDelegated';
import AddressIdenticon from './AddressIdenticon'; import AddressIdenticon from './AddressIdenticon';
...@@ -44,7 +44,7 @@ const Icon = (props: IconProps) => { ...@@ -44,7 +44,7 @@ const Icon = (props: IconProps) => {
} }
const styles = { const styles = {
...getIconProps(props.size), ...getIconProps(props.variant),
marginRight: props.marginRight ?? 2, marginRight: props.marginRight ?? 2,
}; };
...@@ -90,10 +90,10 @@ const Icon = (props: IconProps) => { ...@@ -90,10 +90,10 @@ const Icon = (props: IconProps) => {
})(); })();
return ( return (
<Tooltip content={ label }> <Tooltip content={ label } disabled={ !label }>
<Flex marginRight={ styles.marginRight } position="relative"> <Flex marginRight={ styles.marginRight } position="relative">
<AddressIdenticon <AddressIdenticon
size={ props.size === 'lg' ? 30 : 20 } size={ props.variant === 'heading' ? 30 : 20 }
hash={ getDisplayedAddress(props.address) } hash={ getDisplayedAddress(props.address) }
/> />
{ isDelegatedAddress && <AddressIconDelegated isVerified={ Boolean(props.address.is_verified) }/> } { isDelegatedAddress && <AddressIconDelegated isVerified={ Boolean(props.address.is_verified) }/> }
...@@ -116,6 +116,8 @@ const Content = chakra((props: ContentProps) => { ...@@ -116,6 +116,8 @@ const Content = chakra((props: ContentProps) => {
} }
if (nameText) { if (nameText) {
const styles = getContentProps(props.variant);
const label = ( const label = (
<VStack gap={ 0 } py={ 1 } color="inherit"> <VStack gap={ 0 } py={ 1 } color="inherit">
<Box fontWeight={ 600 } whiteSpace="pre-wrap" wordBreak="break-word">{ nameText }</Box> <Box fontWeight={ 600 } whiteSpace="pre-wrap" wordBreak="break-word">{ nameText }</Box>
...@@ -127,7 +129,7 @@ const Content = chakra((props: ContentProps) => { ...@@ -127,7 +129,7 @@ const Content = chakra((props: ContentProps) => {
return ( return (
<Tooltip content={ label } contentProps={{ maxW: { base: 'calc(100vw - 8px)', lg: '400px' } }}> <Tooltip content={ label } contentProps={{ maxW: { base: 'calc(100vw - 8px)', lg: '400px' } }}>
<Skeleton loading={ props.isLoading } overflow="hidden" textOverflow="ellipsis" whiteSpace="nowrap"> <Skeleton loading={ props.isLoading } overflow="hidden" textOverflow="ellipsis" whiteSpace="nowrap" { ...styles }>
{ nameText } { nameText }
</Skeleton> </Skeleton>
</Tooltip> </Tooltip>
......
...@@ -10,8 +10,9 @@ import HashStringShorten from 'ui/shared/HashStringShorten'; ...@@ -10,8 +10,9 @@ import HashStringShorten from 'ui/shared/HashStringShorten';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic'; import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import type { IconName } from 'ui/shared/IconSvg'; import type { IconName } from 'ui/shared/IconSvg';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import TruncatedValue from 'ui/shared/TruncatedValue';
import { getIconProps, type IconSize } from './utils'; import { getContentProps, getIconProps } from './utils';
export type Truncation = 'constant' | 'constant_long' | 'dynamic' | 'tail' | 'none'; export type Truncation = 'constant' | 'constant_long' | 'dynamic' | 'tail' | 'none';
...@@ -30,7 +31,7 @@ export interface EntityBaseProps { ...@@ -30,7 +31,7 @@ export interface EntityBaseProps {
tailLength?: number; tailLength?: number;
target?: React.HTMLAttributeAnchorTarget; target?: React.HTMLAttributeAnchorTarget;
truncation?: Truncation; truncation?: Truncation;
size?: 'md' | 'lg'; variant?: 'content' | 'heading' | 'subheading';
} }
export interface ContainerBaseProps extends Pick<EntityBaseProps, 'className'> { export interface ContainerBaseProps extends Pick<EntityBaseProps, 'className'> {
...@@ -82,17 +83,16 @@ const Link = chakra(({ isLoading, children, isExternal, onClick, href, noLink }: ...@@ -82,17 +83,16 @@ const Link = chakra(({ isLoading, children, isExternal, onClick, href, noLink }:
interface EntityIconProps extends Pick<IconProps, 'color' | 'borderRadius' | 'marginRight' | 'boxSize'> { interface EntityIconProps extends Pick<IconProps, 'color' | 'borderRadius' | 'marginRight' | 'boxSize'> {
name?: IconName; name?: IconName;
size?: IconSize;
} }
export interface IconBaseProps extends Pick<EntityBaseProps, 'isLoading' | 'noIcon'>, EntityIconProps {} export interface IconBaseProps extends Pick<EntityBaseProps, 'isLoading' | 'noIcon' | 'variant'>, EntityIconProps {}
const Icon = ({ isLoading, noIcon, size, name, color, borderRadius, marginRight, boxSize }: IconBaseProps) => { const Icon = ({ isLoading, noIcon, variant, name, color, borderRadius, marginRight, boxSize }: IconBaseProps) => {
if (noIcon || !name) { if (noIcon || !name) {
return null; return null;
} }
const styles = getIconProps(size); const styles = getIconProps(variant);
return ( return (
<IconSvg <IconSvg
name={ name } name={ name }
...@@ -108,12 +108,24 @@ const Icon = ({ isLoading, noIcon, size, name, color, borderRadius, marginRight, ...@@ -108,12 +108,24 @@ const Icon = ({ isLoading, noIcon, size, name, color, borderRadius, marginRight,
); );
}; };
export interface ContentBaseProps extends Pick<EntityBaseProps, 'className' | 'isLoading' | 'truncation' | 'tailLength' | 'isTooltipDisabled'> { export interface ContentBaseProps extends Pick<EntityBaseProps, 'className' | 'isLoading' | 'truncation' | 'tailLength' | 'isTooltipDisabled' | 'variant'> {
asProp?: React.ElementType; asProp?: React.ElementType;
text: string; text: string;
} }
const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dynamic', tailLength, isTooltipDisabled }: ContentBaseProps) => { const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dynamic', tailLength, isTooltipDisabled, variant }: ContentBaseProps) => {
const styles = getContentProps(variant);
if (truncation === 'tail') {
return (
<TruncatedValue
className={ className }
isLoading={ isLoading }
value={ text }
{ ...styles }
/>
);
}
const children = (() => { const children = (() => {
switch (truncation) { switch (truncation) {
...@@ -143,7 +155,6 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna ...@@ -143,7 +155,6 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna
isTooltipDisabled={ isTooltipDisabled } isTooltipDisabled={ isTooltipDisabled }
/> />
); );
case 'tail':
case 'none': case 'none':
return <chakra.span as={ asProp }>{ text }</chakra.span>; return <chakra.span as={ asProp }>{ text }</chakra.span>;
} }
...@@ -155,18 +166,18 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna ...@@ -155,18 +166,18 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna
loading={ isLoading } loading={ isLoading }
overflow="hidden" overflow="hidden"
whiteSpace="nowrap" whiteSpace="nowrap"
textOverflow={ truncation === 'tail' ? 'ellipsis' : undefined }
w="100%" w="100%"
{ ...styles }
> >
{ children } { children }
</Skeleton> </Skeleton>
); );
}); });
export type CopyBaseProps = Pick<CopyToClipboardProps, 'isLoading' | 'text'> & Pick<EntityBaseProps, 'noCopy' | 'size'>; export type CopyBaseProps = Pick<CopyToClipboardProps, 'isLoading' | 'text'> & Pick<EntityBaseProps, 'noCopy'>;
const Copy = ({ size, ...props }: CopyBaseProps) => { const Copy = ({ noCopy, ...props }: CopyBaseProps) => {
if (props.noCopy) { if (noCopy) {
return null; return null;
} }
......
import type { EntityBaseProps } from './components'; import type { EntityBaseProps } from './components';
export type IconSize = 'md' | 'lg'; export function getIconProps(variant: EntityBaseProps['variant'] = 'content') {
switch (variant) {
export function getIconProps(size: IconSize = 'md') { case 'content':
switch (size) { case 'subheading': {
case 'md': { return {
boxSize: '20px', // for tables, lists, regular content and page subheadings
};
}
case 'heading': {
return { return {
boxSize: '20px', // for tables, lists and regular content boxSize: '30px', // for page headings
}; };
} }
case 'lg': { }
}
export function getContentProps(variant: EntityBaseProps['variant'] = 'content') {
switch (variant) {
// currently, there could be only icon in the heading variant
// and for the content variant, fontStyle is set in the consumer component
case 'subheading': {
return { return {
boxSize: '30px', // for headings textStyle: 'heading.md',
}; };
} }
} }
......
...@@ -4,17 +4,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -4,17 +4,17 @@ import { test, expect } from 'playwright/lib';
import BlockEntity from './BlockEntity'; import BlockEntity from './BlockEntity';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 180, height: 30 } }); test.use({ viewport: { width: 180, height: 30 } });
test.describe('icon sizes', () => { test.describe('icon sizes', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<BlockEntity <BlockEntity
number={ 17943507 } number={ 17943507 }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -6,17 +6,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -6,17 +6,17 @@ import { test, expect } from 'playwright/lib';
import EnsEntity from './EnsEntity'; import EnsEntity from './EnsEntity';
const name = 'cat.eth'; const name = 'cat.eth';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 180, height: 30 } }); test.use({ viewport: { width: 180, height: 30 } });
test.describe('icon size', () => { test.describe('variant', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<EnsEntity <EnsEntity
domain={ name } domain={ name }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -11,7 +11,6 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -11,7 +11,6 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import { Tooltip } from 'toolkit/chakra/tooltip'; import { Tooltip } from 'toolkit/chakra/tooltip';
import * as EntityBase from 'ui/shared/entities/base/components'; import * as EntityBase from 'ui/shared/entities/base/components';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import TruncatedValue from 'ui/shared/TruncatedValue';
import { distributeEntityProps, getIconProps } from '../base/utils'; import { distributeEntityProps, getIconProps } from '../base/utils';
...@@ -36,7 +35,7 @@ const Icon = (props: IconProps) => { ...@@ -36,7 +35,7 @@ const Icon = (props: IconProps) => {
const icon = <EntityBase.Icon { ...props } name={ props.name ?? 'ENS_slim' }/>; const icon = <EntityBase.Icon { ...props } name={ props.name ?? 'ENS_slim' }/>;
if (props.protocol) { if (props.protocol) {
const styles = getIconProps(props.size); const styles = getIconProps(props.variant);
if (props.isLoading) { if (props.isLoading) {
return <Skeleton loading boxSize={ styles.boxSize } borderRadius="sm" mr={ 2 }/>; return <Skeleton loading boxSize={ styles.boxSize } borderRadius="sm" mr={ 2 }/>;
...@@ -114,9 +113,10 @@ type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps ...@@ -114,9 +113,10 @@ type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps
const Content = chakra((props: ContentProps) => { const Content = chakra((props: ContentProps) => {
return ( return (
<TruncatedValue <EntityBase.Content
isLoading={ props.isLoading } { ...props }
value={ props.domain } text={ props.domain }
truncation="tail"
/> />
); );
}); });
......
...@@ -4,19 +4,19 @@ import { test, expect } from 'playwright/lib'; ...@@ -4,19 +4,19 @@ import { test, expect } from 'playwright/lib';
import NftEntity from './NftEntity'; import NftEntity from './NftEntity';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
const hash = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859'; const hash = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859';
test.use({ viewport: { width: 180, height: 30 } }); test.use({ viewport: { width: 180, height: 30 } });
test.describe('icon sizes', () => { test.describe('variants', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<NftEntity <NftEntity
hash={ hash } hash={ hash }
id="1042" id="1042"
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -4,7 +4,6 @@ import React from 'react'; ...@@ -4,7 +4,6 @@ import React from 'react';
import { route } from 'nextjs-routes'; import { route } from 'nextjs-routes';
import * as EntityBase from 'ui/shared/entities/base/components'; import * as EntityBase from 'ui/shared/entities/base/components';
import TruncatedValue from 'ui/shared/TruncatedValue';
import { distributeEntityProps } from '../base/utils'; import { distributeEntityProps } from '../base/utils';
...@@ -18,7 +17,7 @@ const Icon = (props: EntityBase.IconBaseProps) => { ...@@ -18,7 +17,7 @@ const Icon = (props: EntityBase.IconBaseProps) => {
return ( return (
<EntityBase.Icon <EntityBase.Icon
{ ...props } { ...props }
size={ props.size ?? 'lg' } variant="heading"
name={ props.name ?? 'nft_shield' } name={ props.name ?? 'nft_shield' }
/> />
); );
...@@ -43,9 +42,10 @@ type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps ...@@ -43,9 +42,10 @@ type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps
const Content = chakra((props: ContentProps) => { const Content = chakra((props: ContentProps) => {
return ( return (
<TruncatedValue <EntityBase.Content
isLoading={ props.isLoading } { ...props }
value={ props.id } text={ props.id }
truncation="tail"
/> />
); );
}); });
......
...@@ -43,7 +43,7 @@ const Icon = (props: IconProps) => { ...@@ -43,7 +43,7 @@ const Icon = (props: IconProps) => {
> >
<TokenEntity.Icon <TokenEntity.Icon
marginRight={ 0 } marginRight={ 0 }
size={ props.size } variant={ props.variant }
token={{ token={{
icon_url: props.pool.base_token_icon_url, icon_url: props.pool.base_token_icon_url,
symbol: props.pool.base_token_symbol, symbol: props.pool.base_token_symbol,
...@@ -63,7 +63,7 @@ const Icon = (props: IconProps) => { ...@@ -63,7 +63,7 @@ const Icon = (props: IconProps) => {
> >
<TokenEntity.Icon <TokenEntity.Icon
marginRight={ 0 } marginRight={ 0 }
size={ props.size } variant={ props.variant }
token={{ token={{
icon_url: props.pool.quote_token_icon_url, icon_url: props.pool.quote_token_icon_url,
symbol: props.pool.quote_token_symbol, symbol: props.pool.quote_token_symbol,
......
...@@ -6,17 +6,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -6,17 +6,17 @@ import { test, expect } from 'playwright/lib';
import TokenEntity from './TokenEntity'; import TokenEntity from './TokenEntity';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 300, height: 100 } }); test.use({ viewport: { width: 300, height: 100 } });
test.describe('icon size', () => { test.describe('variant', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<TokenEntity <TokenEntity
token={ tokenMock.tokenInfo } token={ tokenMock.tokenInfo }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -37,7 +37,7 @@ const Icon = (props: IconProps) => { ...@@ -37,7 +37,7 @@ const Icon = (props: IconProps) => {
const styles = { const styles = {
marginRight: props.marginRight ?? 2, marginRight: props.marginRight ?? 2,
boxSize: props.boxSize ?? getIconProps(props.size).boxSize, boxSize: props.boxSize ?? getIconProps(props.variant).boxSize,
borderRadius: props.token.type === 'ERC-20' ? 'full' : 'base', borderRadius: props.token.type === 'ERC-20' ? 'full' : 'base',
flexShrink: 0, flexShrink: 0,
}; };
...@@ -69,18 +69,11 @@ const Content = chakra((props: ContentProps) => { ...@@ -69,18 +69,11 @@ const Content = chakra((props: ContentProps) => {
].filter(Boolean).join(' '); ].filter(Boolean).join(' ');
return ( return (
<TruncatedTextTooltip label={ nameString }> <EntityBase.Content
<Skeleton { ...props }
loading={ props.isLoading } text={ nameString }
display="inline-block" truncation="tail"
whiteSpace="nowrap" />
overflow="hidden"
textOverflow="ellipsis"
height="fit-content"
>
{ nameString }
</Skeleton>
</TruncatedTextTooltip>
); );
}); });
......
...@@ -5,17 +5,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -5,17 +5,17 @@ import { test, expect } from 'playwright/lib';
import TxEntity from './TxEntity'; import TxEntity from './TxEntity';
const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899'; const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 180, height: 30 } }); test.use({ viewport: { width: 180, height: 30 } });
test.describe('icon size', () => { test.describe('variant', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<TxEntity <TxEntity
hash={ hash } hash={ hash }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -5,17 +5,17 @@ import { test, expect } from 'playwright/lib'; ...@@ -5,17 +5,17 @@ import { test, expect } from 'playwright/lib';
import UserOpEntity from './UserOpEntity'; import UserOpEntity from './UserOpEntity';
const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899'; const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899';
const iconSizes = [ 'md', 'lg' ] as const; const variants = [ 'subheading', 'content' ] as const;
test.use({ viewport: { width: 180, height: 30 } }); test.use({ viewport: { width: 180, height: 30 } });
test.describe('icon size', () => { test.describe('variant', () => {
iconSizes.forEach((size) => { variants.forEach((variant) => {
test(`${ size }`, async({ render }) => { test(`${ variant }`, async({ render }) => {
const component = await render( const component = await render(
<UserOpEntity <UserOpEntity
hash={ hash } hash={ hash }
icon={{ size }} variant={ variant }
/>, />,
); );
......
...@@ -102,9 +102,9 @@ const LinkShowcase = () => { ...@@ -102,9 +102,9 @@ const LinkShowcase = () => {
</Box> </Box>
<AddressEntity address={ addressMock.withoutName } isLoading/> <AddressEntity address={ addressMock.withoutName } isLoading/>
</Sample> </Sample>
<Sample label="Size: md, lg??? (heading)" vertical> <Sample label="Variant: content, subheading" vertical>
<AddressEntity address={ addressMock.withoutName } size="md"/> <AddressEntity address={ addressMock.withoutName } variant="content"/>
<AddressEntity address={ addressMock.withoutName } size="lg" textStyle="heading.md"/> <AddressEntity address={ addressMock.withoutName } variant="subheading"/>
</Sample> </Sample>
<Sample label="With name" vertical> <Sample label="With name" vertical>
<AddressEntity address={ addressMock.withName }/> <AddressEntity address={ addressMock.withName }/>
...@@ -140,9 +140,9 @@ const LinkShowcase = () => { ...@@ -140,9 +140,9 @@ const LinkShowcase = () => {
<TokenEntity token={{ ...TOKEN, icon_url: null }}/> <TokenEntity token={{ ...TOKEN, icon_url: null }}/>
<TokenEntity token={{ ...TOKEN, icon_url: null, name: null, symbol: null }}/> <TokenEntity token={{ ...TOKEN, icon_url: null, name: null, symbol: null }}/>
</Sample> </Sample>
<Sample label="Size: md, lg??? (heading)" vertical w="100%"> <Sample label="Variant: content, subheading" vertical w="100%">
<TokenEntity token={ TOKEN } size="md"/> <TokenEntity token={ TOKEN } variant="content"/>
<TokenEntity token={ TOKEN } size="lg" textStyle="heading.md" jointSymbol/> <TokenEntity token={ TOKEN } variant="subheading" jointSymbol/>
</Sample> </Sample>
</SamplesStack> </SamplesStack>
...@@ -190,9 +190,9 @@ const LinkShowcase = () => { ...@@ -190,9 +190,9 @@ const LinkShowcase = () => {
</Box> </Box>
<EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } isLoading/> <EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } isLoading/>
</Sample> </Sample>
<Sample label="Size: md, lg??? (heading)" vertical w="100%"> <Sample label="Variant: content, subheading" vertical w="100%">
<EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } size="md"/> <EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } variant="content"/>
<EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } size="lg" textStyle="heading.md"/> <EnsEntity domain={ ensMock.ensDomainA.name } protocol={ ensMock.ensDomainA.protocol } variant="subheading"/>
</Sample> </Sample>
</SamplesStack> </SamplesStack>
......
...@@ -124,9 +124,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => { ...@@ -124,9 +124,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
<AddressEntity <AddressEntity
address={{ ...addressQuery.data, name: '' }} address={{ ...addressQuery.data, name: '' }}
isLoading={ isLoading } isLoading={ isLoading }
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
/> />
) } ) }
{ !isLoading && tokenQuery.data && <AddressAddToWallet token={ tokenQuery.data } variant="button"/> } { !isLoading && tokenQuery.data && <AddressAddToWallet token={ tokenQuery.data } variant="button"/> }
...@@ -149,7 +147,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => { ...@@ -149,7 +147,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
<TokenEntity.Icon <TokenEntity.Icon
token={ tokenQuery.data } token={ tokenQuery.data }
isLoading={ tokenQuery.isPlaceholderData } isLoading={ tokenQuery.isPlaceholderData }
size="lg" variant="heading"
/> />
) : null } ) : null }
contentAfter={ contentAfter } contentAfter={ contentAfter }
......
import type { Option } from 'ui/shared/forms/inputs/select/types'; import type { SelectOption } from 'toolkit/chakra/select';
export interface Fields extends SocialLinkFields, TickerUrlFields { export interface Fields extends SocialLinkFields, TickerUrlFields {
address: string; address: string;
...@@ -6,7 +6,7 @@ export interface Fields extends SocialLinkFields, TickerUrlFields { ...@@ -6,7 +6,7 @@ export interface Fields extends SocialLinkFields, TickerUrlFields {
requester_name: string; requester_name: string;
requester_email: string; requester_email: string;
project_name?: string; project_name?: string;
project_sector: Array<Option> | null; project_sector: Array<SelectOption> | null;
project_email: string; project_email: string;
project_website: string; project_website: string;
project_description: string; project_description: string;
......
...@@ -96,9 +96,7 @@ const TokenInstancePageTitle = ({ isLoading, token, instance, hash }: Props) => ...@@ -96,9 +96,7 @@ const TokenInstancePageTitle = ({ isLoading, token, instance, hash }: Props) =>
noSymbol noSymbol
noCopy noCopy
jointSymbol jointSymbol
fontFamily="heading" variant="subheading"
fontSize="lg"
fontWeight={ 500 }
w="auto" w="auto"
maxW="700px" maxW="700px"
/> />
......
...@@ -118,7 +118,7 @@ const TxSubHeading = ({ hash, hasTag, txQuery }: Props) => { ...@@ -118,7 +118,7 @@ const TxSubHeading = ({ hash, hasTag, txQuery }: Props) => {
/> />
); );
} else { } else {
return <TxEntity hash={ hash } noLink noCopy={ false } fontWeight={ 500 } mr={{ base: 0, lg: 2 }} fontFamily="heading"/>; return <TxEntity hash={ hash } noLink noCopy={ false } variant="subheading" mr={{ base: 0, lg: 2 }}/>;
} }
})(); })();
......
...@@ -133,7 +133,7 @@ const TxDetailsAction = ({ action }: Props) => { ...@@ -133,7 +133,7 @@ const TxDetailsAction = ({ action }: Props) => {
<Flex key={ data.address + id } whiteSpace="pre-wrap" columnGap={ 2 }> <Flex key={ data.address + id } whiteSpace="pre-wrap" columnGap={ 2 }>
<chakra.span flexShrink={ 0 }>1</chakra.span> <chakra.span flexShrink={ 0 }>1</chakra.span>
<chakra.span color="text_secondary" flexShrink={ 0 }>of token ID</chakra.span> <chakra.span color="text_secondary" flexShrink={ 0 }>of token ID</chakra.span>
<NftEntity hash={ data.address } id={ id } w="min-content" icon={{ size: 'md' }}/> <NftEntity hash={ data.address } id={ id } w="min-content" variant="content"/>
</Flex> </Flex>
); );
}) })
......
...@@ -75,7 +75,7 @@ const UserOpSubHeading = ({ hash }: Props) => { ...@@ -75,7 +75,7 @@ const UserOpSubHeading = ({ hash }: Props) => {
// /> // />
// ); // );
} else { } else {
return <UserOpEntity hash={ hash } noLink noCopy={ false } fontWeight={ 500 } fontFamily="heading"/>; return <UserOpEntity hash={ hash } noLink noCopy={ false } variant="subheading"/>;
} }
}; };
......
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