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
d13f87b4
Commit
d13f87b4
authored
Feb 17, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts and verified contracts pages
parent
16408afe
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
215 additions
and
202 deletions
+215
-202
index.tsx
pages/accounts/index.tsx
+2
-2
[slug].tsx
pages/accounts/label/[slug].tsx
+2
-2
verified-contracts.tsx
pages/verified-contracts.tsx
+2
-2
verifiedContracts.ts
types/api/verifiedContracts.ts
+1
-1
AddressesListItem.tsx
ui/addresses/AddressesListItem.tsx
+13
-13
AddressesTable.tsx
ui/addresses/AddressesTable.tsx
+14
-15
AddressesTableItem.tsx
ui/addresses/AddressesTableItem.tsx
+21
-20
AddressesLabelSearchListItem.tsx
ui/addressesLabelSearch/AddressesLabelSearchListItem.tsx
+7
-7
AddressesLabelSearchTable.tsx
ui/addressesLabelSearch/AddressesLabelSearchTable.tsx
+12
-13
AddressesLabelSearchTableItem.tsx
ui/addressesLabelSearch/AddressesLabelSearchTableItem.tsx
+14
-13
Accounts.tsx
ui/pages/Accounts.tsx
+9
-8
AccountsLabelSearch.tsx
ui/pages/AccountsLabelSearch.tsx
+11
-13
VerifiedContracts.tsx
ui/pages/VerifiedContracts.tsx
+23
-18
VerifiedContractsFilter.tsx
ui/verifiedContracts/VerifiedContractsFilter.tsx
+7
-2
VerifiedContractsListItem.tsx
ui/verifiedContracts/VerifiedContractsListItem.tsx
+17
-17
VerifiedContractsTable.tsx
ui/verifiedContracts/VerifiedContractsTable.tsx
+22
-22
VerifiedContractsTableItem.tsx
ui/verifiedContracts/VerifiedContractsTableItem.tsx
+33
-30
utils.ts
ui/verifiedContracts/utils.ts
+5
-4
No files found.
pages/accounts/index.tsx
View file @
d13f87b4
...
@@ -4,12 +4,12 @@ import React from 'react';
...
@@ -4,12 +4,12 @@ import React from 'react';
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
//
const Accounts = dynamic(() => import('ui/pages/Accounts'), { ssr: false });
const
Accounts
=
dynamic
(()
=>
import
(
'
ui/pages/Accounts
'
),
{
ssr
:
false
});
const
Page
:
NextPage
=
()
=>
{
const
Page
:
NextPage
=
()
=>
{
return
(
return
(
<
PageNextJs
pathname=
"/accounts"
>
<
PageNextJs
pathname=
"/accounts"
>
{
/* <Accounts/> */
}
<
Accounts
/>
</
PageNextJs
>
</
PageNextJs
>
);
);
};
};
...
...
pages/accounts/label/[slug].tsx
View file @
d13f87b4
...
@@ -4,12 +4,12 @@ import React from 'react';
...
@@ -4,12 +4,12 @@ import React from 'react';
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
//
const AccountsLabelSearch = dynamic(() => import('ui/pages/AccountsLabelSearch'), { ssr: false });
const
AccountsLabelSearch
=
dynamic
(()
=>
import
(
'
ui/pages/AccountsLabelSearch
'
),
{
ssr
:
false
});
const
Page
:
NextPage
=
()
=>
{
const
Page
:
NextPage
=
()
=>
{
return
(
return
(
<
PageNextJs
pathname=
"/accounts/label/[slug]"
>
<
PageNextJs
pathname=
"/accounts/label/[slug]"
>
{
/* <AccountsLabelSearch/> */
}
<
AccountsLabelSearch
/>
</
PageNextJs
>
</
PageNextJs
>
);
);
};
};
...
...
pages/verified-contracts.tsx
View file @
d13f87b4
...
@@ -4,12 +4,12 @@ import React from 'react';
...
@@ -4,12 +4,12 @@ import React from 'react';
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
//
const VerifiedContracts = dynamic(() => import('ui/pages/VerifiedContracts'), { ssr: false });
const
VerifiedContracts
=
dynamic
(()
=>
import
(
'
ui/pages/VerifiedContracts
'
),
{
ssr
:
false
});
const
Page
:
NextPage
=
()
=>
{
const
Page
:
NextPage
=
()
=>
{
return
(
return
(
<
PageNextJs
pathname=
"/verified-contracts"
>
<
PageNextJs
pathname=
"/verified-contracts"
>
{
/* <VerifiedContracts/> */
}
<
VerifiedContracts
/>
</
PageNextJs
>
</
PageNextJs
>
);
);
};
};
...
...
types/api/verifiedContracts.ts
View file @
d13f87b4
...
@@ -5,4 +5,4 @@ export interface VerifiedContractsSorting {
...
@@ -5,4 +5,4 @@ export interface VerifiedContractsSorting {
export
type
VerifiedContractsSortingField
=
VerifiedContractsSorting
[
'
sort
'
];
export
type
VerifiedContractsSortingField
=
VerifiedContractsSorting
[
'
sort
'
];
export
type
VerifiedContractsSortingValue
=
`
${
VerifiedContractsSortingField
}
-
${
VerifiedContractsSorting
[
'
order
'
]
}
`
;
export
type
VerifiedContractsSortingValue
=
`
${
VerifiedContractsSortingField
}
-
${
VerifiedContractsSorting
[
'
order
'
]
}
`
|
'
default
'
;
ui/addresses/AddressesListItem.tsx
View file @
d13f87b4
...
@@ -7,8 +7,8 @@ import type { AddressesItem } from 'types/api/addresses';
...
@@ -7,8 +7,8 @@ import type { AddressesItem } from 'types/api/addresses';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
ZERO
}
from
'
lib/consts
'
;
import
{
ZERO
}
from
'
lib/consts
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
Tag
from
'
ui/shared/chakra/T
ag
'
;
import
{
Tag
}
from
'
toolkit/chakra/t
ag
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
...
@@ -38,30 +38,30 @@ const AddressesListItem = ({
...
@@ -38,30 +38,30 @@ const AddressesListItem = ({
mr=
{
2
}
mr=
{
2
}
truncation=
"constant"
truncation=
"constant"
/>
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
ml=
"auto"
minW=
{
6
}
color=
"text_secondary"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
ml=
"auto"
minW=
{
6
}
color=
"text_secondary"
>
<
span
>
{
index
}
</
span
>
<
span
>
{
index
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
{
item
.
public_tags
!==
null
&&
item
.
public_tags
.
length
>
0
&&
item
.
public_tags
.
map
(
tag
=>
(
{
item
.
public_tags
!==
null
&&
item
.
public_tags
.
length
>
0
&&
item
.
public_tags
.
map
(
tag
=>
(
<
Tag
key=
{
tag
.
label
}
isLoading=
{
isLoading
}
>
{
tag
.
display_name
}
</
Tag
>
<
Tag
key=
{
tag
.
label
}
loading=
{
isLoading
}
truncated
>
{
tag
.
display_name
}
</
Tag
>
))
}
))
}
<
HStack
spacing
=
{
3
}
maxW=
"100%"
alignItems=
"flex-start"
>
<
HStack
gap
=
{
3
}
maxW=
"100%"
alignItems=
"flex-start"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
flexShrink=
{
0
}
>
{
`Balance ${ currencyUnits.ether }`
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
flexShrink=
{
0
}
>
{
`Balance ${ currencyUnits.ether }`
}
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
"0"
whiteSpace=
"pre-wrap"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
"0"
whiteSpace=
"pre-wrap"
>
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
{
!
totalSupply
.
eq
(
ZERO
)
&&
(
{
!
totalSupply
.
eq
(
ZERO
)
&&
(
<
HStack
spacing
=
{
3
}
>
<
HStack
gap
=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Percentage
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Percentage
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
span
>
{
addressBalance
.
div
(
BigNumber
(
totalSupply
)).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
span
>
<
span
>
{
addressBalance
.
div
(
BigNumber
(
totalSupply
)).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
)
}
)
}
<
HStack
spacing
=
{
3
}
>
<
HStack
gap
=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Txn count
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Txn count
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
span
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
span
>
<
span
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
...
...
ui/addresses/AddressesTable.tsx
View file @
d13f87b4
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
type
BigNumber
from
'
bignumber.js
'
;
import
type
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -6,7 +5,7 @@ import type { AddressesItem } from 'types/api/addresses';
...
@@ -6,7 +5,7 @@ import type { AddressesItem } from 'types/api/addresses';
import
{
ZERO
}
from
'
lib/consts
'
;
import
{
ZERO
}
from
'
lib/consts
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressesTableItem
from
'
./AddressesTableItem
'
;
import
AddressesTableItem
from
'
./AddressesTableItem
'
;
...
@@ -21,17 +20,17 @@ interface Props {
...
@@ -21,17 +20,17 @@ interface Props {
const
AddressesTable
=
({
items
,
totalSupply
,
pageStartIndex
,
top
,
isLoading
}:
Props
)
=>
{
const
AddressesTable
=
({
items
,
totalSupply
,
pageStartIndex
,
top
,
isLoading
}:
Props
)
=>
{
const
hasPercentage
=
!
totalSupply
.
eq
(
ZERO
);
const
hasPercentage
=
!
totalSupply
.
eq
(
ZERO
);
return
(
return
(
<
Table
>
<
Table
Root
>
<
T
head
top=
{
top
}
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
width=
"64px"
>
Rank
</
Th
>
<
T
ableColumnHeader
width=
"64px"
>
Rank
</
TableColumnHeader
>
<
T
h
width=
{
hasPercentage
?
'
50%
'
:
'
60%
'
}
>
Address
</
Th
>
<
T
ableColumnHeader
width=
{
hasPercentage
?
'
50%
'
:
'
60%
'
}
>
Address
</
TableColumnHeader
>
<
T
h
width=
{
hasPercentage
?
'
20%
'
:
'
25%
'
}
isNumeric
>
{
`Balance ${ currencyUnits.ether }`
}
</
Th
>
<
T
ableColumnHeader
width=
{
hasPercentage
?
'
20%
'
:
'
25%
'
}
isNumeric
>
{
`Balance ${ currencyUnits.ether }`
}
</
TableColumnHeader
>
{
hasPercentage
&&
<
T
h
width=
"15%"
isNumeric
>
Percentage
</
Th
>
}
{
hasPercentage
&&
<
T
ableColumnHeader
width=
"15%"
isNumeric
>
Percentage
</
TableColumnHeader
>
}
<
T
h
width=
"15%"
isNumeric
>
Txn count
</
Th
>
<
T
ableColumnHeader
width=
"15%"
isNumeric
>
Txn count
</
TableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
>
</
T
ableHeaderSticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
items
.
map
((
item
,
index
)
=>
(
{
items
.
map
((
item
,
index
)
=>
(
<
AddressesTableItem
<
AddressesTableItem
key=
{
item
.
hash
+
(
isLoading
?
index
:
''
)
}
key=
{
item
.
hash
+
(
isLoading
?
index
:
''
)
}
...
@@ -42,8 +41,8 @@ const AddressesTable = ({ items, totalSupply, pageStartIndex, top, isLoading }:
...
@@ -42,8 +41,8 @@ const AddressesTable = ({ items, totalSupply, pageStartIndex, top, isLoading }:
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
);
);
};
};
...
...
ui/addresses/AddressesTableItem.tsx
View file @
d13f87b4
import
{
T
r
,
Td
,
T
ext
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Text
,
Flex
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
{
Tag
}
from
'
toolkit/chakra/tag
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
type
Props
=
{
type
Props
=
{
...
@@ -29,13 +30,13 @@ const AddressesTableItem = ({
...
@@ -29,13 +30,13 @@ const AddressesTableItem = ({
const
addressBalanceChunks
=
addressBalance
.
dp
(
8
).
toFormat
().
split
(
'
.
'
);
const
addressBalanceChunks
=
addressBalance
.
dp
(
8
).
toFormat
().
split
(
'
.
'
);
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
>
<
T
ableCell
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
minW=
{
6
}
lineHeight=
"24px"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
minW=
{
6
}
lineHeight=
"24px"
>
{
index
}
{
index
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
<
T
d
>
<
T
ableCell
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
AddressEntity
<
AddressEntity
address=
{
item
}
address=
{
item
}
...
@@ -44,27 +45,27 @@ const AddressesTableItem = ({
...
@@ -44,27 +45,27 @@ const AddressesTableItem = ({
my=
"2px"
my=
"2px"
/>
/>
{
item
.
public_tags
&&
item
.
public_tags
.
length
?
item
.
public_tags
.
map
(
tag
=>
(
{
item
.
public_tags
&&
item
.
public_tags
.
length
?
item
.
public_tags
.
map
(
tag
=>
(
<
Tag
key=
{
tag
.
label
}
isLoading=
{
isLoading
}
isT
runcated
>
{
tag
.
display_name
}
</
Tag
>
<
Tag
key=
{
tag
.
label
}
loading=
{
isLoading
}
t
runcated
>
{
tag
.
display_name
}
</
Tag
>
))
:
null
}
))
:
null
}
</
Flex
>
</
Flex
>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
maxW=
"100%"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
maxW=
"100%"
>
<
Text
lineHeight=
"24px"
as=
"span"
>
{
addressBalanceChunks
[
0
]
+
(
addressBalanceChunks
[
1
]
?
'
.
'
:
''
)
}
</
Text
>
<
Text
lineHeight=
"24px"
as=
"span"
>
{
addressBalanceChunks
[
0
]
+
(
addressBalanceChunks
[
1
]
?
'
.
'
:
''
)
}
</
Text
>
<
Text
lineHeight=
"24px"
variant=
"
secondary"
as=
"span"
>
{
addressBalanceChunks
[
1
]
}
</
Text
>
<
Text
lineHeight=
"24px"
color=
"text.
secondary"
as=
"span"
>
{
addressBalanceChunks
[
1
]
}
</
Text
>
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
{
hasPercentage
&&
(
{
hasPercentage
&&
(
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Text
lineHeight=
"24px"
>
{
addressBalance
.
div
(
totalSupply
).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
Text
>
<
Text
lineHeight=
"24px"
>
{
addressBalance
.
div
(
totalSupply
).
multipliedBy
(
100
).
dp
(
8
).
toFormat
()
+
'
%
'
}
</
Text
>
</
T
d
>
</
T
ableCell
>
)
}
)
}
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
lineHeight=
"24px"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
lineHeight=
"24px"
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/addressesLabelSearch/AddressesLabelSearchListItem.tsx
View file @
d13f87b4
...
@@ -6,7 +6,7 @@ import type { AddressesItem } from 'types/api/addresses';
...
@@ -6,7 +6,7 @@ import type { AddressesItem } from 'types/api/addresses';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
...
@@ -30,15 +30,15 @@ const AddressesLabelSearchListItem = ({
...
@@ -30,15 +30,15 @@ const AddressesLabelSearchListItem = ({
fontWeight=
{
700
}
fontWeight=
{
700
}
w=
"100%"
w=
"100%"
/>
/>
<
HStack
spacing
=
{
3
}
maxW=
"100%"
alignItems=
"flex-start"
>
<
HStack
gap
=
{
3
}
maxW=
"100%"
alignItems=
"flex-start"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
flexShrink=
{
0
}
>
{
`Balance ${ currencyUnits.ether }`
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
flexShrink=
{
0
}
>
{
`Balance ${ currencyUnits.ether }`
}
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
"0"
whiteSpace=
"pre-wrap"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
"0"
whiteSpace=
"pre-wrap"
>
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
<
span
>
{
addressBalance
.
dp
(
8
).
toFormat
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
<
HStack
spacing
=
{
3
}
>
<
HStack
gap
=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Txn count
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Txn count
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
>
<
span
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
span
>
<
span
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
...
...
ui/addressesLabelSearch/AddressesLabelSearchTable.tsx
View file @
d13f87b4
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressesLabelSearchTableItem
from
'
./AddressesLabelSearchTableItem
'
;
import
AddressesLabelSearchTableItem
from
'
./AddressesLabelSearchTableItem
'
;
...
@@ -16,15 +15,15 @@ interface Props {
...
@@ -16,15 +15,15 @@ interface Props {
const
AddressesLabelSearchTable
=
({
items
,
top
,
isLoading
}:
Props
)
=>
{
const
AddressesLabelSearchTable
=
({
items
,
top
,
isLoading
}:
Props
)
=>
{
return
(
return
(
<
Table
>
<
Table
Root
>
<
T
head
top=
{
top
}
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
width=
"70%"
>
Address
</
Th
>
<
T
ableColumnHeader
width=
"70%"
>
Address
</
TableColumnHeader
>
<
T
h
width=
"15%"
isNumeric
>
{
`Balance ${ currencyUnits.ether }`
}
</
Th
>
<
T
ableColumnHeader
width=
"15%"
isNumeric
>
{
`Balance ${ currencyUnits.ether }`
}
</
TableColumnHeader
>
<
T
h
width=
"15%"
isNumeric
>
Txn count
</
Th
>
<
T
ableColumnHeader
width=
"15%"
isNumeric
>
Txn count
</
TableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
>
</
T
ableHeaderSticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
items
.
map
((
item
,
index
)
=>
(
{
items
.
map
((
item
,
index
)
=>
(
<
AddressesLabelSearchTableItem
<
AddressesLabelSearchTableItem
key=
{
item
.
hash
+
(
isLoading
?
index
:
''
)
}
key=
{
item
.
hash
+
(
isLoading
?
index
:
''
)
}
...
@@ -32,8 +31,8 @@ const AddressesLabelSearchTable = ({ items, top, isLoading }: Props) => {
...
@@ -32,8 +31,8 @@ const AddressesLabelSearchTable = ({ items, top, isLoading }: Props) => {
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
);
);
};
};
...
...
ui/addressesLabelSearch/AddressesLabelSearchTableItem.tsx
View file @
d13f87b4
import
{
T
r
,
Td
,
T
ext
}
from
'
@chakra-ui/react
'
;
import
{
Text
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
type
{
AddressesItem
}
from
'
types/api/addresses
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
type
Props
=
{
type
Props
=
{
...
@@ -22,27 +23,27 @@ const AddressesLabelSearchTableItem = ({
...
@@ -22,27 +23,27 @@ const AddressesLabelSearchTableItem = ({
const
addressBalanceChunks
=
addressBalance
.
dp
(
8
).
toFormat
().
split
(
'
.
'
);
const
addressBalanceChunks
=
addressBalance
.
dp
(
8
).
toFormat
().
split
(
'
.
'
);
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
>
<
T
ableCell
>
<
AddressEntity
<
AddressEntity
address=
{
item
}
address=
{
item
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
fontWeight=
{
700
}
fontWeight=
{
700
}
my=
"2px"
my=
"2px"
/>
/>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
maxW=
"100%"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
maxW=
"100%"
>
<
Text
lineHeight=
"24px"
as=
"span"
>
{
addressBalanceChunks
[
0
]
+
(
addressBalanceChunks
[
1
]
?
'
.
'
:
''
)
}
</
Text
>
<
Text
lineHeight=
"24px"
as=
"span"
>
{
addressBalanceChunks
[
0
]
+
(
addressBalanceChunks
[
1
]
?
'
.
'
:
''
)
}
</
Text
>
<
Text
lineHeight=
"24px"
variant=
"
secondary"
as=
"span"
>
{
addressBalanceChunks
[
1
]
}
</
Text
>
<
Text
lineHeight=
"24px"
color=
"text.
secondary"
as=
"span"
>
{
addressBalanceChunks
[
1
]
}
</
Text
>
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
lineHeight=
"24px"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
lineHeight=
"24px"
>
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
{
Number
(
item
.
transaction_count
).
toLocaleString
()
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/pages/Accounts.tsx
View file @
d13f87b4
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -45,7 +45,7 @@ const Accounts = () => {
...
@@ -45,7 +45,7 @@ const Accounts = () => {
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
AddressesTable
<
AddressesTable
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
items=
{
data
.
items
}
items=
{
data
.
items
}
...
@@ -53,8 +53,8 @@ const Accounts = () => {
...
@@ -53,8 +53,8 @@ const Accounts = () => {
pageStartIndex=
{
pageStartIndex
}
pageStartIndex=
{
pageStartIndex
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
/>
/>
</
Hide
>
</
Box
>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
{
data
.
items
.
map
((
item
,
index
)
=>
{
{
data
.
items
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
AddressesListItem
<
AddressesListItem
...
@@ -66,7 +66,7 @@ const Accounts = () => {
...
@@ -66,7 +66,7 @@ const Accounts = () => {
/>
/>
);
);
})
}
})
}
</
Show
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
...
@@ -75,11 +75,12 @@ const Accounts = () => {
...
@@ -75,11 +75,12 @@ const Accounts = () => {
<
PageTitle
title=
"Top accounts"
withTextAd
/>
<
PageTitle
title=
"Top accounts"
withTextAd
/>
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no accounts."
emptyText=
"There are no accounts."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</>
</>
);
);
};
};
...
...
ui/pages/AccountsLabelSearch.tsx
View file @
d13f87b4
import
{
chakra
,
Flex
,
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
chakra
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -7,10 +7,10 @@ import type { EntityTag as TEntityTag, EntityTagType } from 'ui/shared/EntityTag
...
@@ -7,10 +7,10 @@ import type { EntityTag as TEntityTag, EntityTagType } from 'ui/shared/EntityTag
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
TOP_ADDRESS
}
from
'
stubs/address
'
;
import
{
TOP_ADDRESS
}
from
'
stubs/address
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
AddressesLabelSearchListItem
from
'
ui/addressesLabelSearch/AddressesLabelSearchListItem
'
;
import
AddressesLabelSearchListItem
from
'
ui/addressesLabelSearch/AddressesLabelSearchListItem
'
;
import
AddressesLabelSearchTable
from
'
ui/addressesLabelSearch/AddressesLabelSearchTable
'
;
import
AddressesLabelSearchTable
from
'
ui/addressesLabelSearch/AddressesLabelSearchTable
'
;
import
{
ACTION_BAR_HEIGHT_DESKTOP
}
from
'
ui/shared/ActionBar
'
;
import
{
ACTION_BAR_HEIGHT_DESKTOP
}
from
'
ui/shared/ActionBar
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
EntityTag
from
'
ui/shared/EntityTags/EntityTag
'
;
import
EntityTag
from
'
ui/shared/EntityTags/EntityTag
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -43,14 +43,14 @@ const AccountsLabelSearch = () => {
...
@@ -43,14 +43,14 @@ const AccountsLabelSearch = () => {
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
AddressesLabelSearchTable
<
AddressesLabelSearchTable
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
items=
{
data
.
items
}
items=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
/>
/>
</
Hide
>
</
Box
>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
{
data
.
items
.
map
((
item
,
index
)
=>
{
{
data
.
items
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
AddressesLabelSearchListItem
<
AddressesLabelSearchListItem
...
@@ -60,7 +60,7 @@ const AccountsLabelSearch = () => {
...
@@ -60,7 +60,7 @@ const AccountsLabelSearch = () => {
/>
/>
);
);
})
}
})
}
</
Show
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
...
@@ -80,10 +80,7 @@ const AccountsLabelSearch = () => {
...
@@ -80,10 +80,7 @@ const AccountsLabelSearch = () => {
return
(
return
(
<
Flex
alignItems=
"center"
columnGap=
{
2
}
flexWrap=
"wrap"
rowGap=
{
1
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
flexWrap=
"wrap"
rowGap=
{
1
}
>
<
Skeleton
<
Skeleton
loading=
{
isPlaceholderData
}
display=
"inline-block"
>
isLoaded=
{
!
isPlaceholderData
}
display=
"inline-block"
>
Found
{
'
'
}
Found
{
'
'
}
<
chakra
.
span
fontWeight=
{
700
}
>
<
chakra
.
span
fontWeight=
{
700
}
>
{
num
}{
data
?.
next_page_params
||
pagination
.
page
>
1
?
'
+
'
:
''
}
{
num
}{
data
?.
next_page_params
||
pagination
.
page
>
1
?
'
+
'
:
''
}
...
@@ -102,11 +99,12 @@ const AccountsLabelSearch = () => {
...
@@ -102,11 +99,12 @@ const AccountsLabelSearch = () => {
<
PageTitle
title=
"Search result"
withTextAd
/>
<
PageTitle
title=
"Search result"
withTextAd
/>
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
{
text
}
emptyText=
{
text
}
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</>
</>
);
);
};
};
...
...
ui/pages/VerifiedContracts.tsx
View file @
d13f87b4
import
{
Box
,
Hide
,
HStack
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
createListCollection
,
HStack
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -27,12 +27,16 @@ import VerifiedContractsFilter from 'ui/verifiedContracts/VerifiedContractsFilte
...
@@ -27,12 +27,16 @@ import VerifiedContractsFilter from 'ui/verifiedContracts/VerifiedContractsFilte
import
VerifiedContractsList
from
'
ui/verifiedContracts/VerifiedContractsList
'
;
import
VerifiedContractsList
from
'
ui/verifiedContracts/VerifiedContractsList
'
;
import
VerifiedContractsTable
from
'
ui/verifiedContracts/VerifiedContractsTable
'
;
import
VerifiedContractsTable
from
'
ui/verifiedContracts/VerifiedContractsTable
'
;
const
sortCollection
=
createListCollection
({
items
:
SORT_OPTIONS
,
});
const
VerifiedContracts
=
()
=>
{
const
VerifiedContracts
=
()
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
searchTerm
,
setSearchTerm
]
=
React
.
useState
(
getQueryParamString
(
router
.
query
.
q
)
||
undefined
);
const
[
searchTerm
,
setSearchTerm
]
=
React
.
useState
(
getQueryParamString
(
router
.
query
.
q
)
||
undefined
);
const
[
type
,
setType
]
=
React
.
useState
(
getQueryParamString
(
router
.
query
.
filter
)
as
VerifiedContractsFilters
[
'
filter
'
]
||
undefined
);
const
[
type
,
setType
]
=
React
.
useState
(
getQueryParamString
(
router
.
query
.
filter
)
as
VerifiedContractsFilters
[
'
filter
'
]
||
undefined
);
const
[
sort
,
setSort
]
=
const
[
sort
,
setSort
]
=
React
.
useState
<
VerifiedContractsSortingValue
|
undefined
>
(
getSortValueFromQuery
<
VerifiedContractsSortingValue
>
(
router
.
query
,
SORT_OPTIONS
)
);
React
.
useState
<
VerifiedContractsSortingValue
>
(
getSortValueFromQuery
<
VerifiedContractsSortingValue
>
(
router
.
query
,
SORT_OPTIONS
)
??
'
default
'
);
const
debouncedSearchTerm
=
useDebounce
(
searchTerm
||
''
,
300
);
const
debouncedSearchTerm
=
useDebounce
(
searchTerm
||
''
,
300
);
...
@@ -72,9 +76,9 @@ const VerifiedContracts = () => {
...
@@ -72,9 +76,9 @@ const VerifiedContracts = () => {
setType
(
filter
);
setType
(
filter
);
},
[
debouncedSearchTerm
,
onFilterChange
]);
},
[
debouncedSearchTerm
,
onFilterChange
]);
const
handleSortChange
=
React
.
useCallback
((
value
?:
VerifiedContractsSortingValue
)
=>
{
const
handleSortChange
=
React
.
useCallback
((
{
value
}:
{
value
:
Array
<
string
>
}
)
=>
{
setSort
(
value
);
setSort
(
value
[
0
]
as
VerifiedContractsSortingValue
);
onSortingChange
(
getSortParamsFromValue
(
v
alue
));
onSortingChange
(
value
[
0
]
===
'
default
'
?
undefined
:
getSortParamsFromValue
(
value
[
0
]
as
VerifiedContractsSortingV
alue
));
},
[
onSortingChange
]);
},
[
onSortingChange
]);
const
typeFilter
=
(
const
typeFilter
=
(
...
@@ -88,7 +92,7 @@ const VerifiedContracts = () => {
...
@@ -88,7 +92,7 @@ const VerifiedContracts = () => {
const
filterInput
=
(
const
filterInput
=
(
<
FilterInput
<
FilterInput
w=
{
{
base
:
'
100%
'
,
lg
:
'
350px
'
}
}
w=
{
{
base
:
'
100%
'
,
lg
:
'
350px
'
}
}
size=
"
xs
"
size=
"
sm
"
onChange=
{
handleSearchTermChange
}
onChange=
{
handleSearchTermChange
}
placeholder=
"Search by contract name or address"
placeholder=
"Search by contract name or address"
initialValue=
{
searchTerm
}
initialValue=
{
searchTerm
}
...
@@ -98,23 +102,23 @@ const VerifiedContracts = () => {
...
@@ -98,23 +102,23 @@ const VerifiedContracts = () => {
const
sortButton
=
(
const
sortButton
=
(
<
Sort
<
Sort
name=
"verified_contracts_sorting"
name=
"verified_contracts_sorting"
defaultValue=
{
sort
}
defaultValue=
{
[
sort
]
}
options=
{
SORT_OPTIONS
}
collection=
{
sortCollection
}
onChange=
{
handleSortChange
}
on
Value
Change=
{
handleSortChange
}
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
/>
/>
);
);
const
actionBar
=
(
const
actionBar
=
(
<>
<>
<
HStack
spacing
=
{
3
}
mb=
{
6
}
display=
{
{
base
:
'
flex
'
,
lg
:
'
none
'
}
}
>
<
HStack
gap
=
{
3
}
mb=
{
6
}
display=
{
{
base
:
'
flex
'
,
lg
:
'
none
'
}
}
>
{
typeFilter
}
{
typeFilter
}
{
sortButton
}
{
sortButton
}
{
filterInput
}
{
filterInput
}
</
HStack
>
</
HStack
>
{
(
!
isMobile
||
pagination
.
isVisible
)
&&
(
{
(
!
isMobile
||
pagination
.
isVisible
)
&&
(
<
ActionBar
mt=
{
-
6
}
>
<
ActionBar
mt=
{
-
6
}
>
<
HStack
spacing
=
{
3
}
display=
{
{
base
:
'
none
'
,
lg
:
'
flex
'
}
}
>
<
HStack
gap
=
{
3
}
display=
{
{
base
:
'
none
'
,
lg
:
'
flex
'
}
}
>
{
typeFilter
}
{
typeFilter
}
{
filterInput
}
{
filterInput
}
</
HStack
>
</
HStack
>
...
@@ -126,12 +130,12 @@ const VerifiedContracts = () => {
...
@@ -126,12 +130,12 @@ const VerifiedContracts = () => {
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
<
VerifiedContractsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
<
VerifiedContractsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
</
Box
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
VerifiedContractsTable
data=
{
data
.
items
}
sort=
{
sort
}
setSorting=
{
handleSortChange
}
isLoading=
{
isPlaceholderData
}
/>
<
VerifiedContractsTable
data=
{
data
.
items
}
sort=
{
sort
}
setSorting=
{
handleSortChange
}
isLoading=
{
isPlaceholderData
}
/>
</
Hide
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
...
@@ -144,15 +148,16 @@ const VerifiedContracts = () => {
...
@@ -144,15 +148,16 @@ const VerifiedContracts = () => {
<
VerifiedContractsCounters
/>
<
VerifiedContractsCounters
/>
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no verified contracts."
emptyText=
"There are no verified contracts."
filterProps=
{
{
filterProps=
{
{
emptyFilteredText
:
`Couldn${ apos }t find any contract that matches your query.`
,
emptyFilteredText
:
`Couldn${ apos }t find any contract that matches your query.`
,
hasActiveFilters
:
Boolean
(
searchTerm
||
type
),
hasActiveFilters
:
Boolean
(
searchTerm
||
type
),
}
}
}
}
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</
Box
>
</
Box
>
);
);
};
};
...
...
ui/verifiedContracts/VerifiedContractsFilter.tsx
View file @
d13f87b4
import
{
createListCollection
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
VerifiedContractsFilter
as
TVerifiedContractsFilter
}
from
'
types/api/contracts
'
;
import
type
{
VerifiedContractsFilter
as
TVerifiedContractsFilter
}
from
'
types/api/contracts
'
;
...
@@ -15,6 +16,10 @@ const OPTIONS = [
...
@@ -15,6 +16,10 @@ const OPTIONS = [
{
value
:
'
scilla
'
,
label
:
'
Scilla
'
},
{
value
:
'
scilla
'
,
label
:
'
Scilla
'
},
].
filter
(({
value
})
=>
value
===
'
all
'
||
config
.
UI
.
views
.
address
.
languageFilters
.
includes
(
value
))
as
Array
<
{
value
:
OptionValue
;
label
:
string
}
>
;
].
filter
(({
value
})
=>
value
===
'
all
'
||
config
.
UI
.
views
.
address
.
languageFilters
.
includes
(
value
))
as
Array
<
{
value
:
OptionValue
;
label
:
string
}
>
;
const
collection
=
createListCollection
({
items
:
OPTIONS
,
});
interface
Props
{
interface
Props
{
hasActiveFilter
:
boolean
;
hasActiveFilter
:
boolean
;
defaultValue
:
TVerifiedContractsFilter
|
undefined
;
defaultValue
:
TVerifiedContractsFilter
|
undefined
;
...
@@ -25,10 +30,10 @@ const VerifiedContractsFilter = ({ onChange, defaultValue, hasActiveFilter }: Pr
...
@@ -25,10 +30,10 @@ const VerifiedContractsFilter = ({ onChange, defaultValue, hasActiveFilter }: Pr
return
(
return
(
<
PopoverFilterRadio
<
PopoverFilterRadio
name=
"verified_contracts_filter"
name=
"verified_contracts_filter"
options=
{
OPTIONS
}
collection=
{
collection
}
onChange=
{
onChange
}
onChange=
{
onChange
}
hasActiveFilter=
{
hasActiveFilter
}
hasActiveFilter=
{
hasActiveFilter
}
default
Value=
{
defaultValue
||
OPTIONS
[
0
].
value
}
initial
Value=
{
defaultValue
||
OPTIONS
[
0
].
value
}
/>
/>
);
);
};
};
...
...
ui/verifiedContracts/VerifiedContractsListItem.tsx
View file @
d13f87b4
...
@@ -8,7 +8,7 @@ import config from 'configs/app';
...
@@ -8,7 +8,7 @@ import config from 'configs/app';
import
formatLanguageName
from
'
lib/contracts/formatLanguageName
'
;
import
formatLanguageName
from
'
lib/contracts/formatLanguageName
'
;
import
{
CONTRACT_LICENSES
}
from
'
lib/contracts/licenses
'
;
import
{
CONTRACT_LICENSES
}
from
'
lib/contracts/licenses
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
ContractCertifiedLabel
from
'
ui/shared/ContractCertifiedLabel
'
;
import
ContractCertifiedLabel
from
'
ui/shared/ContractCertifiedLabel
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -53,63 +53,63 @@ const VerifiedContractsListItem = ({ data, isLoading }: Props) => {
...
@@ -53,63 +53,63 @@ const VerifiedContractsListItem = ({ data, isLoading }: Props) => {
noIcon
noIcon
truncation=
"constant"
truncation=
"constant"
ml=
"auto"
ml=
"auto"
color=
"text
_
secondary"
color=
"text
.
secondary"
flexShrink=
{
0
}
flexShrink=
{
0
}
/>
/>
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
Balance
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
Balance
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
>
<
span
>
{
balance
}
</
span
>
<
span
>
{
balance
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
Txs count
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
Txs count
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
>
<
span
>
{
data
.
transaction_count
?
data
.
transaction_count
.
toLocaleString
()
:
'
0
'
}
</
span
>
<
span
>
{
data
.
transaction_count
?
data
.
transaction_count
.
toLocaleString
()
:
'
0
'
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
flexShrink=
"0"
>
Language
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
flexShrink=
"0"
>
Language
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"flex"
flexWrap=
"wrap"
>
<
Skeleton
loading=
{
isLoading
}
display=
"flex"
flexWrap=
"wrap"
>
<
Box
>
{
formatLanguageName
(
data
.
language
)
}
</
Box
>
<
Box
>
{
formatLanguageName
(
data
.
language
)
}
</
Box
>
<
Box
color=
"text
_
secondary"
wordBreak=
"break-all"
whiteSpace=
"pre-wrap"
>
(
{
data
.
compiler_version
}
)
</
Box
>
<
Box
color=
"text
.
secondary"
wordBreak=
"break-all"
whiteSpace=
"pre-wrap"
>
(
{
data
.
compiler_version
}
)
</
Box
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
{
data
.
zk_compiler_version
&&
(
{
data
.
zk_compiler_version
&&
(
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
flexShrink=
"0"
>
ZK compiler
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
flexShrink=
"0"
>
ZK compiler
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
wordBreak=
"break-all"
whiteSpace=
"pre-wrap"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
wordBreak=
"break-all"
whiteSpace=
"pre-wrap"
>
{
data
.
zk_compiler_version
}
{
data
.
zk_compiler_version
}
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
)
}
)
}
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
Optimization
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
Optimization
</
Skeleton
>
{
data
.
optimization_enabled
?
{
data
.
optimization_enabled
?
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
Constructor args
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
Constructor args
</
Skeleton
>
{
data
.
has_constructor_args
?
{
data
.
has_constructor_args
?
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
Verified
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
Verified
</
Skeleton
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
IconSvg
name=
"status/success"
boxSize=
{
4
}
color=
"green.500"
isLoading=
{
isLoading
}
/>
<
IconSvg
name=
"status/success"
boxSize=
{
4
}
color=
"green.500"
isLoading=
{
isLoading
}
/>
<
TimeAgoWithTooltip
<
TimeAgoWithTooltip
timestamp=
{
data
.
verified_at
}
timestamp=
{
data
.
verified_at
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
color=
"text
_
secondary"
color=
"text
.
secondary"
/>
/>
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
3
}
>
<
Flex
columnGap=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontWeight=
{
500
}
>
License
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontWeight=
{
500
}
>
License
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
>
<
span
>
{
license
}
</
span
>
<
span
>
{
license
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
...
...
ui/verifiedContracts/VerifiedContractsTable.tsx
View file @
d13f87b4
import
{
Table
,
Tbody
,
Tr
,
Th
,
Link
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
VerifiedContract
}
from
'
types/api/contracts
'
;
import
type
{
VerifiedContract
}
from
'
types/api/contracts
'
;
import
type
{
VerifiedContractsSorting
,
VerifiedContractsSortingField
,
VerifiedContractsSortingValue
}
from
'
types/api/verifiedContracts
'
;
import
type
{
VerifiedContractsSorting
,
VerifiedContractsSortingField
,
VerifiedContractsSortingValue
}
from
'
types/api/verifiedContracts
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
{
ACTION_BAR_HEIGHT_DESKTOP
}
from
'
ui/shared/ActionBar
'
;
import
{
ACTION_BAR_HEIGHT_DESKTOP
}
from
'
ui/shared/ActionBar
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
getNextSortValue
from
'
ui/shared/sort/getNextSortValue
'
;
import
getNextSortValue
from
'
ui/shared/sort/getNextSortValue
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
SORT_SEQUENCE
}
from
'
ui/verifiedContracts/utils
'
;
import
{
SORT_SEQUENCE
}
from
'
ui/verifiedContracts/utils
'
;
import
VerifiedContractsTableItem
from
'
./VerifiedContractsTableItem
'
;
import
VerifiedContractsTableItem
from
'
./VerifiedContractsTableItem
'
;
interface
Props
{
interface
Props
{
data
:
Array
<
VerifiedContract
>
;
data
:
Array
<
VerifiedContract
>
;
sort
:
VerifiedContractsSortingValue
|
undefined
;
sort
:
VerifiedContractsSortingValue
;
setSorting
:
(
val
:
VerifiedContractsSortingValue
|
undefined
)
=>
void
;
setSorting
:
(
{
value
}:
{
value
:
Array
<
string
>
}
)
=>
void
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
...
@@ -25,21 +25,21 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
...
@@ -25,21 +25,21 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
const
onSortToggle
=
React
.
useCallback
((
field
:
VerifiedContractsSortingField
)
=>
()
=>
{
const
onSortToggle
=
React
.
useCallback
((
field
:
VerifiedContractsSortingField
)
=>
()
=>
{
const
value
=
getNextSortValue
<
VerifiedContractsSortingField
,
VerifiedContractsSortingValue
>
(
SORT_SEQUENCE
,
field
)(
sort
);
const
value
=
getNextSortValue
<
VerifiedContractsSortingField
,
VerifiedContractsSortingValue
>
(
SORT_SEQUENCE
,
field
)(
sort
);
setSorting
(
value
);
setSorting
(
{
value
:
[
value
]
}
);
},
[
sort
,
setSorting
]);
},
[
sort
,
setSorting
]);
return
(
return
(
<
Table
minW=
"915px"
>
<
Table
Root
>
<
T
head
top=
{
ACTION_BAR_HEIGHT_DESKTOP
}
>
<
T
ableHeaderSticky
top=
{
ACTION_BAR_HEIGHT_DESKTOP
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
width=
"50%"
>
Contract
</
Th
>
<
T
ableColumnHeader
width=
"50%"
>
Contract
</
TableColumnHeader
>
<
T
h
width=
"130px"
isNumeric
>
<
T
ableColumnHeader
width=
"130px"
isNumeric
>
<
Link
display=
"flex"
alignItems=
"center"
justifyContent=
"flex-end"
onClick=
{
isLoading
?
undefined
:
onSortToggle
(
'
balance
'
)
}
columnGap=
{
1
}
>
<
Link
display=
"flex"
alignItems=
"center"
justifyContent=
"flex-end"
onClick=
{
isLoading
?
undefined
:
onSortToggle
(
'
balance
'
)
}
columnGap=
{
1
}
>
{
sort
?.
includes
(
'
balance
'
)
&&
<
IconSvg
name=
"arrows/east"
boxSize=
{
4
}
transform=
{
sortIconTransform
}
/>
}
{
sort
?.
includes
(
'
balance
'
)
&&
<
IconSvg
name=
"arrows/east"
boxSize=
{
4
}
transform=
{
sortIconTransform
}
/>
}
Balance
{
currencyUnits
.
ether
}
Balance
{
currencyUnits
.
ether
}
</
Link
>
</
Link
>
</
T
h
>
</
T
ableColumnHeader
>
<
T
h
width=
"130px"
isNumeric
>
<
T
ableColumnHeader
width=
"130px"
isNumeric
>
<
Link
<
Link
display=
"flex"
display=
"flex"
alignItems=
"center"
alignItems=
"center"
...
@@ -50,22 +50,22 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
...
@@ -50,22 +50,22 @@ const VerifiedContractsTable = ({ data, sort, setSorting, isLoading }: Props) =>
{
sort
?.
includes
(
'
transactions_count
'
)
&&
<
IconSvg
name=
"arrows/east"
boxSize=
{
4
}
transform=
{
sortIconTransform
}
/>
}
{
sort
?.
includes
(
'
transactions_count
'
)
&&
<
IconSvg
name=
"arrows/east"
boxSize=
{
4
}
transform=
{
sortIconTransform
}
/>
}
Txs
Txs
</
Link
>
</
Link
>
</
T
h
>
</
T
ableColumnHeader
>
<
T
h
width=
"50%"
>
Language / Compiler version
</
Th
>
<
T
ableColumnHeader
width=
"50%"
>
Language / Compiler version
</
TableColumnHeader
>
<
T
h
width=
"80px"
>
Settings
</
Th
>
<
T
ableColumnHeader
width=
"80px"
>
Settings
</
TableColumnHeader
>
<
T
h
width=
"150px"
>
Verified
</
Th
>
<
T
ableColumnHeader
width=
"150px"
>
Verified
</
TableColumnHeader
>
<
T
h
width=
"130px"
>
License
</
Th
>
<
T
ableColumnHeader
width=
"130px"
>
License
</
TableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
>
</
T
ableHeaderSticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
data
.
map
((
item
,
index
)
=>
(
{
data
.
map
((
item
,
index
)
=>
(
<
VerifiedContractsTableItem
<
VerifiedContractsTableItem
key=
{
item
.
address
.
hash
+
(
isLoading
?
index
:
''
)
}
key=
{
item
.
address
.
hash
+
(
isLoading
?
index
:
''
)
}
data=
{
item
}
data=
{
item
}
isLoading=
{
isLoading
}
/>
isLoading=
{
isLoading
}
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
);
);
};
};
...
...
ui/verifiedContracts/VerifiedContractsTableItem.tsx
View file @
d13f87b4
import
{
Tr
,
Td
,
Flex
,
chakra
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -7,7 +7,9 @@ import type { VerifiedContract } from 'types/api/contracts';
...
@@ -7,7 +7,9 @@ import type { VerifiedContract } from 'types/api/contracts';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
formatLanguageName
from
'
lib/contracts/formatLanguageName
'
;
import
formatLanguageName
from
'
lib/contracts/formatLanguageName
'
;
import
{
CONTRACT_LICENSES
}
from
'
lib/contracts/licenses
'
;
import
{
CONTRACT_LICENSES
}
from
'
lib/contracts/licenses
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
ContractCertifiedLabel
from
'
ui/shared/ContractCertifiedLabel
'
;
import
ContractCertifiedLabel
from
'
ui/shared/ContractCertifiedLabel
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -33,8 +35,8 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
...
@@ -33,8 +35,8 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
})();
})();
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
>
<
T
ableCell
>
<
Flex
alignItems=
"center"
mt=
{
1
}
>
<
Flex
alignItems=
"center"
mt=
{
1
}
>
<
AddressEntity
<
AddressEntity
address=
{
data
.
address
}
address=
{
data
.
address
}
...
@@ -52,25 +54,26 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
...
@@ -52,25 +54,26 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
truncation=
"constant"
truncation=
"constant"
my=
{
1
}
my=
{
1
}
ml=
{
7
}
ml=
{
7
}
color=
"text_secondary"
color=
"text.secondary"
w=
"fit-content"
/>
/>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
my=
{
1
}
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
my=
{
1
}
>
{
balance
}
{
balance
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
>
<
T
ableCell
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
my=
{
1
}
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
my=
{
1
}
>
{
data
.
transaction_count
?
data
.
transaction_count
.
toLocaleString
()
:
'
0
'
}
{
data
.
transaction_count
?
data
.
transaction_count
.
toLocaleString
()
:
'
0
'
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
<
T
d
>
<
T
ableCell
>
<
Flex
flexWrap=
"wrap"
columnGap=
{
2
}
>
<
Flex
flexWrap=
"wrap"
columnGap=
{
2
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
my=
{
1
}
>
{
formatLanguageName
(
data
.
language
)
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
my=
{
1
}
>
{
formatLanguageName
(
data
.
language
)
}
</
Skeleton
>
{
data
.
compiler_version
&&
(
{
data
.
compiler_version
&&
(
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
wordBreak=
"break-all"
my=
{
1
}
cursor=
"pointer"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
wordBreak=
"break-all"
my=
{
1
}
cursor=
"pointer"
>
<
Tooltip
label
=
{
data
.
compiler_version
}
>
<
Tooltip
content
=
{
data
.
compiler_version
}
>
<
span
>
{
data
.
compiler_version
.
split
(
'
+
'
)[
0
]
}
</
span
>
<
span
>
{
data
.
compiler_version
.
split
(
'
+
'
)[
0
]
}
</
span
>
</
Tooltip
>
</
Tooltip
>
</
Skeleton
>
</
Skeleton
>
...
@@ -78,45 +81,45 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
...
@@ -78,45 +81,45 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
</
Flex
>
</
Flex
>
{
data
.
zk_compiler_version
&&
(
{
data
.
zk_compiler_version
&&
(
<
Flex
flexWrap=
"wrap"
columnGap=
{
2
}
my=
{
1
}
>
<
Flex
flexWrap=
"wrap"
columnGap=
{
2
}
my=
{
1
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
ZK compiler
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
>
ZK compiler
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_
secondary"
wordBreak=
"break-all"
>
<
Skeleton
loading=
{
isLoading
}
color=
"text.
secondary"
wordBreak=
"break-all"
>
<
span
>
{
data
.
zk_compiler_version
}
</
span
>
<
span
>
{
data
.
zk_compiler_version
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
Flex
>
</
Flex
>
)
}
)
}
</
T
d
>
</
T
ableCell
>
<
T
d
>
<
T
ableCell
>
<
Tooltip
label=
{
isLoading
?
undefined
:
'
Optimization
'
}
>
<
Tooltip
content=
"Optimization"
disabled=
{
isLoading
}
>
<
chakra
.
span
display=
"inline-block"
>
<
chakra
.
span
display=
"inline-block"
>
{
data
.
optimization_enabled
?
{
data
.
optimization_enabled
?
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
label=
{
isLoading
?
undefined
:
'
Constructor args
'
}
>
<
Tooltip
content=
"Constructor args"
disabled=
{
isLoading
}
>
<
chakra
.
span
display=
"inline-block"
ml=
{
2
}
>
<
chakra
.
span
display=
"inline-block"
ml=
{
2
}
>
{
data
.
has_constructor_args
?
{
data
.
has_constructor_args
?
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"check"
boxSize=
{
6
}
color=
"green.500"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
:
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
<
IconSvg
name=
"cross"
boxSize=
{
6
}
color=
"red.600"
cursor=
"pointer"
isLoading=
{
isLoading
}
/>
}
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
</
T
d
>
</
T
ableCell
>
<
T
d
>
<
T
ableCell
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
my=
{
1
}
>
<
Flex
alignItems=
"center"
columnGap=
{
2
}
my=
{
1
}
>
<
IconSvg
name=
"status/success"
boxSize=
{
4
}
color=
"green.500"
isLoading=
{
isLoading
}
/>
<
IconSvg
name=
"status/success"
boxSize=
{
4
}
color=
"green.500"
isLoading=
{
isLoading
}
/>
<
TimeAgoWithTooltip
<
TimeAgoWithTooltip
timestamp=
{
data
.
verified_at
}
timestamp=
{
data
.
verified_at
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
color=
"text
_
secondary"
color=
"text
.
secondary"
/>
/>
</
Flex
>
</
Flex
>
</
T
d
>
</
T
ableCell
>
<
T
d
>
<
T
ableCell
>
<
Skeleton
isLoaded=
{
!
isLoading
}
my=
{
1
}
display=
"inline-block"
>
<
Skeleton
loading=
{
isLoading
}
my=
{
1
}
display=
"inline-block"
>
{
license
}
{
license
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/verifiedContracts/utils.ts
View file @
d13f87b4
import
type
{
VerifiedContractsSortingValue
,
VerifiedContractsSortingField
}
from
'
types/api/verifiedContracts
'
;
import
type
{
VerifiedContractsSortingValue
,
VerifiedContractsSortingField
}
from
'
types/api/verifiedContracts
'
;
import
type
{
SelectOption
}
from
'
toolkit/chakra/select
'
;
import
type
{
SelectOption
}
from
'
toolkit/chakra/select
'
;
export
const
SORT_OPTIONS
:
Array
<
SelectOption
<
VerifiedContractsSortingValue
>>
=
[
export
const
SORT_OPTIONS
:
Array
<
SelectOption
<
VerifiedContractsSortingValue
>>
=
[
{
label
:
'
Default
'
,
value
:
undefined
},
{
label
:
'
Default
'
,
value
:
'
default
'
},
{
label
:
'
Balance descending
'
,
value
:
'
balance-desc
'
},
{
label
:
'
Balance descending
'
,
value
:
'
balance-desc
'
},
{
label
:
'
Balance ascending
'
,
value
:
'
balance-asc
'
},
{
label
:
'
Balance ascending
'
,
value
:
'
balance-asc
'
},
{
label
:
'
Txs count descending
'
,
value
:
'
transactions_count-desc
'
},
{
label
:
'
Txs count descending
'
,
value
:
'
transactions_count-desc
'
},
{
label
:
'
Txs count ascending
'
,
value
:
'
transactions_count-asc
'
},
{
label
:
'
Txs count ascending
'
,
value
:
'
transactions_count-asc
'
},
];
];
export
const
SORT_SEQUENCE
:
Record
<
VerifiedContractsSortingField
,
Array
<
VerifiedContractsSortingValue
|
undefined
>>
=
{
export
const
SORT_SEQUENCE
:
Record
<
VerifiedContractsSortingField
,
Array
<
VerifiedContractsSortingValue
>>
=
{
balance
:
[
'
balance-desc
'
,
'
balance-asc
'
,
undefined
],
balance
:
[
'
balance-desc
'
,
'
balance-asc
'
,
'
default
'
],
transactions_count
:
[
'
transactions_count-desc
'
,
'
transactions_count-asc
'
,
undefined
],
transactions_count
:
[
'
transactions_count-desc
'
,
'
transactions_count-asc
'
,
'
default
'
],
};
};
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