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
0ee23c4f
Commit
0ee23c4f
authored
Apr 17, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display actual token symbol in transfers table header
parent
e04373c2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
Token.tsx
ui/pages/Token.tsx
+1
-1
TokenTransfer.tsx
ui/token/TokenTransfer/TokenTransfer.tsx
+4
-1
TokenTransferTable.tsx
ui/token/TokenTransfer/TokenTransferTable.tsx
+5
-3
TokenInstanceContent.tsx
ui/tokenInstance/TokenInstanceContent.tsx
+5
-1
No files found.
ui/pages/Token.tsx
View file @
0ee23c4f
...
@@ -99,7 +99,7 @@ const TokenPageContent = () => {
...
@@ -99,7 +99,7 @@ const TokenPageContent = () => {
const
contractTabs
=
useContractTabs
(
contractQuery
.
data
);
const
contractTabs
=
useContractTabs
(
contractQuery
.
data
);
const
tabs
:
Array
<
RoutedTab
>
=
[
const
tabs
:
Array
<
RoutedTab
>
=
[
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TokenTransfer
transfersQuery=
{
transfersQuery
}
/>
},
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TokenTransfer
transfersQuery=
{
transfersQuery
}
token=
{
tokenQuery
.
data
}
/>
},
{
id
:
'
holders
'
,
title
:
'
Holders
'
,
component
:
<
TokenHolders
tokenQuery=
{
tokenQuery
}
holdersQuery=
{
holdersQuery
}
/>
},
{
id
:
'
holders
'
,
title
:
'
Holders
'
,
component
:
<
TokenHolders
tokenQuery=
{
tokenQuery
}
holdersQuery=
{
holdersQuery
}
/>
},
(
tokenQuery
.
data
?.
type
===
'
ERC-1155
'
||
tokenQuery
.
data
?.
type
===
'
ERC-721
'
)
?
(
tokenQuery
.
data
?.
type
===
'
ERC-1155
'
||
tokenQuery
.
data
?.
type
===
'
ERC-721
'
)
?
{
id
:
'
inventory
'
,
title
:
'
Inventory
'
,
component
:
<
TokenInventory
inventoryQuery=
{
inventoryQuery
}
/>
}
:
{
id
:
'
inventory
'
,
title
:
'
Inventory
'
,
component
:
<
TokenInventory
inventoryQuery=
{
inventoryQuery
}
/>
}
:
...
...
ui/token/TokenTransfer/TokenTransfer.tsx
View file @
0ee23c4f
...
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router';
...
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
SocketMessage
}
from
'
lib/socket/types
'
;
import
type
{
SocketMessage
}
from
'
lib/socket/types
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenTransferResponse
}
from
'
types/api/tokenTransfer
'
;
import
type
{
TokenTransferResponse
}
from
'
types/api/tokenTransfer
'
;
import
useGradualIncrement
from
'
lib/hooks/useGradualIncrement
'
;
import
useGradualIncrement
from
'
lib/hooks/useGradualIncrement
'
;
...
@@ -25,9 +26,10 @@ type Props = {
...
@@ -25,9 +26,10 @@ type Props = {
isPaginationVisible
:
boolean
;
isPaginationVisible
:
boolean
;
};
};
tokenId
?:
string
;
tokenId
?:
string
;
token
?:
TokenInfo
;
}
}
const
TokenTransfer
=
({
transfersQuery
,
tokenId
}:
Props
)
=>
{
const
TokenTransfer
=
({
transfersQuery
,
tokenId
,
token
}:
Props
)
=>
{
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
{
isError
,
isLoading
,
isPlaceholderData
,
data
,
pagination
,
isPaginationVisible
}
=
transfersQuery
;
const
{
isError
,
isLoading
,
isPlaceholderData
,
data
,
pagination
,
isPaginationVisible
}
=
transfersQuery
;
...
@@ -72,6 +74,7 @@ const TokenTransfer = ({ transfersQuery, tokenId }: Props) => {
...
@@ -72,6 +74,7 @@ const TokenTransfer = ({ transfersQuery, tokenId }: Props) => {
socketInfoAlert={ socketAlert }
socketInfoAlert={ socketAlert }
socketInfoNum={ newItemsCount }
socketInfoNum={ newItemsCount }
tokenId={ tokenId }
tokenId={ tokenId }
token={ token }
isLoading={ isPlaceholderData }
isLoading={ isPlaceholderData }
/>
/>
</Hide>
</Hide>
...
...
ui/token/TokenTransfer/TokenTransferTable.tsx
View file @
0ee23c4f
import
{
Table
,
Tbody
,
Tr
,
Th
,
Td
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
Table
,
Tbody
,
Tr
,
Th
,
Td
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
...
@@ -16,11 +17,11 @@ interface Props {
...
@@ -16,11 +17,11 @@ interface Props {
socketInfoNum
?:
number
;
socketInfoNum
?:
number
;
tokenId
?:
string
;
tokenId
?:
string
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
token
?:
TokenInfo
;
}
}
const
TokenTransferTable
=
({
data
,
top
,
showSocketInfo
,
socketInfoAlert
,
socketInfoNum
,
tokenId
,
isLoading
}:
Props
)
=>
{
const
TokenTransferTable
=
({
data
,
top
,
showSocketInfo
,
socketInfoAlert
,
socketInfoNum
,
tokenId
,
isLoading
,
token
}:
Props
)
=>
{
const
tokenType
=
data
[
0
].
token
.
type
;
const
tokenType
=
data
[
0
].
token
.
type
;
const
tokenSymbol
=
data
[
0
].
token
.
symbol
;
return
(
return
(
<
Table
variant=
"simple"
size=
"sm"
minW=
"950px"
>
<
Table
variant=
"simple"
size=
"sm"
minW=
"950px"
>
...
@@ -32,7 +33,8 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
...
@@ -32,7 +33,8 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
<
Th
width=
"36px"
px=
{
0
}
/>
<
Th
width=
"36px"
px=
{
0
}
/>
<
Th
width=
"218px"
>
To
</
Th
>
<
Th
width=
"218px"
>
To
</
Th
>
{
(
tokenType
===
'
ERC-721
'
||
tokenType
===
'
ERC-1155
'
)
&&
<
Th
width=
"20%"
isNumeric=
{
tokenType
===
'
ERC-721
'
}
>
Token ID
</
Th
>
}
{
(
tokenType
===
'
ERC-721
'
||
tokenType
===
'
ERC-1155
'
)
&&
<
Th
width=
"20%"
isNumeric=
{
tokenType
===
'
ERC-721
'
}
>
Token ID
</
Th
>
}
{
(
tokenType
===
'
ERC-20
'
||
tokenType
===
'
ERC-1155
'
)
&&
<
Th
width=
"20%"
isNumeric
whiteSpace=
"nowrap"
>
Value
{
trimTokenSymbol
(
tokenSymbol
)
}
</
Th
>
}
{
(
tokenType
===
'
ERC-20
'
||
tokenType
===
'
ERC-1155
'
)
&&
<
Th
width=
"20%"
isNumeric
whiteSpace=
"nowrap"
>
Value
{
trimTokenSymbol
(
token
?.
symbol
||
''
)
}
</
Th
>
}
</
Tr
>
</
Tr
>
</
Thead
>
</
Thead
>
<
Tbody
>
<
Tbody
>
...
...
ui/tokenInstance/TokenInstanceContent.tsx
View file @
0ee23c4f
...
@@ -51,7 +51,11 @@ const TokenInstanceContent = () => {
...
@@ -51,7 +51,11 @@ const TokenInstanceContent = () => {
});
});
const
tabs
:
Array
<
RoutedTab
>
=
[
const
tabs
:
Array
<
RoutedTab
>
=
[
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TokenTransfer
transfersQuery=
{
transfersQuery
}
tokenId=
{
id
}
/>
},
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TokenTransfer
transfersQuery=
{
transfersQuery
}
tokenId=
{
id
}
token=
{
tokenInstanceQuery
.
data
?.
token
}
/>,
},
// there is no api for this tab yet
// there is no api for this tab yet
// { id: 'holders', title: 'Holders', component: <span>Holders</span> },
// { id: 'holders', title: 'Holders', component: <span>Holders</span> },
{
id
:
'
metadata
'
,
title
:
'
Metadata
'
,
component
:
<
TokenInstanceMetadata
data=
{
tokenInstanceQuery
.
data
?.
metadata
}
/>
},
{
id
:
'
metadata
'
,
title
:
'
Metadata
'
,
component
:
<
TokenInstanceMetadata
data=
{
tokenInstanceQuery
.
data
?.
metadata
}
/>
},
...
...
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