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
Show 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 {
token_transfers
:
Array
<
TokenTransfer
>
|
null
;
token_transfers_overflow
:
boolean
;
exchange_rate
:
string
;
method
:
string
;
tx_types
:
Array
<
TransactionType
>
;
tx_tag
:
string
|
null
;
}
...
...
@@ -49,3 +51,5 @@ export interface TransactionsResponse {
items_count
:
number
;
}
|
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
React
from
'
react
'
;
import
type
{
TransactionType
}
from
'
types/api/transaction
'
;
export
interface
Props
{
type
:
'
contract-call
'
|
'
transaction
'
|
'
token-transfer
'
|
'
internal-tx
'
|
'
multicall
'
;
type
:
TransactionType
;
}
const
TxStatus
=
({
type
}:
Props
)
=>
{
...
...
@@ -10,24 +12,24 @@ const TxStatus = ({ type }: Props) => {
let
colorScheme
;
switch
(
type
)
{
case
'
contract
-
call
'
:
case
'
contract
_
call
'
:
label
=
'
Contract call
'
;
colorScheme
=
'
blue
'
;
break
;
case
'
transac
tion
'
:
label
=
'
Transac
tion
'
;
case
'
contract_crea
tion
'
:
label
=
'
Contract crea
tion
'
;
colorScheme
=
'
purple
'
;
break
;
case
'
token
-
transfer
'
:
case
'
token
_
transfer
'
:
label
=
'
Token transfer
'
;
colorScheme
=
'
orange
'
;
break
;
case
'
internal-tx
'
:
label
=
'
Internal tx
n
'
;
case
'
token_creation
'
:
label
=
'
Token creatio
n
'
;
colorScheme
=
'
cyan
'
;
break
;
case
'
multicall
'
:
label
=
'
Multicall
'
;
case
'
coin_transfer
'
:
label
=
'
Coin transfer
'
;
colorScheme
=
'
teal
'
;
break
;
}
...
...
ui/txs/TxsListItem.tsx
View file @
57c317b5
...
...
@@ -39,9 +39,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
<
Box
width=
"100%"
borderBottom=
"1px solid"
borderColor=
{
borderColor
}
_first=
{
{
borderTop
:
'
1px solid
'
,
borderColor
}
}
>
<
Flex
justifyContent=
"space-between"
mt=
{
4
}
>
<
HStack
>
{
/* TODO: we don't recieve type from api */
}
{
/* <TxType type={ tx.type }/> */
}
<
TxType
type=
"transaction"
/>
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
</
HStack
>
<
TxAdditionalInfoButton
onClick=
{
onOpen
}
/>
...
...
@@ -68,7 +66,6 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
</
Flex
>
<
Flex
mt=
{
3
}
>
<
Text
as=
"span"
whiteSpace=
"pre"
>
Method
</
Text
>
{
/* TODO: we don't recieve method from api */
}
<
Text
as=
"span"
variant=
"secondary"
...
...
@@ -76,8 +73,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
whiteSpace=
"nowrap"
textOverflow=
"ellipsis"
>
{
/* { tx.method } */
}
CommitHash
{
tx
.
method
}
</
Text
>
</
Flex
>
{
tx
.
block
!==
null
&&
(
...
...
ui/txs/TxsTableItem.tsx
View file @
57c317b5
...
...
@@ -73,9 +73,7 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
Td
>
<
Td
>
<
VStack
alignItems=
"start"
>
{
/* TODO: we don't recieve type from api */
}
{
/* <TxType type={ tx.type }/> */
}
<
TxType
type=
"transaction"
/>
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
</
VStack
>
</
Td
>
...
...
@@ -93,20 +91,12 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
VStack
>
</
Td
>
<
Td
>
{
/* TODO: we don't recieve method from api */
}
{
/* <TruncatedTextTooltip label={ tx.method }>
<
TruncatedTextTooltip
label=
{
tx
.
method
}
>
<
Tag
colorScheme=
{
tx
.
method
===
'
Multicall
'
?
'
teal
'
:
'
gray
'
}
>
{
tx
.
method
}
</
Tag
>
</TruncatedTextTooltip> */
}
<
TruncatedTextTooltip
label=
"CommitHash"
>
<
Tag
colorScheme=
"gray"
>
CommitHash
</
Tag
>
</
TruncatedTextTooltip
>
</
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