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
1862b8e5
Commit
1862b8e5
authored
Oct 06, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indexed value
parent
ad8de4a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
25 deletions
+40
-25
decodedInput.ts
types/api/decodedInput.ts
+1
-0
TxDecodedInputData.tsx
ui/tx/TxDecodedInputData.tsx
+39
-25
No files found.
types/api/decodedInput.ts
View file @
1862b8e5
...
@@ -8,4 +8,5 @@ export interface DecodedInputParams {
...
@@ -8,4 +8,5 @@ export interface DecodedInputParams {
name
:
string
;
name
:
string
;
type
:
string
;
type
:
string
;
value
:
string
;
value
:
string
;
indexed
?:
boolean
;
}
}
ui/tx/TxDecodedInputData.tsx
View file @
1862b8e5
...
@@ -18,7 +18,7 @@ interface RowProps {
...
@@ -18,7 +18,7 @@ interface RowProps {
const
PADDING
=
4
;
const
PADDING
=
4
;
const
GAP
=
5
;
const
GAP
=
5
;
const
TableRow
=
({
isLast
,
name
,
type
,
children
}:
RowProps
)
=>
{
const
TableRow
=
({
isLast
,
name
,
type
,
children
,
indexed
}:
RowProps
)
=>
{
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
return
(
return
(
...
@@ -41,14 +41,16 @@ const TableRow = ({ isLast, name, type, children }: RowProps) => {
...
@@ -41,14 +41,16 @@ const TableRow = ({ isLast, name, type, children }: RowProps) => {
>
>
{
type
}
{
type
}
</
GridItem
>
</
GridItem
>
{
/* <GridItem
{
indexed
!==
undefined
&&
(
pr={ GAP }
<
GridItem
pt={ GAP }
pr=
{
GAP
}
pb={ isLast ? PADDING : 0 }
pt=
{
GAP
}
bgColor={ bgColor }
pb=
{
isLast
?
PADDING
:
0
}
>
bgColor=
{
bgColor
}
{ indexed ? 'true' : 'false' }
>
</GridItem> */
}
{
indexed
?
'
true
'
:
'
false
'
}
</
GridItem
>
)
}
<
GridItem
<
GridItem
pr=
{
PADDING
}
pr=
{
PADDING
}
pt=
{
GAP
}
pt=
{
GAP
}
...
@@ -68,12 +70,22 @@ interface Props {
...
@@ -68,12 +70,22 @@ interface Props {
const
TxDecodedInputData
=
({
data
}:
Props
)
=>
{
const
TxDecodedInputData
=
({
data
}:
Props
)
=>
{
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
bgColor
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
);
const
hasIndexed
=
data
.
parameters
.
some
(({
indexed
})
=>
indexed
!==
undefined
);
const
gridTemplateColumns
=
hasIndexed
?
'
minmax(80px, auto) minmax(80px, auto) minmax(80px, auto) minmax(0, 1fr)
'
:
'
minmax(80px, auto) minmax(80px, auto) minmax(0, 1fr)
'
;
const
colNumber
=
hasIndexed
?
4
:
3
;
return
(
return
(
<
Grid
gridTemplateColumns=
"minmax(80px, auto) minmax(80px, auto) minmax(0, 1fr)"
fontSize=
"sm"
lineHeight=
{
5
}
w=
"100%"
>
<
Grid
gridTemplateColumns=
{
gridTemplateColumns
}
fontSize=
"sm"
lineHeight=
{
5
}
w=
"100%"
>
{
/* FIRST PART OF BLOCK */
}
{
/* FIRST PART OF BLOCK */
}
<
GridItem
fontWeight=
{
600
}
pl=
{
{
base
:
0
,
lg
:
PADDING
}
}
pr=
{
{
base
:
0
,
lg
:
GAP
}
}
colSpan=
{
{
base
:
3
,
lg
:
undefined
}
}
>
Method Id
</
GridItem
>
<
GridItem
fontWeight=
{
600
}
pl=
{
{
base
:
0
,
lg
:
PADDING
}
}
pr=
{
{
base
:
0
,
lg
:
GAP
}
}
colSpan=
{
{
base
:
colNumber
,
lg
:
undefined
}
}
>
<
GridItem
colSpan=
{
{
base
:
3
,
lg
:
2
}
}
pr=
{
{
base
:
0
,
lg
:
PADDING
}
}
mt=
{
{
base
:
2
,
lg
:
0
}
}
>
{
data
.
method_id
}
</
GridItem
>
Method Id
</
GridItem
>
<
GridItem
colSpan=
{
{
base
:
colNumber
,
lg
:
colNumber
-
1
}
}
pr=
{
{
base
:
0
,
lg
:
PADDING
}
}
mt=
{
{
base
:
2
,
lg
:
0
}
}
>
{
data
.
method_id
}
</
GridItem
>
<
GridItem
<
GridItem
py=
{
2
}
py=
{
2
}
mt=
{
2
}
mt=
{
2
}
...
@@ -82,7 +94,7 @@ const TxDecodedInputData = ({ data }: Props) => {
...
@@ -82,7 +94,7 @@ const TxDecodedInputData = ({ data }: Props) => {
fontWeight=
{
600
}
fontWeight=
{
600
}
borderTopColor=
{
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
}
borderTopColor=
{
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
}
borderTopWidth=
"1px"
borderTopWidth=
"1px"
colSpan=
{
{
base
:
3
,
lg
:
undefined
}
}
colSpan=
{
{
base
:
colNumber
,
lg
:
undefined
}
}
>
>
Call
Call
</
GridItem
>
</
GridItem
>
...
@@ -90,7 +102,7 @@ const TxDecodedInputData = ({ data }: Props) => {
...
@@ -90,7 +102,7 @@ const TxDecodedInputData = ({ data }: Props) => {
py=
{
{
base
:
0
,
lg
:
2
}
}
py=
{
{
base
:
0
,
lg
:
2
}
}
mt=
{
{
base
:
0
,
lg
:
2
}
}
mt=
{
{
base
:
0
,
lg
:
2
}
}
mb=
{
{
base
:
2
,
lg
:
0
}
}
mb=
{
{
base
:
2
,
lg
:
0
}
}
colSpan=
{
{
base
:
3
,
lg
:
2
}
}
colSpan=
{
{
base
:
colNumber
,
lg
:
colNumber
-
1
}
}
pr=
{
{
base
:
0
,
lg
:
PADDING
}
}
pr=
{
{
base
:
0
,
lg
:
PADDING
}
}
borderTopColor=
{
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
}
borderTopColor=
{
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
)
}
borderTopWidth=
{
{
base
:
'
0px
'
,
lg
:
'
1px
'
}
}
borderTopWidth=
{
{
base
:
'
0px
'
,
lg
:
'
1px
'
}
}
...
@@ -118,15 +130,17 @@ const TxDecodedInputData = ({ data }: Props) => {
...
@@ -118,15 +130,17 @@ const TxDecodedInputData = ({ data }: Props) => {
>
>
Type
Type
</
GridItem
>
</
GridItem
>
{
/* <GridItem
{
hasIndexed
&&
(
pr={ GAP }
<
GridItem
pt={ PADDING }
pr=
{
GAP
}
pb={ 1 }
pt=
{
PADDING
}
bgColor={ bgColor }
pb=
{
1
}
fontWeight={ 600 }
bgColor=
{
bgColor
}
>
fontWeight=
{
600
}
Inde<wbr/>xed?
>
</GridItem> */
}
Inde
<
wbr
/>
xed?
</
GridItem
>
)
}
<
GridItem
<
GridItem
pr=
{
PADDING
}
pr=
{
PADDING
}
pt=
{
PADDING
}
pt=
{
PADDING
}
...
@@ -136,9 +150,9 @@ const TxDecodedInputData = ({ data }: Props) => {
...
@@ -136,9 +150,9 @@ const TxDecodedInputData = ({ data }: Props) => {
>
>
Data
Data
</
GridItem
>
</
GridItem
>
{
data
.
parameters
.
map
(({
name
,
type
,
value
},
index
)
=>
{
{
data
.
parameters
.
map
(({
name
,
type
,
value
,
indexed
},
index
)
=>
{
return
(
return
(
<
TableRow
key=
{
name
}
name=
{
name
}
type=
{
type
}
isLast=
{
index
===
data
.
parameters
.
length
-
1
}
>
<
TableRow
key=
{
name
}
name=
{
name
}
type=
{
type
}
isLast=
{
index
===
data
.
parameters
.
length
-
1
}
indexed=
{
indexed
}
>
{
type
===
'
address
'
?
(
{
type
===
'
address
'
?
(
<
Address
justifyContent=
"space-between"
>
<
Address
justifyContent=
"space-between"
>
<
AddressLink
hash=
{
value
}
/>
<
AddressLink
hash=
{
value
}
/>
...
...
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