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
0b0eedbb
Commit
0b0eedbb
authored
Sep 28, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt to mobile view
parent
c2879a56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
BlockDetails.tsx
ui/block/BlockDetails.tsx
+13
-9
No files found.
ui/block/BlockDetails.tsx
View file @
0b0eedbb
import
{
Grid
,
GridItem
,
Text
,
Icon
,
Link
,
Stat
,
StatArrow
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
GridItem
,
Text
,
Icon
,
Link
,
Stat
,
StatArrow
,
Box
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
{
scroller
,
Element
}
from
'
react-scroll
'
;
...
...
@@ -35,7 +35,7 @@ const BlockDetails = () => {
const
sectionGap
=
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
1
,
lg
:
4
}
}
/>;
return
(
<
Grid
columnGap=
{
8
}
rowGap=
{
{
base
:
3
,
lg
:
3
}
}
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
>
<
Grid
columnGap=
{
8
}
rowGap=
{
{
base
:
3
,
lg
:
3
}
}
templateColumns=
{
{
base
:
'
minmax(0, 1fr)
'
,
lg
:
'
auto minmax(0, 1fr)
'
}
}
overflow=
"hidden"
>
<
DetailsInfoItem
title=
"Block height"
hint=
"The block height of a particular block is defined as the number of blocks preceding it in the blockchain."
...
...
@@ -81,7 +81,7 @@ const BlockDetails = () => {
columnGap=
{
1
}
>
<
Text
>
{
block
.
reward
.
static
+
block
.
reward
.
tx_fee
-
block
.
burnt_fees
}
</
Text
>
<
Text
variant=
"secondary"
whiteSpace=
"
pre
"
>
(
<
Text
variant=
"secondary"
whiteSpace=
"
break-spaces
"
>
(
<
Tooltip
label=
"Static block reward"
>
<
span
>
{
block
.
reward
.
static
}
</
span
>
</
Tooltip
>
...
...
@@ -103,8 +103,8 @@ const BlockDetails = () => {
hint=
"The total gas amount used in the block and its percentage of gas filled in the block."
>
<
Text
>
{
block
.
gas_used
.
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Utilization
ml=
{
4
}
colorScheme=
"gray"
value=
{
block
.
gas_used
/
block
.
gas_limit
}
/>
<
Stat
ml=
{
5
}
>
<
Utilization
ml=
{
4
}
mr=
{
5
}
colorScheme=
"gray"
value=
{
block
.
gas_used
/
block
.
gas_limit
}
/>
<
Stat
>
<
StatArrow
ml=
{
1
}
type=
{
gasUsedPercentage
>=
0
?
'
increase
'
:
'
decrease
'
}
/>
<
Text
as=
"span"
color=
{
gasUsedPercentage
>=
0
?
'
green.500
'
:
'
red.500
'
}
fontWeight=
{
600
}
>
{
Math
.
abs
(
gasUsedPercentage
)
}
% Gas Target
</
Text
>
</
Stat
>
...
...
@@ -133,8 +133,8 @@ const BlockDetails = () => {
title=
"Extra data"
hint=
"Any data that can be included by the miner in the block."
>
<
Text
>
{
block
.
data
.
utf
}
</
Text
>
<
Text
variant=
"secondary"
whiteSpace=
"pre"
>
(Hex:
{
block
.
data
.
hex
}
)
</
Text
>
<
Text
whiteSpace=
"pre"
>
{
block
.
data
.
utf
}
</
Text
>
<
Text
variant=
"secondary"
>
(Hex:
{
block
.
data
.
hex
}
)
</
Text
>
</
DetailsInfoItem
>
{
/* CUT */
}
...
...
@@ -176,13 +176,17 @@ const BlockDetails = () => {
<
DetailsInfoItem
title=
"Hash"
hint=
"The SHA256 hash of the block."
flexWrap=
"nowrap"
>
<
HashStringShortenDynamic
hash=
{
block
.
hash
}
/>
<
Box
overflow=
"hidden"
>
<
HashStringShortenDynamic
hash=
{
block
.
hash
}
/>
</
Box
>
<
CopyToClipboard
text=
{
block
.
hash
}
/>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Parent hash"
hint=
"The hash of the block from which this block was generated."
flexWrap=
"nowrap"
>
<
AddressLink
hash=
{
block
.
parent_hash
}
type=
"block"
id=
{
String
(
block
.
parent_height
)
}
/>
<
CopyToClipboard
text=
{
block
.
hash
}
/>
...
...
@@ -191,7 +195,7 @@ const BlockDetails = () => {
title=
"State root"
hint=
"The root of the state trie."
>
{
block
.
state_root
}
<
Text
wordBreak=
"break-all"
whiteSpace=
"break-spaces"
>
{
block
.
state_root
}
</
Text
>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Nonce"
...
...
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