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
9892f404
Commit
9892f404
authored
Nov 17, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tx type fix
parent
5d536311
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
TxType.tsx
ui/txs/TxType.tsx
+8
-4
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+1
-1
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+1
-1
No files found.
ui/txs/TxType.tsx
View file @
9892f404
...
@@ -4,14 +4,18 @@ import React from 'react';
...
@@ -4,14 +4,18 @@ import React from 'react';
import
type
{
TransactionType
}
from
'
types/api/transaction
'
;
import
type
{
TransactionType
}
from
'
types/api/transaction
'
;
export
interface
Props
{
export
interface
Props
{
type
:
TransactionType
;
type
s
:
Array
<
TransactionType
>
;
}
}
const
TxStatus
=
({
type
}:
Props
)
=>
{
const
TYPES_ORDER
=
[
'
token_creation
'
,
'
contract_creation
'
,
'
token_transfer
'
,
'
contract_call
'
,
'
coin_transfer
'
];
const
TxType
=
({
types
}:
Props
)
=>
{
const
typeToShow
=
types
.
sort
((
t1
,
t2
)
=>
TYPES_ORDER
.
indexOf
(
t1
)
-
TYPES_ORDER
.
indexOf
(
t2
))[
0
];
let
label
;
let
label
;
let
colorScheme
;
let
colorScheme
;
switch
(
type
)
{
switch
(
type
ToShow
)
{
case
'
contract_call
'
:
case
'
contract_call
'
:
label
=
'
Contract call
'
;
label
=
'
Contract call
'
;
colorScheme
=
'
blue
'
;
colorScheme
=
'
blue
'
;
...
@@ -41,4 +45,4 @@ const TxStatus = ({ type }: Props) => {
...
@@ -41,4 +45,4 @@ const TxStatus = ({ type }: Props) => {
);
);
};
};
export
default
Tx
Status
;
export
default
Tx
Type
;
ui/txs/TxsListItem.tsx
View file @
9892f404
...
@@ -40,7 +40,7 @@ const TxsListItem = ({ tx, showBlockInfo }: {tx: Transaction; showBlockInfo: boo
...
@@ -40,7 +40,7 @@ const TxsListItem = ({ tx, showBlockInfo }: {tx: Transaction; showBlockInfo: boo
<
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
>
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
<
TxType
types=
{
tx
.
tx_types
}
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
<
TxStatus
status=
{
tx
.
status
}
errorText=
{
tx
.
status
===
'
error
'
?
tx
.
result
:
undefined
}
/>
</
HStack
>
</
HStack
>
<
AdditionalInfoButton
onClick=
{
onOpen
}
/>
<
AdditionalInfoButton
onClick=
{
onOpen
}
/>
...
...
ui/txs/TxsTableItem.tsx
View file @
9892f404
...
@@ -76,7 +76,7 @@ const TxsTableItem = ({ tx, showBlockInfo }: {tx: Transaction; showBlockInfo: bo
...
@@ -76,7 +76,7 @@ const TxsTableItem = ({ tx, showBlockInfo }: {tx: Transaction; showBlockInfo: bo
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
VStack
alignItems=
"start"
>
<
VStack
alignItems=
"start"
>
{
tx
.
tx_types
.
map
(
item
=>
<
TxType
key=
{
item
}
type=
{
item
}
/>)
}
<
TxType
types=
{
tx
.
tx_types
}
/>
<
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
>
...
...
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