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
57c317b5
Commit
57c317b5
authored
Oct 28, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new fields
parent
3955f6db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
27 deletions
+19
-27
transaction.ts
types/api/transaction.ts
+4
-0
TxType.tsx
ui/txs/TxType.tsx
+11
-9
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+2
-6
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+2
-12
No files found.
types/api/transaction.ts
View file @
57c317b5
...
@@ -38,6 +38,8 @@ export interface Transaction {
...
@@ -38,6 +38,8 @@ export interface Transaction {
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers_overflow
:
boolean
;
token_transfers_overflow
:
boolean
;
exchange_rate
:
string
;
exchange_rate
:
string
;
method
:
string
;
tx_types
:
Array
<
TransactionType
>
;
tx_tag
:
string
|
null
;
tx_tag
:
string
|
null
;
}
}
...
@@ -49,3 +51,5 @@ export interface TransactionsResponse {
...
@@ -49,3 +51,5 @@ export interface TransactionsResponse {
items_count
:
number
;
items_count
:
number
;
}
|
null
;
}
|
null
;
}
}
export
type
TransactionType
=
'
token_transfer
'
|
'
contract_creation
'
|
'
contract_call
'
|
'
token_creation
'
|
'
coin_transfer
'
ui/txs/TxType.tsx
View file @
57c317b5
import
{
Tag
}
from
'
@chakra-ui/react
'
;
import
{
Tag
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TransactionType
}
from
'
types/api/transaction
'
;
export
interface
Props
{
export
interface
Props
{
type
:
'
contract-call
'
|
'
transaction
'
|
'
token-transfer
'
|
'
internal-tx
'
|
'
multicall
'
;
type
:
TransactionType
;
}
}
const
TxStatus
=
({
type
}:
Props
)
=>
{
const
TxStatus
=
({
type
}:
Props
)
=>
{
...
@@ -10,24 +12,24 @@ const TxStatus = ({ type }: Props) => {
...
@@ -10,24 +12,24 @@ const TxStatus = ({ type }: Props) => {
let
colorScheme
;
let
colorScheme
;
switch
(
type
)
{
switch
(
type
)
{
case
'
contract
-
call
'
:
case
'
contract
_
call
'
:
label
=
'
Contract call
'
;
label
=
'
Contract call
'
;
colorScheme
=
'
blue
'
;
colorScheme
=
'
blue
'
;
break
;
break
;
case
'
transac
tion
'
:
case
'
contract_crea
tion
'
:
label
=
'
Transac
tion
'
;
label
=
'
Contract crea
tion
'
;
colorScheme
=
'
purple
'
;
colorScheme
=
'
purple
'
;
break
;
break
;
case
'
token
-
transfer
'
:
case
'
token
_
transfer
'
:
label
=
'
Token transfer
'
;
label
=
'
Token transfer
'
;
colorScheme
=
'
orange
'
;
colorScheme
=
'
orange
'
;
break
;
break
;
case
'
internal-tx
'
:
case
'
token_creation
'
:
label
=
'
Internal tx
n
'
;
label
=
'
Token creatio
n
'
;
colorScheme
=
'
cyan
'
;
colorScheme
=
'
cyan
'
;
break
;
break
;
case
'
multicall
'
:
case
'
coin_transfer
'
:
label
=
'
Multicall
'
;
label
=
'
Coin transfer
'
;
colorScheme
=
'
teal
'
;
colorScheme
=
'
teal
'
;
break
;
break
;
}
}
...
...
ui/txs/TxsListItem.tsx
View file @
57c317b5
...
@@ -39,9 +39,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -39,9 +39,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
<
Box
width=
"100%"
borderBottom=
"1px solid"
borderColor=
{
borderColor
}
_first=
{
{
borderTop
:
'
1px solid
'
,
borderColor
}
}
>
<
Box
width=
"100%"
borderBottom=
"1px solid"
borderColor=
{
borderColor
}
_first=
{
{
borderTop
:
'
1px solid
'
,
borderColor
}
}
>
<
Flex
justifyContent=
"space-between"
mt=
{
4
}
>
<
Flex
justifyContent=
"space-between"
mt=
{
4
}
>
<
HStack
>
<
HStack
>
{
/* TODO: we don't recieve type from api */
}
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
{
/* <TxType type={ tx.type }/> */
}
<
TxType
type=
"transaction"
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
</
HStack
>
</
HStack
>
<
TxAdditionalInfoButton
onClick=
{
onOpen
}
/>
<
TxAdditionalInfoButton
onClick=
{
onOpen
}
/>
...
@@ -68,7 +66,6 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -68,7 +66,6 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
</
Flex
>
</
Flex
>
<
Flex
mt=
{
3
}
>
<
Flex
mt=
{
3
}
>
<
Text
as=
"span"
whiteSpace=
"pre"
>
Method
</
Text
>
<
Text
as=
"span"
whiteSpace=
"pre"
>
Method
</
Text
>
{
/* TODO: we don't recieve method from api */
}
<
Text
<
Text
as=
"span"
as=
"span"
variant=
"secondary"
variant=
"secondary"
...
@@ -76,8 +73,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -76,8 +73,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
whiteSpace=
"nowrap"
whiteSpace=
"nowrap"
textOverflow=
"ellipsis"
textOverflow=
"ellipsis"
>
>
{
/* { tx.method } */
}
{
tx
.
method
}
CommitHash
</
Text
>
</
Text
>
</
Flex
>
</
Flex
>
{
tx
.
block
!==
null
&&
(
{
tx
.
block
!==
null
&&
(
...
...
ui/txs/TxsTableItem.tsx
View file @
57c317b5
...
@@ -73,9 +73,7 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -73,9 +73,7 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
VStack
alignItems=
"start"
>
<
VStack
alignItems=
"start"
>
{
/* TODO: we don't recieve type from api */
}
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
{
/* <TxType type={ tx.type }/> */
}
<
TxType
type=
"transaction"
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
</
VStack
>
</
VStack
>
</
Td
>
</
Td
>
...
@@ -93,20 +91,12 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -93,20 +91,12 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
VStack
>
</
VStack
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
{
/* TODO: we don't recieve method from api */
}
<
TruncatedTextTooltip
label=
{
tx
.
method
}
>
{
/* <TruncatedTextTooltip label={ tx.method }>
<
Tag
<
Tag
colorScheme=
{
tx
.
method
===
'
Multicall
'
?
'
teal
'
:
'
gray
'
}
colorScheme=
{
tx
.
method
===
'
Multicall
'
?
'
teal
'
:
'
gray
'
}
>
>
{
tx
.
method
}
{
tx
.
method
}
</
Tag
>
</
Tag
>
</TruncatedTextTooltip> */
}
<
TruncatedTextTooltip
label=
"CommitHash"
>
<
Tag
colorScheme=
"gray"
>
CommitHash
</
Tag
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
...
...
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