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
37e4f22a
Commit
37e4f22a
authored
Sep 08, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cut and other info
parent
a627b3dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
6 deletions
+72
-6
tx.ts
data/tx.ts
+6
-0
Link.ts
theme/components/Link.ts
+1
-0
DetailsInfoItem.tsx
ui/shared/DetailsInfoItem.tsx
+2
-2
TxDetails.tsx
ui/tx/TxDetails.tsx
+63
-4
No files found.
data/tx.ts
View file @
37e4f22a
...
...
@@ -27,4 +27,10 @@ export const tx = {
value
:
0.002156925953623692
,
value_usd
:
2.55
,
},
type
:
{
value
:
'
2
'
,
eip
:
'
EIP-1559
'
,
},
nonce
:
4
,
position
:
342
,
};
theme/components/Link.ts
View file @
37e4f22a
...
...
@@ -11,6 +11,7 @@ const variantPrimary = defineStyle((props) => {
color
:
mode
(
'
blue.600
'
,
'
blue.300
'
)(
props
),
_hover
:
{
color
:
mode
(
'
blue.400
'
,
'
blue.200
'
)(
props
),
textDecorationStyle
:
props
.
textDecorationStyle
||
'
solid
'
,
},
};
});
...
...
ui/shared/DetailsInfoItem.tsx
View file @
37e4f22a
...
...
@@ -13,7 +13,7 @@ interface Props extends HTMLChakraProps<'div'> {
const
DetailsInfoItem
=
({
title
,
hint
,
children
,
...
styles
}:
Props
)
=>
{
return
(
<>
<
GridItem
py=
{
2
}
{
...
styles
}
whiteSpace=
"nowrap"
>
<
GridItem
py=
{
2
}
lineHeight=
{
5
}
{
...
styles
}
whiteSpace=
"nowrap"
>
<
Flex
columnGap=
{
2
}
alignItems=
"center"
>
<
Tooltip
label=
{
hint
}
...
...
@@ -27,7 +27,7 @@ const DetailsInfoItem = ({ title, hint, children, ...styles }: Props) => {
<
Text
fontWeight=
{
500
}
>
{
title
}
</
Text
>
</
Flex
>
</
GridItem
>
<
GridItem
display=
"flex"
alignItems=
"center"
py=
{
2
}
whiteSpace=
"nowrap"
{
...
styles
}
>
<
GridItem
display=
"flex"
alignItems=
"center"
py=
{
2
}
lineHeight=
{
5
}
whiteSpace=
"nowrap"
{
...
styles
}
>
{
children
}
</
GridItem
>
</>
...
...
ui/tx/TxDetails.tsx
View file @
37e4f22a
import
{
Grid
,
Text
,
Box
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
GridItem
,
Text
,
Box
,
Icon
,
Link
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
tx
}
from
'
data/tx
'
;
...
...
@@ -14,6 +14,8 @@ import type { Props as TxStatusProps } from 'ui/tx/TxStatus';
import
TxStatus
from
'
ui/tx/TxStatus
'
;
const
TxDetails
=
()
=>
{
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
const
leftSeparatorStyles
=
{
ml
:
3
,
pl
:
3
,
...
...
@@ -21,6 +23,10 @@ const TxDetails = () => {
borderLeftColor
:
'
gray.700
'
,
};
const
handleCutClick
=
React
.
useCallback
(()
=>
{
setIsExpanded
((
flag
)
=>
!
flag
);
},
[]);
return
(
<
Grid
columnGap=
{
8
}
rowGap=
{
3
}
templateColumns=
"auto 1fr"
>
<
DetailsInfoItem
...
...
@@ -107,15 +113,15 @@ const TxDetails = () => {
hint=
"Base Fee refers to the network Base Fee at the time of the block, while Max Fee & Max Priority Fee refer to the max amount a user is willing to pay for their tx & to give to the miner respectively."
>
<
Box
>
<
Text
as=
"span"
>
Base:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Base:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
base
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
>
Max:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Max:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
max
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
>
Max priority:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Max priority:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
max_priority
}
</
Text
>
</
Box
>
</
DetailsInfoItem
>
...
...
@@ -127,6 +133,59 @@ const TxDetails = () => {
<
Text
ml=
{
1
}
>
{
tx
.
burnt_fees
.
value
.
toLocaleString
(
'
en
'
,
{
minimumFractionDigits
:
18
})
}
Ether
</
Text
>
<
Text
variant=
"secondary"
ml=
{
1
}
>
($
{
tx
.
burnt_fees
.
value_usd
.
toFixed
(
2
)
}
)
</
Text
>
</
DetailsInfoItem
>
<
GridItem
colSpan=
{
2
}
>
<
Link
mt=
{
6
}
display=
"inline-block"
fontSize=
"sm"
textDecorationLine=
"underline"
textDecorationStyle=
"dashed"
onClick=
{
handleCutClick
}
>
{
isExpanded
?
'
Hide details
'
:
'
View details
'
}
</
Link
>
</
GridItem
>
{
isExpanded
&&
(
<>
<
DetailsInfoItem
mt=
{
4
}
title=
"Other"
hint=
"Other data related to this transaction."
>
<
Box
>
<
Text
as=
"span"
fontWeight=
"500"
>
Txn type:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
type
.
value
}
</
Text
>
<
Text
fontWeight=
"400"
as=
"span"
ml=
{
1
}
>
(
{
tx
.
type
.
eip
}
)
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
fontWeight=
"500"
>
Nonce:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
nonce
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
fontWeight=
"500"
>
Position:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
position
}
</
Text
>
</
Box
>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Other"
hint=
"Other data related to this transaction."
>
<
Box
>
<
Text
as=
"span"
fontWeight=
"500"
>
Txn type:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
type
.
value
}
</
Text
>
<
Text
fontWeight=
"400"
as=
"span"
ml=
{
1
}
>
(
{
tx
.
type
.
eip
}
)
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
fontWeight=
"500"
>
Nonce:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
nonce
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
fontWeight=
"500"
>
Position:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
position
}
</
Text
>
</
Box
>
</
DetailsInfoItem
>
</>
)
}
</
Grid
>
);
};
...
...
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