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
2adf101e
Unverified
Commit
2adf101e
authored
Feb 02, 2024
by
Igor Stuev
Committed by
GitHub
Feb 02, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1558 from blockscout/fe-1538
token id can be null
parents
74c586cf
47a938de
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
26 deletions
+35
-26
tokenTransfer.ts
types/api/tokenTransfer.ts
+2
-2
TokenTransferListItem.tsx
ui/shared/TokenTransfer/TokenTransferListItem.tsx
+1
-1
TokenTransferTableItem.tsx
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
+1
-1
TokenTransferListItem.tsx
ui/token/TokenTransfer/TokenTransferListItem.tsx
+1
-1
TokenTransferTableItem.tsx
ui/token/TokenTransfer/TokenTransferTableItem.tsx
+1
-1
NftTokenTransferSnippet.tsx
ui/tx/NftTokenTransferSnippet.tsx
+13
-10
TxStateTokenIdList.tsx
ui/tx/state/TxStateTokenIdList.tsx
+16
-10
No files found.
types/api/tokenTransfer.ts
View file @
2adf101e
...
@@ -7,13 +7,13 @@ export type Erc20TotalPayload = {
...
@@ -7,13 +7,13 @@ export type Erc20TotalPayload = {
}
}
export
type
Erc721TotalPayload
=
{
export
type
Erc721TotalPayload
=
{
token_id
:
string
;
token_id
:
string
|
null
;
}
}
export
type
Erc1155TotalPayload
=
{
export
type
Erc1155TotalPayload
=
{
decimals
:
string
|
null
;
decimals
:
string
|
null
;
value
:
string
;
value
:
string
;
token_id
:
string
;
token_id
:
string
|
null
;
}
}
export
type
TokenTransfer
=
(
export
type
TokenTransfer
=
(
...
...
ui/shared/TokenTransfer/TokenTransferListItem.tsx
View file @
2adf101e
...
@@ -61,7 +61,7 @@ const TokenTransferListItem = ({
...
@@ -61,7 +61,7 @@ const TokenTransferListItem = ({
<
TxAdditionalInfo
hash=
{
txHash
}
isMobile
isLoading=
{
isLoading
}
/>
<
TxAdditionalInfo
hash=
{
txHash
}
isMobile
isLoading=
{
isLoading
}
/>
)
}
)
}
</
Flex
>
</
Flex
>
{
'
token_id
'
in
total
&&
<
NftEntity
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
isLoading=
{
isLoading
}
/>
}
{
'
token_id
'
in
total
&&
total
.
token_id
!==
null
&&
<
NftEntity
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
isLoading=
{
isLoading
}
/>
}
{
showTxInfo
&&
txHash
&&
(
{
showTxInfo
&&
txHash
&&
(
<
Flex
justifyContent=
"space-between"
alignItems=
"center"
lineHeight=
"24px"
width=
"100%"
>
<
Flex
justifyContent=
"space-between"
alignItems=
"center"
lineHeight=
"24px"
width=
"100%"
>
<
TxEntity
<
TxEntity
...
...
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
View file @
2adf101e
...
@@ -65,7 +65,7 @@ const TokenTransferTableItem = ({
...
@@ -65,7 +65,7 @@ const TokenTransferTableItem = ({
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
{
'
token_id
'
in
total
&&
<
NftEntity
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
isLoading=
{
isLoading
}
/>
}
{
'
token_id
'
in
total
&&
total
.
token_id
!==
null
&&
<
NftEntity
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
isLoading=
{
isLoading
}
/>
}
</
Td
>
</
Td
>
{
showTxInfo
&&
txHash
&&
(
{
showTxInfo
&&
txHash
&&
(
<
Td
>
<
Td
>
...
...
ui/token/TokenTransfer/TokenTransferListItem.tsx
View file @
2adf101e
...
@@ -87,7 +87,7 @@ const TokenTransferListItem = ({
...
@@ -87,7 +87,7 @@ const TokenTransferListItem = ({
)
}
)
}
</
Grid
>
</
Grid
>
)
}
)
}
{
'
token_id
'
in
total
&&
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
(
{
'
token_id
'
in
total
&&
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
total
.
token_id
!==
null
&&
(
<
NftEntity
<
NftEntity
hash=
{
token
.
address
}
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
id=
{
total
.
token_id
}
...
...
ui/token/TokenTransfer/TokenTransferTableItem.tsx
View file @
2adf101e
...
@@ -70,7 +70,7 @@ const TokenTransferTableItem = ({
...
@@ -70,7 +70,7 @@ const TokenTransferTableItem = ({
</
Td
>
</
Td
>
{
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
(
{
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
(
<
Td
>
<
Td
>
{
'
token_id
'
in
total
?
(
{
'
token_id
'
in
total
&&
total
.
token_id
!==
null
?
(
<
NftEntity
<
NftEntity
hash=
{
token
.
address
}
hash=
{
token
.
address
}
id=
{
total
.
token_id
}
id=
{
total
.
token_id
}
...
...
ui/tx/NftTokenTransferSnippet.tsx
View file @
2adf101e
...
@@ -9,7 +9,7 @@ import TokenEntity from 'ui/shared/entities/token/TokenEntity';
...
@@ -9,7 +9,7 @@ import TokenEntity from 'ui/shared/entities/token/TokenEntity';
interface
Props
{
interface
Props
{
token
:
TokenInfo
;
token
:
TokenInfo
;
value
:
string
;
value
:
string
;
tokenId
:
string
;
tokenId
:
string
|
null
;
}
}
const
NftTokenTransferSnippet
=
({
value
,
token
,
tokenId
}:
Props
)
=>
{
const
NftTokenTransferSnippet
=
({
value
,
token
,
tokenId
}:
Props
)
=>
{
...
@@ -26,15 +26,18 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
...
@@ -26,15 +26,18 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
)
:
(
)
:
(
<
chakra
.
span
color=
"text_secondary"
>
for token ID
</
chakra
.
span
>
<
chakra
.
span
color=
"text_secondary"
>
for token ID
</
chakra
.
span
>
)
}
)
}
<
NftEntity
{
tokenId
!==
null
?
(
hash=
{
token
.
address
}
<
NftEntity
id=
{
tokenId
}
hash=
{
token
.
address
}
fontWeight=
{
600
}
id=
{
tokenId
}
iconSize=
"md"
fontWeight=
{
600
}
maxW=
{
{
base
:
'
100%
'
,
lg
:
'
150px
'
}
}
iconSize=
"md"
w=
"auto"
maxW=
{
{
base
:
'
100%
'
,
lg
:
'
150px
'
}
}
flexShrink=
{
0
}
w=
"auto"
/>
flexShrink=
{
0
}
/>
)
:
<
chakra
.
span
color=
"text_secondary"
>
N/A
</
chakra
.
span
>
}
<
chakra
.
span
color=
"text_secondary"
>
of
</
chakra
.
span
>
<
chakra
.
span
color=
"text_secondary"
>
of
</
chakra
.
span
>
<
TokenEntity
<
TokenEntity
token=
{
token
}
token=
{
token
}
...
...
ui/tx/state/TxStateTokenIdList.tsx
View file @
2adf101e
import
{
Flex
,
Link
,
useBoolean
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Text
,
Link
,
useBoolean
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
interface
Props
{
interface
Props
{
items
:
Array
<
{
total
:
{
token_id
:
string
}
}
>
;
items
:
Array
<
{
total
:
{
token_id
:
string
|
null
}
}
>
;
tokenAddress
:
string
;
tokenAddress
:
string
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
...
@@ -14,14 +14,20 @@ const TxStateTokenIdList = ({ items, tokenAddress, isLoading }: Props) => {
...
@@ -14,14 +14,20 @@ const TxStateTokenIdList = ({ items, tokenAddress, isLoading }: Props) => {
return
(
return
(
<
Flex
flexDir=
"column"
rowGap=
{
2
}
>
<
Flex
flexDir=
"column"
rowGap=
{
2
}
>
{
items
.
slice
(
0
,
isCut
?
3
:
items
.
length
).
map
((
item
,
index
)
=>
(
{
items
.
slice
(
0
,
isCut
?
3
:
items
.
length
).
map
((
item
,
index
)
=>
{
<
NftEntity
if
(
item
.
total
.
token_id
!==
null
)
{
key=
{
index
}
return
(
hash=
{
tokenAddress
}
<
NftEntity
id=
{
item
.
total
.
token_id
}
key=
{
index
}
isLoading=
{
isLoading
}
hash=
{
tokenAddress
}
/>
id=
{
item
.
total
.
token_id
}
))
}
isLoading=
{
isLoading
}
/>
);
}
else
{
return
<
Text
key=
{
index
}
color=
"text_secondary"
>
N/A
</
Text
>;
}
})
}
{
items
.
length
>
3
&&
(
{
items
.
length
>
3
&&
(
<
Link
<
Link
fontWeight=
{
400
}
fontWeight=
{
400
}
...
...
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