Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
136edb64
Commit
136edb64
authored
Dec 20, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last part of migratin and eslint rule
parent
1cfab7e7
Changes
35
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
127 additions
and
153 deletions
+127
-153
.eslintrc.js
.eslintrc.js
+3
-0
AccountActionsMenu.tsx
ui/shared/AccountActionsMenu/AccountActionsMenu.tsx
+3
-3
PrivateTagMenuItem.tsx
ui/shared/AccountActionsMenu/items/PrivateTagMenuItem.tsx
+3
-3
PublicTagMenuItem.tsx
ui/shared/AccountActionsMenu/items/PublicTagMenuItem.tsx
+3
-3
TokenInfoMenuItem.tsx
ui/shared/AccountActionsMenu/items/TokenInfoMenuItem.tsx
+3
-3
AdditionalInfoButton.tsx
ui/shared/AdditionalInfoButton.tsx
+3
-4
ApiKeySnippet.tsx
ui/shared/ApiKeySnippet.tsx
+2
-3
AppErrorIcon.tsx
ui/shared/AppError/AppErrorIcon.tsx
+8
-11
AppErrorInvalidTxHash.tsx
ui/shared/AppError/custom/AppErrorInvalidTxHash.tsx
+3
-3
ClearButton.tsx
ui/shared/ClearButton.tsx
+3
-3
CopyToClipboard.tsx
ui/shared/CopyToClipboard.tsx
+2
-2
EmptySearchResult.tsx
ui/shared/EmptySearchResult.tsx
+4
-4
Hint.tsx
ui/shared/Hint.tsx
+2
-2
LinkExternal.tsx
ui/shared/LinkExternal.tsx
+3
-3
NetworkExplorers.tsx
ui/shared/NetworkExplorers.tsx
+4
-5
PageTitle.tsx
ui/shared/Page/PageTitle.tsx
+3
-3
DefaultView.tsx
ui/shared/Page/specs/DefaultView.tsx
+2
-3
LongNameAndManyTags.tsx
ui/shared/Page/specs/LongNameAndManyTags.tsx
+2
-3
PrevNext.tsx
ui/shared/PrevNext.tsx
+4
-4
ResetIconButton.tsx
ui/shared/ResetIconButton.tsx
+4
-4
TableItemActionButtons.tsx
ui/shared/TableItemActionButtons.tsx
+3
-4
TokenLogoPlaceholder.tsx
ui/shared/TokenLogoPlaceholder.tsx
+4
-4
TokenTransferListItem.tsx
ui/shared/TokenTransfer/TokenTransferListItem.tsx
+2
-3
UserAvatar.tsx
ui/shared/UserAvatar.tsx
+3
-3
ChartWidget.tsx
ui/shared/chart/ChartWidget.tsx
+6
-11
FullscreenChartModal.tsx
ui/shared/chart/FullscreenChartModal.tsx
+3
-3
FilterButton.tsx
ui/shared/filters/FilterButton.tsx
+3
-3
FilterInput.tsx
ui/shared/filters/FilterInput.tsx
+3
-3
FileSnippet.tsx
ui/shared/forms/FileSnippet.tsx
+12
-16
CodeEditorMainFileIndicator.tsx
ui/shared/monaco/CodeEditorMainFileIndicator.tsx
+3
-3
NftFallback.tsx
ui/shared/nft/NftFallback.tsx
+4
-4
Pagination.tsx
ui/shared/pagination/Pagination.tsx
+4
-4
RadioButtonGroupTest.tsx
ui/shared/radioButtonGroup/specs/RadioButtonGroupTest.tsx
+2
-11
SortButton.tsx
ui/shared/sort/SortButton.tsx
+3
-3
StatusTag.tsx
ui/shared/statusTag/StatusTag.tsx
+8
-9
No files found.
.eslintrc.js
View file @
136edb64
...
@@ -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
=
{
...
...
ui/shared/AccountActionsMenu/AccountActionsMenu.tsx
View file @
136edb64
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
}
/>
<
Icon
Svg
name=
"arrows/east-mini"
transform=
"rotate(-90deg)"
boxSize=
{
5
}
ml=
{
1
}
/>
</
Flex
>
</
Flex
>
</
MenuButton
>
</
MenuButton
>
</
Skeleton
>
</
Skeleton
>
...
...
ui/shared/AccountActionsMenu/items/PrivateTagMenuItem.tsx
View file @
136edb64
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
}
/>
<
Icon
Svg
name=
"privattags"
boxSize=
{
6
}
mr=
{
2
}
/>
<
span
>
Add private tag
</
span
>
<
span
>
Add private tag
</
span
>
</
MenuItem
>
</
MenuItem
>
{
type
===
'
tx
'
?
{
type
===
'
tx
'
?
...
...
ui/shared/AccountActionsMenu/items/PublicTagMenuItem.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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
}
/>
<
Icon
Svg
name=
"publictags"
boxSize=
{
6
}
mr=
{
2
}
/>
<
span
>
Add public tag
</
span
>
<
span
>
Add public tag
</
span
>
</
MenuItem
>
</
MenuItem
>
);
);
...
...
ui/shared/AccountActionsMenu/items/TokenInfoMenuItem.tsx
View file @
136edb64
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
=
<
Icon
Svg
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
()))
{
...
...
ui/shared/AdditionalInfoButton.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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
<
Icon
Svg
as=
{
infoIcon
}
name=
"info"
boxSize=
{
5
}
boxSize=
{
5
}
color=
"link"
color=
"link"
_hover=
{
{
color
:
'
link_hovered
'
}
}
_hover=
{
{
color
:
'
link_hovered
'
}
}
...
...
ui/shared/ApiKeySnippet.tsx
View file @
136edb64
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
}
/>
<
Icon
Svg
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
}
>
...
...
ui/shared/AppError/AppErrorIcon.tsx
View file @
136edb64
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
<
Icon
Svg
name
=
{
ICONS
[
String
(
statusCode
)]
||
ICONS
[
'
500
'
]
}
width=
"200px"
height=
"auto"
color=
"text"
/>;
};
};
export
default
AppErrorIcon
;
export
default
AppErrorIcon
;
ui/shared/AppError/custom/AppErrorInvalidTxHash.tsx
View file @
136edb64
/* 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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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"
/>
<
Icon
Svg
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
}
/>
...
...
ui/shared/ClearButton.tsx
View file @
136edb64
import
{
chakra
,
Icon
,
Icon
Button
,
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
Icon
Svg
name=
"status/error"
boxSize=
{
3
}
color=
{
iconColor
}
_hover=
{
{
color
:
iconColorHover
}
}
/>
}
size=
"sm"
size=
"sm"
onClick=
{
onClick
}
onClick=
{
onClick
}
/>
/>
...
...
ui/shared/CopyToClipboard.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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"
...
...
ui/shared/EmptySearchResult.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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
<
Icon
Svg
as=
{
emptyIcon
}
name=
"empty_search_result"
boxSize=
{
60
}
boxSize=
{
60
}
display=
"block"
display=
"block"
/>
/>
...
...
ui/shared/Hint.tsx
View file @
136edb64
...
@@ -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
I
nfoIcon
from
'
icons/info.s
vg
'
;
import
I
conSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
I
nfoIcon
/>
}
icon=
{
<
I
conSvg
name=
"info"
boxSize=
{
5
}
/>
}
boxSize=
{
5
}
boxSize=
{
5
}
variant=
"simple"
variant=
"simple"
display=
"inline-block"
display=
"inline-block"
...
...
ui/shared/LinkExternal.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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"
/>
<
Icon
Svg
name=
"arrows/north-east"
boxSize=
{
4
}
verticalAlign=
"middle"
color=
"gray.400"
/>
</
Link
>
</
Link
>
);
);
};
};
...
...
ui/shared/NetworkExplorers.tsx
View file @
136edb64
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
}
/>
<
Icon
Svg
name=
"explorer"
boxSize=
{
5
}
/>
<
Icon
as=
{
arrowIcon
}
transform=
{
isOpen
?
'
rotate(90deg)
'
:
'
rotate(-90deg)
'
}
transitionDuration=
"faster"
boxSize=
{
5
}
/>
<
Icon
Svg
name=
"arrows/east-mini"
transform=
{
isOpen
?
'
rotate(90deg)
'
:
'
rotate(-90deg)
'
}
transitionDuration=
"faster"
boxSize=
{
5
}
/>
</
Button
>
</
Button
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
w=
"240px"
>
<
PopoverContent
w=
"240px"
>
...
...
ui/shared/Page/PageTitle.tsx
View file @
136edb64
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
=
<
Icon
Svg
name=
"arrows/east"
boxSize=
{
6
}
transform=
"rotate(180deg)"
margin=
"auto"
color=
"gray.400"
/>;
if
(
'
url
'
in
props
)
{
if
(
'
url
'
in
props
)
{
return
(
return
(
...
...
ui/shared/Page/specs/DefaultView.tsx
View file @
136edb64
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"
/>
<
Icon
Svg
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
'
},
...
...
ui/shared/Page/specs/LongNameAndManyTags.tsx
View file @
136edb64
/* 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"
/>
<
Icon
Svg
name=
"verified_token"
color=
"green.500"
boxSize=
{
6
}
cursor=
"pointer"
/>
<
EntityTags
<
EntityTags
data=
{
{
data=
{
{
private_tags
:
[
privateTag
],
private_tags
:
[
privateTag
],
...
...
ui/shared/PrevNext.tsx
View file @
136edb64
import
{
Box
,
Icon
,
Icon
Button
,
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
Icon
Svg
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=
{
<
Icon
Svg
name=
"arrows/east-mini"
boxSize=
{
6
}
transform=
"rotate(180deg)"
/>
}
h=
{
6
}
h=
{
6
}
borderRadius=
"sm"
borderRadius=
"sm"
variant=
"subtle"
variant=
"subtle"
...
...
ui/shared/ResetIconButton.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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
<
Icon
Svg
as=
{
crossIcon
}
name=
"cross"
boxSize=
{
5
}
boxSize=
{
5
}
ml=
{
1
}
ml=
{
1
}
color=
{
resetTokenIconColor
}
color=
{
resetTokenIconColor
}
...
...
ui/shared/TableItemActionButtons.tsx
View file @
136edb64
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
}
...
...
ui/shared/TokenLogoPlaceholder.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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
<
Icon
Svg
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"
...
...
ui/shared/TokenTransfer/TokenTransferListItem.tsx
View file @
136edb64
...
@@ -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
}
/>
<
Icon
Svg
name=
"arrows/east"
boxSize=
{
6
}
color=
"gray.500"
isLoading=
{
isLoading
}
flexShrink=
{
0
}
/>
}
}
<
AddressEntity
<
AddressEntity
address=
{
to
}
address=
{
to
}
...
...
ui/shared/UserAvatar.tsx
View file @
136edb64
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
?
<
Icon
Svg
name=
"profile"
boxSize=
{
5
}
/>
:
undefined
}
onError=
{
handleImageLoadError
}
onError=
{
handleImageLoadError
}
/>
/>
);
);
...
...
ui/shared/chart/ChartWidget.tsx
View file @
136edb64
...
@@ -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=
{
<
Icon
Svg
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=
{
<
Icon
Svg
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
}
/>
<
Icon
Svg
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
}
/>
<
Icon
Svg
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
}
/>
<
Icon
Svg
name=
"files/csv"
boxSize=
{
5
}
mr=
{
3
}
/>
Save as CSV
Save as CSV
</
MenuItem
>
</
MenuItem
>
</
MenuList
>
</
MenuList
>
...
...
ui/shared/chart/FullscreenChartModal.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
Icon
Svg
name=
"repeat_arrow"
w=
{
4
}
h=
{
4
}
/>
}
colorScheme=
"blue"
colorScheme=
"blue"
gridColumn=
{
2
}
gridColumn=
{
2
}
justifySelf=
"end"
justifySelf=
"end"
...
...
ui/shared/filters/FilterButton.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
const
FilterIcon
=
<
Icon
as=
{
filterIcon
}
boxSize=
{
5
}
mr=
{
{
base
:
0
,
lg
:
2
}
}
/>;
const
FilterIcon
=
<
Icon
Svg
name=
"filter"
boxSize=
{
5
}
mr=
{
{
base
:
0
,
lg
:
2
}
}
/>;
interface
Props
{
interface
Props
{
isActive
?:
boolean
;
isActive
?:
boolean
;
...
...
ui/shared/filters/FilterInput.tsx
View file @
136edb64
import
{
chakra
,
I
con
,
I
nput
,
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
}
/>
<
Icon
Svg
name=
"search"
color=
{
iconColor
}
/>
</
InputLeftElement
>
</
InputLeftElement
>
<
Input
<
Input
...
...
ui/shared/forms/FileSnippet.tsx
View file @
136edb64
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
<
Icon
Svg
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"
/>
<
Icon
Svg
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"
...
...
ui/shared/monaco/CodeEditorMainFileIndicator.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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"
/>
<
Icon
Svg
name=
"star_filled"
boxSize=
{
3
}
display=
"block"
color=
"green.500"
/>
</
Box
>
</
Box
>
</
Tooltip
>
</
Tooltip
>
);
);
...
...
ui/shared/nft/NftFallback.tsx
View file @
136edb64
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
const
NftFallback
=
({
className
}:
{
className
?:
string
})
=>
{
const
NftFallback
=
({
className
}:
{
className
?:
string
})
=>
{
return
(
return
(
<
Icon
<
Icon
Svg
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
'
)
}
...
...
ui/shared/pagination/Pagination.tsx
View file @
136edb64
import
{
Button
,
Skeleton
,
Flex
,
Icon
,
Icon
Button
,
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
Icon
Svg
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=
{
<
Icon
Svg
name=
"arrows/east-mini"
w=
{
5
}
h=
{
5
}
transform=
"rotate(180deg)"
/>
}
isDisabled=
{
!
hasNextPage
||
isLoading
}
isDisabled=
{
!
hasNextPage
||
isLoading
}
/>
/>
</
Skeleton
>
</
Skeleton
>
...
...
ui/shared/radioButtonGroup/specs/RadioButtonGroupTest.tsx
View file @
136edb64
...
@@ -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
},
]
}
]
}
/
>
/
>
);
);
...
...
ui/shared/sort/SortButton.tsx
View file @
136edb64
import
{
Icon
,
Icon
Button
,
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.s
vg
'
;
import
IconSvg
from
'
ui/shared/IconS
vg
'
;
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=
{
<
Icon
Svg
name=
"arrows/up-down"
boxSize=
{
5
}
/>
}
aria
-
label=
"sort"
aria
-
label=
"sort"
size=
"sm"
size=
"sm"
variant=
"outline"
variant=
"outline"
...
...
ui/shared/statusTag/StatusTag.tsx
View file @
136edb64
import
{
TagLabel
,
T
agLeftIcon
,
T
ooltip
}
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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment