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
47a938de
Commit
47a938de
authored
Jan 31, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token id can be null
parent
037499a6
Changes
7
Show 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 @
47a938de
...
@@ -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 @
47a938de
...
@@ -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 @
47a938de
...
@@ -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 @
47a938de
...
@@ -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 @
47a938de
...
@@ -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 @
47a938de
...
@@ -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,6 +26,7 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
...
@@ -26,6 +26,7 @@ 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
>
)
}
)
}
{
tokenId
!==
null
?
(
<
NftEntity
<
NftEntity
hash=
{
token
.
address
}
hash=
{
token
.
address
}
id=
{
tokenId
}
id=
{
tokenId
}
...
@@ -35,6 +36,8 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
...
@@ -35,6 +36,8 @@ const NftTokenTransferSnippet = ({ value, token, tokenId }: Props) => {
w=
"auto"
w=
"auto"
flexShrink=
{
0
}
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 @
47a938de
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
)
=>
{
if
(
item
.
total
.
token_id
!==
null
)
{
return
(
<
NftEntity
<
NftEntity
key=
{
index
}
key=
{
index
}
hash=
{
tokenAddress
}
hash=
{
tokenAddress
}
id=
{
item
.
total
.
token_id
}
id=
{
item
.
total
.
token_id
}
isLoading=
{
isLoading
}
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