Commit 136edb64 authored by tom's avatar tom

last part of migratin and eslint rule

parent 1cfab7e7
...@@ -5,6 +5,9 @@ const RESTRICTED_MODULES = { ...@@ -5,6 +5,9 @@ const RESTRICTED_MODULES = {
{ name: '@metamask/providers', message: 'Please lazy-load @metamask/providers or use useProvider hook instead' }, { name: '@metamask/providers', message: 'Please lazy-load @metamask/providers or use useProvider hook instead' },
{ name: '@metamask/post-message-stream', message: 'Please lazy-load @metamask/post-message-stream or use useProvider hook instead' }, { name: '@metamask/post-message-stream', message: 'Please lazy-load @metamask/post-message-stream or use useProvider hook instead' },
], ],
patterns: [
'icons/*',
],
}; };
module.exports = { module.exports = {
......
import { Button, Menu, MenuButton, MenuList, Icon, Flex, Skeleton, chakra } from '@chakra-ui/react'; import { Button, Menu, MenuButton, MenuList, Flex, Skeleton, chakra } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
import config from 'configs/app'; import config from 'configs/app';
import iconArrow from 'icons/arrows/east-mini.svg';
import useIsAccountActionAllowed from 'lib/hooks/useIsAccountActionAllowed'; import useIsAccountActionAllowed from 'lib/hooks/useIsAccountActionAllowed';
import * as mixpanel from 'lib/mixpanel/index'; import * as mixpanel from 'lib/mixpanel/index';
import getQueryParamString from 'lib/router/getQueryParamString'; import getQueryParamString from 'lib/router/getQueryParamString';
import IconSvg from 'ui/shared/IconSvg';
import PrivateTagMenuItem from './items/PrivateTagMenuItem'; import PrivateTagMenuItem from './items/PrivateTagMenuItem';
import PublicTagMenuItem from './items/PublicTagMenuItem'; import PublicTagMenuItem from './items/PublicTagMenuItem';
...@@ -44,7 +44,7 @@ const AccountActionsMenu = ({ isLoading, className }: Props) => { ...@@ -44,7 +44,7 @@ const AccountActionsMenu = ({ isLoading, className }: Props) => {
> >
<Flex alignItems="center"> <Flex alignItems="center">
<span>More</span> <span>More</span>
<Icon as={ iconArrow } transform="rotate(-90deg)" boxSize={ 5 } ml={ 1 }/> <IconSvg name="arrows/east-mini" transform="rotate(-90deg)" boxSize={ 5 } ml={ 1 }/>
</Flex> </Flex>
</MenuButton> </MenuButton>
</Skeleton> </Skeleton>
......
import { MenuItem, Icon, chakra, useDisclosure } from '@chakra-ui/react'; import { MenuItem, chakra, useDisclosure } from '@chakra-ui/react';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
...@@ -6,11 +6,11 @@ import React from 'react'; ...@@ -6,11 +6,11 @@ import React from 'react';
import type { Address } from 'types/api/address'; import type { Address } from 'types/api/address';
import type { Transaction } from 'types/api/transaction'; import type { Transaction } from 'types/api/transaction';
import iconPrivateTags from 'icons/privattags.svg';
import { getResourceKey } from 'lib/api/useApiQuery'; import { getResourceKey } from 'lib/api/useApiQuery';
import getPageType from 'lib/mixpanel/getPageType'; import getPageType from 'lib/mixpanel/getPageType';
import AddressModal from 'ui/privateTags/AddressModal/AddressModal'; import AddressModal from 'ui/privateTags/AddressModal/AddressModal';
import TransactionModal from 'ui/privateTags/TransactionModal/TransactionModal'; import TransactionModal from 'ui/privateTags/TransactionModal/TransactionModal';
import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -61,7 +61,7 @@ const PrivateTagMenuItem = ({ className, hash, onBeforeClick, type = 'address' } ...@@ -61,7 +61,7 @@ const PrivateTagMenuItem = ({ className, hash, onBeforeClick, type = 'address' }
return ( return (
<> <>
<MenuItem className={ className } onClick={ handleClick }> <MenuItem className={ className } onClick={ handleClick }>
<Icon as={ iconPrivateTags } boxSize={ 6 } mr={ 2 }/> <IconSvg name="privattags" boxSize={ 6 } mr={ 2 }/>
<span>Add private tag</span> <span>Add private tag</span>
</MenuItem> </MenuItem>
{ type === 'tx' ? { type === 'tx' ?
......
import { MenuItem, Icon, chakra } from '@chakra-ui/react'; import { MenuItem, chakra } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
import iconPublicTags from 'icons/publictags.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -23,7 +23,7 @@ const PublicTagMenuItem = ({ className, hash, onBeforeClick }: Props) => { ...@@ -23,7 +23,7 @@ const PublicTagMenuItem = ({ className, hash, onBeforeClick }: Props) => {
return ( return (
<MenuItem className={ className }onClick={ handleClick }> <MenuItem className={ className }onClick={ handleClick }>
<Icon as={ iconPublicTags } boxSize={ 6 } mr={ 2 }/> <IconSvg name="publictags" boxSize={ 6 } mr={ 2 }/>
<span>Add public tag</span> <span>Add public tag</span>
</MenuItem> </MenuItem>
); );
......
import { MenuItem, Icon, chakra, useDisclosure } from '@chakra-ui/react'; import { MenuItem, chakra, useDisclosure } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
import type { Route } from 'nextjs-routes'; import type { Route } from 'nextjs-routes';
import config from 'configs/app'; import config from 'configs/app';
import iconEdit from 'icons/edit.svg';
import useApiQuery from 'lib/api/useApiQuery'; import useApiQuery from 'lib/api/useApiQuery';
import useHasAccount from 'lib/hooks/useHasAccount'; import useHasAccount from 'lib/hooks/useHasAccount';
import { PAGE_TYPE_DICT } from 'lib/mixpanel/getPageType'; import { PAGE_TYPE_DICT } from 'lib/mixpanel/getPageType';
import AddressVerificationModal from 'ui/addressVerification/AddressVerificationModal'; import AddressVerificationModal from 'ui/addressVerification/AddressVerificationModal';
import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -61,7 +61,7 @@ const TokenInfoMenuItem = ({ className, hash, onBeforeClick }: Props) => { ...@@ -61,7 +61,7 @@ const TokenInfoMenuItem = ({ className, hash, onBeforeClick }: Props) => {
router.push({ pathname: '/account/verified-addresses' }); router.push({ pathname: '/account/verified-addresses' });
}, [ router ]); }, [ router ]);
const icon = <Icon as={ iconEdit } boxSize={ 6 } mr={ 2 } p={ 1 }/>; const icon = <IconSvg name="edit" boxSize={ 6 } mr={ 2 } p={ 1 }/>;
const content = (() => { const content = (() => {
if (!verifiedAddressesQuery.data?.verifiedAddresses.find(({ contractAddress }) => contractAddress.toLowerCase() === hash.toLowerCase())) { if (!verifiedAddressesQuery.data?.verifiedAddresses.find(({ contractAddress }) => contractAddress.toLowerCase() === hash.toLowerCase())) {
......
import { import {
Icon,
useColorModeValue, useColorModeValue,
chakra, chakra,
Button, Button,
...@@ -7,7 +6,7 @@ import { ...@@ -7,7 +6,7 @@ import {
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import infoIcon from 'icons/info.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
isOpen?: boolean; isOpen?: boolean;
...@@ -39,8 +38,8 @@ const AdditionalInfoButton = ({ isOpen, onClick, className, isLoading }: Props, ...@@ -39,8 +38,8 @@ const AdditionalInfoButton = ({ isOpen, onClick, className, isLoading }: Props,
cursor="pointer" cursor="pointer"
flexShrink={ 0 } flexShrink={ 0 }
> >
<Icon <IconSvg
as={ infoIcon } name="info"
boxSize={ 5 } boxSize={ 5 }
color="link" color="link"
_hover={{ color: 'link_hovered' }} _hover={{ color: 'link_hovered' }}
......
import { Box, HStack, Flex, Skeleton, useColorModeValue } from '@chakra-ui/react'; import { Box, HStack, Flex, Skeleton, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import keyIcon from 'icons/key.svg';
import Icon from 'ui/shared/chakra/Icon';
import CopyToClipboard from 'ui/shared/CopyToClipboard'; import CopyToClipboard from 'ui/shared/CopyToClipboard';
import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
apiKey: string; apiKey: string;
...@@ -14,7 +13,7 @@ interface Props { ...@@ -14,7 +13,7 @@ interface Props {
const ApiKeySnippet = ({ apiKey, name, isLoading }: Props) => { const ApiKeySnippet = ({ apiKey, name, isLoading }: Props) => {
return ( return (
<HStack spacing={ 2 } alignItems="start"> <HStack spacing={ 2 } alignItems="start">
<Icon as={ keyIcon } boxSize={ 6 } color={ useColorModeValue('gray.500', 'gray.400') } isLoading={ isLoading }/> <IconSvg name="key" boxSize={ 6 } color={ useColorModeValue('gray.500', 'gray.400') } isLoading={ isLoading }/>
<Box> <Box>
<Flex alignItems={{ base: 'flex-start', lg: 'center' }}> <Flex alignItems={{ base: 'flex-start', lg: 'center' }}>
<Skeleton isLoaded={ !isLoading } display="inline-block" fontWeight={ 600 } mr={ 1 }> <Skeleton isLoaded={ !isLoading } display="inline-block" fontWeight={ 600 } mr={ 1 }>
......
import { Icon } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import icon404 from 'icons/error-pages/404.svg'; import type { IconName } from 'ui/shared/IconSvg';
import icon422 from 'icons/error-pages/422.svg'; import IconSvg from 'ui/shared/IconSvg';
import icon429 from 'icons/error-pages/429.svg';
import icon500 from 'icons/error-pages/500.svg';
const ICONS: Record<string, React.FunctionComponent<React.SVGAttributes<SVGElement>> > = { const ICONS: Record<string, IconName> = {
'404': icon404, '404': 'error-pages/404',
'422': icon422, '422': 'error-pages/422',
'429': icon429, '429': 'error-pages/429',
'500': icon500, '500': 'error-pages/500',
}; };
interface Props { interface Props {
...@@ -18,7 +15,7 @@ interface Props { ...@@ -18,7 +15,7 @@ interface Props {
} }
const AppErrorIcon = ({ statusCode }: Props) => { const AppErrorIcon = ({ statusCode }: Props) => {
return <Icon as={ ICONS[String(statusCode)] || ICONS['500'] } width="200px" height="auto" color="text"/>; return <IconSvg name={ ICONS[String(statusCode)] || ICONS['500'] } width="200px" height="auto" color="text"/>;
}; };
export default AppErrorIcon; export default AppErrorIcon;
/* eslint-disable max-len */ /* eslint-disable max-len */
import { Box, OrderedList, ListItem, Icon, useColorModeValue, Flex } from '@chakra-ui/react'; import { Box, OrderedList, ListItem, useColorModeValue, Flex } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import txIcon from 'icons/transactions.svg'; import IconSvg from 'ui/shared/IconSvg';
import AppErrorTitle from '../AppErrorTitle'; import AppErrorTitle from '../AppErrorTitle';
...@@ -18,7 +18,7 @@ const AppErrorInvalidTxHash = () => { ...@@ -18,7 +18,7 @@ const AppErrorInvalidTxHash = () => {
<> <>
<Box p={ 4 } borderColor={ snippet.borderColor } borderRadius="md" w="230px" borderWidth="1px"> <Box p={ 4 } borderColor={ snippet.borderColor } borderRadius="md" w="230px" borderWidth="1px">
<Flex alignItems="center" pb={ 4 } borderBottomWidth="1px" borderColor={ snippet.borderColor }> <Flex alignItems="center" pb={ 4 } borderBottomWidth="1px" borderColor={ snippet.borderColor }>
<Icon as={ txIcon } boxSize={ 8 } color={ snippet.iconColor } bgColor={ snippet.iconBg } p={ 1 } borderRadius="md"/> <IconSvg name="transactions" boxSize={ 8 } color={ snippet.iconColor } bgColor={ snippet.iconBg } p={ 1 } borderRadius="md"/>
<Box ml={ 2 }> <Box ml={ 2 }>
<Box w="125px" h="8px" borderRadius="full" bgColor={ snippet.iconBg }/> <Box w="125px" h="8px" borderRadius="full" bgColor={ snippet.iconBg }/>
<Box w="30px" h="8px" borderRadius="full" bgColor={ snippet.borderColor } mt={ 1.5 }/> <Box w="30px" h="8px" borderRadius="full" bgColor={ snippet.borderColor } mt={ 1.5 }/>
......
import { chakra, Icon, IconButton, useColorModeValue } from '@chakra-ui/react'; import { chakra, IconButton, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import errorIcon from 'icons/status/error.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
onClick: (e: React.SyntheticEvent) => void; onClick: (e: React.SyntheticEvent) => void;
...@@ -21,7 +21,7 @@ const ClearButton = ({ onClick, isDisabled, className }: Props) => { ...@@ -21,7 +21,7 @@ const ClearButton = ({ onClick, isDisabled, className }: Props) => {
aria-label="Clear input" aria-label="Clear input"
title="Clear input" title="Clear input"
boxSize={ 6 } boxSize={ 6 }
icon={ <Icon as={ errorIcon } boxSize={ 3 } color={ iconColor } focusable={ false } _hover={{ color: iconColorHover }}/> } icon={ <IconSvg name="status/error" boxSize={ 3 } color={ iconColor } _hover={{ color: iconColorHover }}/> }
size="sm" size="sm"
onClick={ onClick } onClick={ onClick }
/> />
......
import { IconButton, Tooltip, useClipboard, chakra, useDisclosure, Skeleton } from '@chakra-ui/react'; import { IconButton, Tooltip, useClipboard, chakra, useDisclosure, Skeleton } from '@chakra-ui/react';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import CopyIcon from 'icons/copy.svg'; import IconSvg from 'ui/shared/IconSvg';
export interface Props { export interface Props {
text: string; text: string;
...@@ -31,7 +31,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => { ...@@ -31,7 +31,7 @@ const CopyToClipboard = ({ text, className, isLoading }: Props) => {
<Tooltip label={ copied ? 'Copied' : 'Copy to clipboard' } isOpen={ isOpen || copied }> <Tooltip label={ copied ? 'Copied' : 'Copy to clipboard' } isOpen={ isOpen || copied }>
<IconButton <IconButton
aria-label="copy" aria-label="copy"
icon={ <CopyIcon/> } icon={ <IconSvg name="copy" boxSize={ 5 }/> }
w="20px" w="20px"
h="20px" h="20px"
color="gray.400" color="gray.400"
......
import { Box, Heading, Icon, Text } from '@chakra-ui/react'; import { Box, Heading, Text } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import emptyIcon from 'icons/empty_search_result.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
text: string; text: string;
...@@ -14,8 +14,8 @@ const EmptySearchResult = ({ text }: Props) => { ...@@ -14,8 +14,8 @@ const EmptySearchResult = ({ text }: Props) => {
flexDirection="column" flexDirection="column"
alignItems="center" alignItems="center"
> >
<Icon <IconSvg
as={ emptyIcon } name="empty_search_result"
boxSize={ 60 } boxSize={ 60 }
display="block" display="block"
/> />
......
...@@ -2,7 +2,7 @@ import type { TooltipProps } from '@chakra-ui/react'; ...@@ -2,7 +2,7 @@ import type { TooltipProps } from '@chakra-ui/react';
import { chakra, IconButton, Tooltip, useDisclosure, Skeleton } from '@chakra-ui/react'; import { chakra, IconButton, Tooltip, useDisclosure, Skeleton } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import InfoIcon from 'icons/info.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
label: string | React.ReactNode; label: string | React.ReactNode;
...@@ -35,7 +35,7 @@ const Hint = ({ label, className, tooltipProps, isLoading }: Props) => { ...@@ -35,7 +35,7 @@ const Hint = ({ label, className, tooltipProps, isLoading }: Props) => {
<IconButton <IconButton
colorScheme="none" colorScheme="none"
aria-label="hint" aria-label="hint"
icon={ <InfoIcon/> } icon={ <IconSvg name="info" boxSize={ 5 }/> }
boxSize={ 5 } boxSize={ 5 }
variant="simple" variant="simple"
display="inline-block" display="inline-block"
......
import type { ChakraProps } from '@chakra-ui/react'; import type { ChakraProps } from '@chakra-ui/react';
import { Link, Icon, chakra, Box, Skeleton, useColorModeValue } from '@chakra-ui/react'; import { Link, chakra, Box, Skeleton, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import arrowIcon from 'icons/arrows/north-east.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
href: string; href: string;
...@@ -59,7 +59,7 @@ const LinkExternal = ({ href, children, className, isLoading, variant }: Props) ...@@ -59,7 +59,7 @@ const LinkExternal = ({ href, children, className, isLoading, variant }: Props)
return ( return (
<Link className={ className } { ...styleProps } target="_blank" href={ href }> <Link className={ className } { ...styleProps } target="_blank" href={ href }>
{ children } { children }
<Icon as={ arrowIcon } boxSize={ 4 } verticalAlign="middle" color="gray.400"/> <IconSvg name="arrows/north-east" boxSize={ 4 } verticalAlign="middle" color="gray.400"/>
</Link> </Link>
); );
}; };
......
import { Flex, Button, Icon, chakra, Popover, PopoverTrigger, PopoverBody, PopoverContent, useDisclosure } from '@chakra-ui/react'; import { Flex, Button, chakra, Popover, PopoverTrigger, PopoverBody, PopoverContent, useDisclosure } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { NetworkExplorer as TNetworkExplorer } from 'types/networks'; import type { NetworkExplorer as TNetworkExplorer } from 'types/networks';
import config from 'configs/app'; import config from 'configs/app';
import arrowIcon from 'icons/arrows/east-mini.svg';
import explorerIcon from 'icons/explorer.svg';
import stripTrailingSlash from 'lib/stripTrailingSlash'; import stripTrailingSlash from 'lib/stripTrailingSlash';
import IconSvg from 'ui/shared/IconSvg';
import LinkExternal from 'ui/shared/LinkExternal'; import LinkExternal from 'ui/shared/LinkExternal';
interface Props { interface Props {
...@@ -46,8 +45,8 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => { ...@@ -46,8 +45,8 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
h="32px" h="32px"
flexShrink={ 0 } flexShrink={ 0 }
> >
<Icon as={ explorerIcon } boxSize={ 5 }/> <IconSvg name="explorer" boxSize={ 5 }/>
<Icon as={ arrowIcon } transform={ isOpen ? 'rotate(90deg)' : 'rotate(-90deg)' } transitionDuration="faster" boxSize={ 5 }/> <IconSvg name="arrows/east-mini" transform={ isOpen ? 'rotate(90deg)' : 'rotate(-90deg)' } transitionDuration="faster" boxSize={ 5 }/>
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent w="240px"> <PopoverContent w="240px">
......
import { Heading, Flex, Tooltip, Icon, Link, chakra, Skeleton, useDisclosure } from '@chakra-ui/react'; import { Heading, Flex, Tooltip, Link, chakra, Skeleton, useDisclosure } from '@chakra-ui/react';
import _debounce from 'lodash/debounce'; import _debounce from 'lodash/debounce';
import React from 'react'; import React from 'react';
import eastArrowIcon from 'icons/arrows/east.svg';
import useIsMobile from 'lib/hooks/useIsMobile'; import useIsMobile from 'lib/hooks/useIsMobile';
import TextAd from 'ui/shared/ad/TextAd'; import TextAd from 'ui/shared/ad/TextAd';
import IconSvg from 'ui/shared/IconSvg';
import LinkInternal from 'ui/shared/LinkInternal'; import LinkInternal from 'ui/shared/LinkInternal';
type BackLinkProp = { label: string; url: string } | { label: string; onClick: () => void }; type BackLinkProp = { label: string; url: string } | { label: string; onClick: () => void };
...@@ -32,7 +32,7 @@ const BackLink = (props: BackLinkProp & { isLoading?: boolean }) => { ...@@ -32,7 +32,7 @@ const BackLink = (props: BackLinkProp & { isLoading?: boolean }) => {
return <Skeleton boxSize={ 6 } display="inline-block" borderRadius="base" mr={ 3 } my={ 2 } verticalAlign="text-bottom" isLoaded={ !props.isLoading }/>; return <Skeleton boxSize={ 6 } display="inline-block" borderRadius="base" mr={ 3 } my={ 2 } verticalAlign="text-bottom" isLoaded={ !props.isLoading }/>;
} }
const icon = <Icon as={ eastArrowIcon } boxSize={ 6 } transform="rotate(180deg)" margin="auto" color="gray.400"/>; const icon = <IconSvg name="arrows/east" boxSize={ 6 } transform="rotate(180deg)" margin="auto" color="gray.400"/>;
if ('url' in props) { if ('url' in props) {
return ( return (
......
import { Icon } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { TokenInfo } from 'types/api/token'; import type { TokenInfo } from 'types/api/token';
import iconVerifiedToken from 'icons/verified_token.svg';
import * as addressMock from 'mocks/address/address'; import * as addressMock from 'mocks/address/address';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import * as TokenEntity from 'ui/shared/entities/token/TokenEntity'; import * as TokenEntity from 'ui/shared/entities/token/TokenEntity';
import EntityTags from 'ui/shared/EntityTags'; import EntityTags from 'ui/shared/EntityTags';
import IconSvg from 'ui/shared/IconSvg';
import NetworkExplorers from 'ui/shared/NetworkExplorers'; import NetworkExplorers from 'ui/shared/NetworkExplorers';
import PageTitle from '../PageTitle'; import PageTitle from '../PageTitle';
...@@ -33,7 +32,7 @@ const DefaultView = () => { ...@@ -33,7 +32,7 @@ const DefaultView = () => {
const contentAfter = ( const contentAfter = (
<> <>
<Icon as={ iconVerifiedToken } color="green.500" boxSize={ 6 } cursor="pointer"/> <IconSvg name="verified_token" color="green.500" boxSize={ 6 } cursor="pointer"/>
<EntityTags <EntityTags
tagsBefore={ [ tagsBefore={ [
{ label: 'example', display_name: 'Example label' }, { label: 'example', display_name: 'Example label' },
......
/* eslint-disable max-len */ /* eslint-disable max-len */
import { Icon } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { TokenInfo } from 'types/api/token'; import type { TokenInfo } from 'types/api/token';
import iconVerifiedToken from 'icons/verified_token.svg';
import { publicTag, privateTag, watchlistName } from 'mocks/address/tag'; import { publicTag, privateTag, watchlistName } from 'mocks/address/tag';
import * as TokenEntity from 'ui/shared/entities/token/TokenEntity'; import * as TokenEntity from 'ui/shared/entities/token/TokenEntity';
import EntityTags from 'ui/shared/EntityTags'; import EntityTags from 'ui/shared/EntityTags';
import IconSvg from 'ui/shared/IconSvg';
import NetworkExplorers from 'ui/shared/NetworkExplorers'; import NetworkExplorers from 'ui/shared/NetworkExplorers';
import PageTitle from '../PageTitle'; import PageTitle from '../PageTitle';
...@@ -28,7 +27,7 @@ const LongNameAndManyTags = () => { ...@@ -28,7 +27,7 @@ const LongNameAndManyTags = () => {
const contentAfter = ( const contentAfter = (
<> <>
<Icon as={ iconVerifiedToken } color="green.500" boxSize={ 6 } cursor="pointer"/> <IconSvg name="verified_token" color="green.500" boxSize={ 6 } cursor="pointer"/>
<EntityTags <EntityTags
data={{ data={{
private_tags: [ privateTag ], private_tags: [ privateTag ],
......
import { Box, Icon, IconButton, chakra, Tooltip, Flex, Skeleton } from '@chakra-ui/react'; import { Box, IconButton, chakra, Tooltip, Flex, Skeleton } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import eastArrow from 'icons/arrows/east-mini.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -36,7 +36,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is ...@@ -36,7 +36,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is
<Tooltip label={ prevLabel }> <Tooltip label={ prevLabel }>
<IconButton <IconButton
aria-label="prev" aria-label="prev"
icon={ <Icon as={ eastArrow } boxSize={ 6 }/> } icon={ <IconSvg name="arrows/east-mini" boxSize={ 6 }/> }
h={ 6 } h={ 6 }
borderRadius="sm" borderRadius="sm"
variant="subtle" variant="subtle"
...@@ -48,7 +48,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is ...@@ -48,7 +48,7 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is
<Tooltip label={ nextLabel }> <Tooltip label={ nextLabel }>
<IconButton <IconButton
aria-label="next" aria-label="next"
icon={ <Icon as={ eastArrow }boxSize={ 6 } transform="rotate(180deg)"/> } icon={ <IconSvg name="arrows/east-mini" boxSize={ 6 } transform="rotate(180deg)"/> }
h={ 6 } h={ 6 }
borderRadius="sm" borderRadius="sm"
variant="subtle" variant="subtle"
......
import { Tooltip, Flex, Icon, useColorModeValue } from '@chakra-ui/react'; import { Tooltip, Flex, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import crossIcon from 'icons/cross.svg'; import IconSvg from 'ui/shared/IconSvg';
type Props = { type Props = {
onClick: () => void; onClick: () => void;
...@@ -14,8 +14,8 @@ const ResetIconButton = ({ onClick }: Props) => { ...@@ -14,8 +14,8 @@ const ResetIconButton = ({ onClick }: Props) => {
return ( return (
<Tooltip label="Reset filter"> <Tooltip label="Reset filter">
<Flex> <Flex>
<Icon <IconSvg
as={ crossIcon } name="cross"
boxSize={ 5 } boxSize={ 5 }
ml={ 1 } ml={ 1 }
color={ resetTokenIconColor } color={ resetTokenIconColor }
......
import { Tooltip, IconButton, HStack, Skeleton } from '@chakra-ui/react'; import { Tooltip, IconButton, HStack, Skeleton } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import DeleteIcon from 'icons/delete.svg';
import EditIcon from 'icons/edit.svg';
import usePreventFocusAfterModalClosing from 'lib/hooks/usePreventFocusAfterModalClosing'; import usePreventFocusAfterModalClosing from 'lib/hooks/usePreventFocusAfterModalClosing';
import IconSvg from 'ui/shared/IconSvg';
type Props = { type Props = {
onEditClick: () => void; onEditClick: () => void;
...@@ -31,7 +30,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick, isLoading }: Props ...@@ -31,7 +30,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick, isLoading }: Props
variant="simple" variant="simple"
boxSize={ 5 } boxSize={ 5 }
onClick={ onEditClick } onClick={ onEditClick }
icon={ <EditIcon/> } icon={ <IconSvg name="edit" boxSize={ 5 }/> }
onFocusCapture={ onFocusCapture } onFocusCapture={ onFocusCapture }
display="inline-block" display="inline-block"
flexShrink={ 0 } flexShrink={ 0 }
...@@ -44,7 +43,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick, isLoading }: Props ...@@ -44,7 +43,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick, isLoading }: Props
variant="simple" variant="simple"
boxSize={ 5 } boxSize={ 5 }
onClick={ onDeleteClick } onClick={ onDeleteClick }
icon={ <DeleteIcon/> } icon={ <IconSvg name="delete" boxSize={ 5 }/> }
onFocusCapture={ onFocusCapture } onFocusCapture={ onFocusCapture }
display="inline-block" display="inline-block"
flexShrink={ 0 } flexShrink={ 0 }
......
import { chakra, Icon, useColorModeValue } from '@chakra-ui/react'; import { chakra, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import tokenPlaceholderIcon from 'icons/token-placeholder.svg'; import IconSvg from 'ui/shared/IconSvg';
const TokenLogoPlaceholder = ({ className }: { className?: string }) => { const TokenLogoPlaceholder = ({ 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 (
<Icon <IconSvg
className={ className } className={ className }
fontWeight={ 600 } fontWeight={ 600 }
bgColor={ bgColor } bgColor={ bgColor }
color={ color } color={ color }
borderRadius="base" borderRadius="base"
as={ tokenPlaceholderIcon } name="token-placeholder"
transitionProperty="background-color,color" transitionProperty="background-color,color"
transitionDuration="normal" transitionDuration="normal"
transitionTimingFunction="ease" transitionTimingFunction="ease"
......
...@@ -3,15 +3,14 @@ import React from 'react'; ...@@ -3,15 +3,14 @@ import React from 'react';
import type { TokenTransfer } from 'types/api/tokenTransfer'; import type { TokenTransfer } from 'types/api/tokenTransfer';
import eastArrowIcon from 'icons/arrows/east.svg';
import getCurrencyValue from 'lib/getCurrencyValue'; import getCurrencyValue from 'lib/getCurrencyValue';
import useTimeAgoIncrement from 'lib/hooks/useTimeAgoIncrement'; import useTimeAgoIncrement from 'lib/hooks/useTimeAgoIncrement';
import Icon from 'ui/shared/chakra/Icon';
import Tag from 'ui/shared/chakra/Tag'; import Tag from 'ui/shared/chakra/Tag';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import NftEntity from 'ui/shared/entities/nft/NftEntity'; import NftEntity from 'ui/shared/entities/nft/NftEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import IconSvg from 'ui/shared/IconSvg';
import InOutTag from 'ui/shared/InOutTag'; import InOutTag from 'ui/shared/InOutTag';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import { getTokenTransferTypeText } from 'ui/shared/TokenTransfer/helpers'; import { getTokenTransferTypeText } from 'ui/shared/TokenTransfer/helpers';
...@@ -100,7 +99,7 @@ const TokenTransferListItem = ({ ...@@ -100,7 +99,7 @@ const TokenTransferListItem = ({
flexShrink={ 0 } flexShrink={ 0 }
/> />
) : ) :
<Icon as={ eastArrowIcon } boxSize={ 6 } color="gray.500" isLoading={ isLoading } flexShrink={ 0 }/> <IconSvg name="arrows/east" boxSize={ 6 } color="gray.500" isLoading={ isLoading } flexShrink={ 0 }/>
} }
<AddressEntity <AddressEntity
address={ to } address={ to }
......
import { SkeletonCircle, Image, Icon } from '@chakra-ui/react'; import { SkeletonCircle, Image } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import profileIcon from 'icons/profile.svg';
import { useAppContext } from 'lib/contexts/app'; import { useAppContext } from 'lib/contexts/app';
import * as cookies from 'lib/cookies'; import * as cookies from 'lib/cookies';
import useFetchProfileInfo from 'lib/hooks/useFetchProfileInfo'; import useFetchProfileInfo from 'lib/hooks/useFetchProfileInfo';
import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
size: number; size: number;
...@@ -34,7 +34,7 @@ const UserAvatar = ({ size }: Props) => { ...@@ -34,7 +34,7 @@ const UserAvatar = ({ size }: Props) => {
boxSize={ `${ size }px` } boxSize={ `${ size }px` }
borderRadius="full" borderRadius="full"
overflow="hidden" overflow="hidden"
fallback={ isImageLoadError || !data?.avatar ? <Icon as={ profileIcon } boxSize={ 5 }/> : undefined } fallback={ isImageLoadError || !data?.avatar ? <IconSvg name="profile" boxSize={ 5 }/> : undefined }
onError={ handleImageLoadError } onError={ handleImageLoadError }
/> />
); );
......
...@@ -3,7 +3,6 @@ import { ...@@ -3,7 +3,6 @@ import {
Center, Center,
chakra, chakra,
Flex, Flex,
Icon,
IconButton, Link, IconButton, Link,
Menu, Menu,
MenuButton, MenuButton,
...@@ -20,14 +19,10 @@ import React, { useRef, useCallback, useState } from 'react'; ...@@ -20,14 +19,10 @@ import React, { useRef, useCallback, useState } from 'react';
import type { TimeChartItem } from './types'; import type { TimeChartItem } from './types';
import svgFileIcon from 'icons/files/csv.svg';
import imageIcon from 'icons/files/image.svg';
import repeatArrowIcon from 'icons/repeat_arrow.svg';
import scopeIcon from 'icons/scope.svg';
import dotsIcon from 'icons/vertical_dots.svg';
import dayjs from 'lib/date/dayjs'; import dayjs from 'lib/date/dayjs';
import { apos } from 'lib/html-entities'; import { apos } from 'lib/html-entities';
import saveAsCSV from 'lib/saveAsCSV'; import saveAsCSV from 'lib/saveAsCSV';
import IconSvg from 'ui/shared/IconSvg';
import ChartWidgetGraph from './ChartWidgetGraph'; import ChartWidgetGraph from './ChartWidgetGraph';
import FullscreenChartModal from './FullscreenChartModal'; import FullscreenChartModal from './FullscreenChartModal';
...@@ -202,7 +197,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError, ...@@ -202,7 +197,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError,
size="sm" size="sm"
variant="outline" variant="outline"
onClick={ handleZoomResetClick } onClick={ handleZoomResetClick }
icon={ <Icon as={ repeatArrowIcon } w={ 4 } h={ 4 }/> } icon={ <IconSvg name="repeat_arrow" w={ 4 } h={ 4 }/> }
/> />
</Tooltip> </Tooltip>
...@@ -212,7 +207,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError, ...@@ -212,7 +207,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError,
<MenuButton <MenuButton
w="36px" w="36px"
h="32px" h="32px"
icon={ <Icon as={ dotsIcon } w={ 4 } h={ 4 }/> } icon={ <IconSvg name="vertical_dots" w={ 4 } h={ 4 }/> }
colorScheme="gray" colorScheme="gray"
variant="ghost" variant="ghost"
as={ IconButton } as={ IconButton }
...@@ -228,7 +223,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError, ...@@ -228,7 +223,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError,
alignItems="center" alignItems="center"
onClick={ showChartFullscreen } onClick={ showChartFullscreen }
> >
<Icon as={ scopeIcon } boxSize={ 5 } mr={ 3 }/> <IconSvg name="scope" boxSize={ 5 } mr={ 3 }/>
View fullscreen View fullscreen
</MenuItem> </MenuItem>
...@@ -237,7 +232,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError, ...@@ -237,7 +232,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError,
alignItems="center" alignItems="center"
onClick={ handleFileSaveClick } onClick={ handleFileSaveClick }
> >
<Icon as={ imageIcon } boxSize={ 5 } mr={ 3 }/> <IconSvg name="files/image" boxSize={ 5 } mr={ 3 }/>
Save as PNG Save as PNG
</MenuItem> </MenuItem>
...@@ -246,7 +241,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError, ...@@ -246,7 +241,7 @@ const ChartWidget = ({ items, title, description, isLoading, className, isError,
alignItems="center" alignItems="center"
onClick={ handleSVGSavingClick } onClick={ handleSVGSavingClick }
> >
<Icon as={ svgFileIcon } boxSize={ 5 } mr={ 3 }/> <IconSvg name="files/csv" boxSize={ 5 } mr={ 3 }/>
Save as CSV Save as CSV
</MenuItem> </MenuItem>
</MenuList> </MenuList>
......
import { Box, Button, Grid, Heading, Icon, Modal, ModalBody, ModalCloseButton, ModalContent, ModalOverlay, Text } from '@chakra-ui/react'; import { Box, Button, Grid, Heading, Modal, ModalBody, ModalCloseButton, ModalContent, ModalOverlay, Text } from '@chakra-ui/react';
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import type { TimeChartItem } from './types'; import type { TimeChartItem } from './types';
import repeatArrow from 'icons/repeat_arrow.svg'; import IconSvg from 'ui/shared/IconSvg';
import ChartWidgetGraph from './ChartWidgetGraph'; import ChartWidgetGraph from './ChartWidgetGraph';
...@@ -71,7 +71,7 @@ const FullscreenChartModal = ({ ...@@ -71,7 +71,7 @@ const FullscreenChartModal = ({
{ !isZoomResetInitial && ( { !isZoomResetInitial && (
<Button <Button
leftIcon={ <Icon as={ repeatArrow } w={ 4 } h={ 4 }/> } leftIcon={ <IconSvg name="repeat_arrow" w={ 4 } h={ 4 }/> }
colorScheme="blue" colorScheme="blue"
gridColumn={ 2 } gridColumn={ 2 }
justifySelf="end" justifySelf="end"
......
import type { As } from '@chakra-ui/react'; import type { As } from '@chakra-ui/react';
import { Skeleton, Box, Button, Circle, Icon, useColorModeValue } from '@chakra-ui/react'; import { Skeleton, Box, Button, Circle, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import filterIcon from 'icons/filter.svg'; import IconSvg from 'ui/shared/IconSvg';
const FilterIcon = <Icon as={ filterIcon } boxSize={ 5 } mr={{ base: 0, lg: 2 }}/>; const FilterIcon = <IconSvg name="filter" boxSize={ 5 } mr={{ base: 0, lg: 2 }}/>;
interface Props { interface Props {
isActive?: boolean; isActive?: boolean;
......
import { chakra, Icon, Input, InputGroup, InputLeftElement, InputRightElement, Skeleton, useColorModeValue } from '@chakra-ui/react'; import { chakra, Input, InputGroup, InputLeftElement, InputRightElement, Skeleton, useColorModeValue } from '@chakra-ui/react';
import type { ChangeEvent } from 'react'; import type { ChangeEvent } from 'react';
import React, { useCallback, useState } from 'react'; import React, { useCallback, useState } from 'react';
import searchIcon from 'icons/search.svg';
import ClearButton from 'ui/shared/ClearButton'; import ClearButton from 'ui/shared/ClearButton';
import IconSvg from 'ui/shared/IconSvg';
type Props = { type Props = {
onChange: (searchTerm: string) => void; onChange: (searchTerm: string) => void;
...@@ -44,7 +44,7 @@ const FilterInput = ({ onChange, className, size = 'sm', placeholder, initialVal ...@@ -44,7 +44,7 @@ const FilterInput = ({ onChange, className, size = 'sm', placeholder, initialVal
<InputLeftElement <InputLeftElement
pointerEvents="none" pointerEvents="none"
> >
<Icon as={ searchIcon } color={ iconColor }/> <IconSvg name="search" color={ iconColor }/>
</InputLeftElement> </InputLeftElement>
<Input <Input
......
import { Box, Flex, Icon, Text, useColorModeValue, IconButton, chakra, Tooltip } from '@chakra-ui/react'; import { Box, Flex, Text, useColorModeValue, IconButton, chakra, Tooltip } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import CrossIcon from 'icons/cross.svg'; import type { IconName } from 'ui/shared/IconSvg';
import jsonIcon from 'icons/files/json.svg'; import IconSvg from 'ui/shared/IconSvg';
import placeholderIcon from 'icons/files/placeholder.svg';
import solIcon from 'icons/files/sol.svg';
import yulIcon from 'icons/files/yul.svg';
import infoIcon from 'icons/info.svg';
const FILE_ICONS: Record<string, React.FunctionComponent<React.SVGAttributes<SVGElement>>> = { const FILE_ICONS: Record<string, IconName> = {
'.json': jsonIcon, '.json': 'files/json',
'.sol': solIcon, '.sol': 'files/sol',
'.yul': yulIcon, '.yul': 'files/yul',
}; };
function getFileExtension(fileName: string) { function getFileExtension(fileName: string) {
...@@ -44,7 +40,7 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr ...@@ -44,7 +40,7 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
}, []); }, []);
const fileExtension = getFileExtension(file.name); const fileExtension = getFileExtension(file.name);
const fileIcon = FILE_ICONS[fileExtension] || placeholderIcon; const fileIcon = FILE_ICONS[fileExtension] || 'files/placeholder';
const iconColor = useColorModeValue('gray.600', 'gray.400'); const iconColor = useColorModeValue('gray.600', 'gray.400');
return ( return (
...@@ -55,8 +51,8 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr ...@@ -55,8 +51,8 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
alignItems="center" alignItems="center"
textAlign="left" textAlign="left"
> >
<Icon <IconSvg
as={ fileIcon } name={ fileIcon }
boxSize="74px" boxSize="74px"
color={ error ? 'error' : iconColor } color={ error ? 'error' : iconColor }
mr={ 2 } mr={ 2 }
...@@ -83,13 +79,13 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr ...@@ -83,13 +79,13 @@ const FileSnippet = ({ file, className, index, onRemove, isDisabled, error }: Pr
maxW="320px" maxW="320px"
> >
<Box cursor="pointer" display="inherit" onClick={ handleErrorHintIconClick } ml={ 1 }> <Box cursor="pointer" display="inherit" onClick={ handleErrorHintIconClick } ml={ 1 }>
<Icon as={ infoIcon } boxSize={ 5 } color="error"/> <IconSvg name="info" boxSize={ 5 } color="error"/>
</Box> </Box>
</Tooltip> </Tooltip>
) } ) }
<IconButton <IconButton
aria-label="remove" aria-label="remove"
icon={ <CrossIcon/> } icon={ <IconSvg name="cross" boxSize={ 6 }/> }
boxSize={ 6 } boxSize={ 6 }
variant="simple" variant="simple"
display="inline-block" display="inline-block"
......
import { Box, chakra, Icon, Tooltip } from '@chakra-ui/react'; import { Box, chakra, Tooltip } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import iconStar from 'icons/star_filled.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -11,7 +11,7 @@ const CodeEditorMainFileIndicator = ({ className }: Props) => { ...@@ -11,7 +11,7 @@ const CodeEditorMainFileIndicator = ({ className }: Props) => {
return ( return (
<Tooltip label="The main file containing verified contract"> <Tooltip label="The main file containing verified contract">
<Box className={ className } > <Box className={ className } >
<Icon as={ iconStar } boxSize={ 3 } display="block" color="green.500"/> <IconSvg name="star_filled" boxSize={ 3 } display="block" color="green.500"/>
</Box> </Box>
</Tooltip> </Tooltip>
); );
......
import { Icon, useColorModeValue, chakra } from '@chakra-ui/react'; import { useColorModeValue, chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import nftIcon from 'icons/nft_shield.svg'; import IconSvg from 'ui/shared/IconSvg';
const NftFallback = ({ className }: {className?: string}) => { const NftFallback = ({ className }: {className?: string}) => {
return ( return (
<Icon <IconSvg
className={ className } className={ className }
as={ nftIcon } name="nft_shield"
p="50px" p="50px"
color={ useColorModeValue('blackAlpha.500', 'whiteAlpha.500') } color={ useColorModeValue('blackAlpha.500', 'whiteAlpha.500') }
bgColor={ useColorModeValue('blackAlpha.50', 'whiteAlpha.50') } bgColor={ useColorModeValue('blackAlpha.50', 'whiteAlpha.50') }
......
import { Button, Skeleton, Flex, Icon, IconButton, chakra } from '@chakra-ui/react'; import { Button, Skeleton, Flex, IconButton, chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { PaginationParams } from './types'; import type { PaginationParams } from './types';
import arrowIcon from 'icons/arrows/east-mini.svg'; import IconSvg from 'ui/shared/IconSvg';
interface Props extends PaginationParams { interface Props extends PaginationParams {
className?: string; className?: string;
...@@ -40,7 +40,7 @@ const Pagination = ({ page, onNextPageClick, onPrevPageClick, resetPage, hasPage ...@@ -40,7 +40,7 @@ const Pagination = ({ page, onNextPageClick, onPrevPageClick, resetPage, hasPage
size="sm" size="sm"
aria-label="Prev page" aria-label="Prev page"
w="36px" w="36px"
icon={ <Icon as={ arrowIcon } w={ 5 } h={ 5 }/> } icon={ <IconSvg name="arrows/east-mini" w={ 5 } h={ 5 }/> }
isDisabled={ !canGoBackwards || isLoading } isDisabled={ !canGoBackwards || isLoading }
/> />
</Skeleton> </Skeleton>
...@@ -65,7 +65,7 @@ const Pagination = ({ page, onNextPageClick, onPrevPageClick, resetPage, hasPage ...@@ -65,7 +65,7 @@ const Pagination = ({ page, onNextPageClick, onPrevPageClick, resetPage, hasPage
size="sm" size="sm"
aria-label="Next page" aria-label="Next page"
w="36px" w="36px"
icon={ <Icon as={ arrowIcon } w={ 5 } h={ 5 } transform="rotate(180deg)"/> } icon={ <IconSvg name="arrows/east-mini" w={ 5 } h={ 5 } transform="rotate(180deg)"/> }
isDisabled={ !hasNextPage || isLoading } isDisabled={ !hasNextPage || isLoading }
/> />
</Skeleton> </Skeleton>
......
...@@ -2,15 +2,6 @@ import React from 'react'; ...@@ -2,15 +2,6 @@ import React from 'react';
import RadioButtonGroup from '../RadioButtonGroup'; import RadioButtonGroup from '../RadioButtonGroup';
const TestIcon = ({ className }: {className?: string}) => {
return (
<svg viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg" className={ className }>
{ /* eslint-disable-next-line max-len */ }
<path fillRule="evenodd" clipRule="evenodd" d="M3.5 11a7.5 7.5 0 1 1 15 0 7.5 7.5 0 0 1-15 0ZM11 1C5.477 1 1 5.477 1 11s4.477 10 10 10 10-4.477 10-10S16.523 1 11 1Zm1.25 5a1.25 1.25 0 1 0-2.5 0v5c0 .69.56 1.25 1.25 1.25h5a1.25 1.25 0 1 0 0-2.5h-3.75V6Z" fill="currentColor" stroke="transparent" strokeWidth=".6" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
);
};
type Test = 'v1' | 'v2' | 'v3'; type Test = 'v1' | 'v2' | 'v3';
const RadioButtonGroupTest = () => { const RadioButtonGroupTest = () => {
...@@ -21,9 +12,9 @@ const RadioButtonGroupTest = () => { ...@@ -21,9 +12,9 @@ const RadioButtonGroupTest = () => {
defaultValue="v1" defaultValue="v1"
name="test" name="test"
options={ [ options={ [
{ value: 'v1', title: 'test option 1', icon: TestIcon, onlyIcon: false }, { value: 'v1', title: 'test option 1', icon: 'clock', onlyIcon: false },
{ value: 'v2', title: 'test 2', onlyIcon: false }, { value: 'v2', title: 'test 2', onlyIcon: false },
{ value: 'v2', title: 'test 2', icon: TestIcon, onlyIcon: true }, { value: 'v2', title: 'test 2', icon: 'clock', onlyIcon: true },
] } ] }
/> />
); );
......
import { Icon, IconButton, chakra, Skeleton } from '@chakra-ui/react'; import { IconButton, chakra, Skeleton } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import upDownArrow from 'icons/arrows/up-down.svg'; import IconSvg from 'ui/shared/IconSvg';
type Props = { type Props = {
onClick: () => void; onClick: () => void;
...@@ -17,7 +17,7 @@ const SortButton = ({ onClick, isActive, className, isLoading }: Props) => { ...@@ -17,7 +17,7 @@ const SortButton = ({ onClick, isActive, className, isLoading }: Props) => {
return ( return (
<IconButton <IconButton
icon={ <Icon as={ upDownArrow } boxSize={ 5 }/> } icon={ <IconSvg name="arrows/up-down" boxSize={ 5 }/> }
aria-label="sort" aria-label="sort"
size="sm" size="sm"
variant="outline" variant="outline"
......
import { TagLabel, TagLeftIcon, Tooltip } from '@chakra-ui/react'; import { TagLabel, Tooltip } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import errorIcon from 'icons/status/error.svg';
import pendingIcon from 'icons/status/pending.svg';
import successIcon from 'icons/status/success.svg';
import Tag from 'ui/shared/chakra/Tag'; import Tag from 'ui/shared/chakra/Tag';
import type { IconName } from 'ui/shared/IconSvg';
import IconSvg from 'ui/shared/IconSvg';
export type StatusTagType = 'ok' | 'error' | 'pending'; export type StatusTagType = 'ok' | 'error' | 'pending';
...@@ -16,20 +15,20 @@ export interface Props { ...@@ -16,20 +15,20 @@ export interface Props {
} }
const StatusTag = ({ type, text, errorText, isLoading }: Props) => { const StatusTag = ({ type, text, errorText, isLoading }: Props) => {
let icon; let icon: IconName;
let colorScheme; let colorScheme;
switch (type) { switch (type) {
case 'ok': case 'ok':
icon = successIcon; icon = 'status/success';
colorScheme = 'green'; colorScheme = 'green';
break; break;
case 'error': case 'error':
icon = errorIcon; icon = 'status/error';
colorScheme = 'red'; colorScheme = 'red';
break; break;
case 'pending': case 'pending':
icon = pendingIcon; icon = 'status/pending';
// FIXME: it's not gray on mockups // FIXME: it's not gray on mockups
// need to implement new color scheme or redefine colors here // need to implement new color scheme or redefine colors here
colorScheme = 'gray'; colorScheme = 'gray';
...@@ -39,7 +38,7 @@ const StatusTag = ({ type, text, errorText, isLoading }: Props) => { ...@@ -39,7 +38,7 @@ const StatusTag = ({ type, text, errorText, isLoading }: Props) => {
return ( return (
<Tooltip label={ errorText }> <Tooltip label={ errorText }>
<Tag colorScheme={ colorScheme } display="inline-flex" isLoading={ isLoading }> <Tag colorScheme={ colorScheme } display="inline-flex" isLoading={ isLoading }>
<TagLeftIcon boxSize={ 2.5 } as={ icon }/> <IconSvg boxSize={ 2.5 } name={ icon }/>
<TagLabel>{ text }</TagLabel> <TagLabel>{ text }</TagLabel>
</Tag> </Tag>
</Tooltip> </Tooltip>
......
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