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
e74c29e9
Commit
e74c29e9
authored
Nov 09, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide block column
parent
cc5fbdbb
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
20 deletions
+43
-20
BlockTxs.tsx
ui/block/BlockTxs.tsx
+1
-0
BlocksContent.tsx
ui/blocks/BlocksContent.tsx
+1
-1
BlocksTable.tsx
ui/blocks/BlocksTable.tsx
+3
-3
TxsContent.tsx
ui/txs/TxsContent.tsx
+10
-4
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+2
-2
TxsSkeletonDesktop.tsx
ui/txs/TxsSkeletonDesktop.tsx
+9
-2
TxsSkeletonMobile.tsx
ui/txs/TxsSkeletonMobile.tsx
+6
-2
TxsTab.tsx
ui/txs/TxsTab.tsx
+1
-0
TxsTable.tsx
ui/txs/TxsTable.tsx
+4
-2
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+6
-4
No files found.
ui/block/BlockTxs.tsx
View file @
e74c29e9
...
@@ -12,6 +12,7 @@ const BlockTxs = () => {
...
@@ -12,6 +12,7 @@ const BlockTxs = () => {
<
TxsContent
<
TxsContent
queryName=
{
QueryKeys
.
blockTxs
}
queryName=
{
QueryKeys
.
blockTxs
}
apiPath=
{
`/node-api/blocks/${ router.query.id }/transactions`
}
apiPath=
{
`/node-api/blocks/${ router.query.id }/transactions`
}
showBlockInfo=
{
false
}
/>
/>
);
);
};
};
...
...
ui/blocks/BlocksContent.tsx
View file @
e74c29e9
...
@@ -92,7 +92,7 @@ const BlocksContent = ({ type }: Props) => {
...
@@ -92,7 +92,7 @@ const BlocksContent = ({ type }: Props) => {
<>
<>
{
socketAlert
&&
<
Alert
status=
"warning"
mb=
{
6
}
as=
"a"
href=
{
window
.
document
.
location
.
href
}
>
{
socketAlert
}
</
Alert
>
}
{
socketAlert
&&
<
Alert
status=
"warning"
mb=
{
6
}
as=
"a"
href=
{
window
.
document
.
location
.
href
}
>
{
socketAlert
}
</
Alert
>
}
<
Show
below=
"lg"
key=
"content-mobile"
><
BlocksList
data=
{
data
.
items
}
/></
Show
>
<
Show
below=
"lg"
key=
"content-mobile"
><
BlocksList
data=
{
data
.
items
}
/></
Show
>
<
Hide
below=
"lg"
key=
"content-desktop"
><
BlocksTable
data=
{
data
.
items
}
top=
{
isPaginatorHidden
?
0
:
80
}
/></
Hide
>
<
Hide
below=
"lg"
key=
"content-desktop"
><
BlocksTable
data=
{
data
.
items
}
top=
{
isPaginatorHidden
?
0
:
80
}
page=
{
pagination
.
page
}
/></
Hide
>
</>
</>
);
);
...
...
ui/blocks/BlocksTable.tsx
View file @
e74c29e9
...
@@ -13,9 +13,10 @@ import { default as Thead } from 'ui/shared/TheadSticky';
...
@@ -13,9 +13,10 @@ import { default as Thead } from 'ui/shared/TheadSticky';
interface
Props
{
interface
Props
{
data
:
Array
<
Block
>
;
data
:
Array
<
Block
>
;
top
:
number
;
top
:
number
;
page
:
number
;
}
}
const
BlocksTable
=
({
data
,
top
}:
Props
)
=>
{
const
BlocksTable
=
({
data
,
top
,
page
}:
Props
)
=>
{
return
(
return
(
<
Table
variant=
"simple"
minWidth=
"1040px"
size=
"md"
fontWeight=
{
500
}
>
<
Table
variant=
"simple"
minWidth=
"1040px"
size=
"md"
fontWeight=
{
500
}
>
...
@@ -32,8 +33,7 @@ const BlocksTable = ({ data, top }: Props) => {
...
@@ -32,8 +33,7 @@ const BlocksTable = ({ data, top }: Props) => {
</
Thead
>
</
Thead
>
<
Tbody
>
<
Tbody
>
<
AnimatePresence
initial=
{
false
}
>
<
AnimatePresence
initial=
{
false
}
>
{
/* TODO prop "enableTimeIncrement" should be set to false for second and later pages */
}
{
data
.
map
((
item
)
=>
<
BlocksTableItem
key=
{
item
.
height
}
data=
{
item
}
enableTimeIncrement=
{
page
===
1
}
/>)
}
{
data
.
map
((
item
)
=>
<
BlocksTableItem
key=
{
item
.
height
}
data=
{
item
}
enableTimeIncrement
/>)
}
</
AnimatePresence
>
</
AnimatePresence
>
</
Tbody
>
</
Tbody
>
</
Table
>
</
Table
>
...
...
ui/txs/TxsContent.tsx
View file @
e74c29e9
...
@@ -19,6 +19,7 @@ type Props = {
...
@@ -19,6 +19,7 @@ type Props = {
showDescription
?:
boolean
;
showDescription
?:
boolean
;
stateFilter
?:
TTxsFilters
[
'
filter
'
];
stateFilter
?:
TTxsFilters
[
'
filter
'
];
apiPath
:
string
;
apiPath
:
string
;
showBlockInfo
?:
boolean
;
}
}
const
TxsContent
=
({
const
TxsContent
=
({
...
@@ -26,6 +27,7 @@ const TxsContent = ({
...
@@ -26,6 +27,7 @@ const TxsContent = ({
showDescription
,
showDescription
,
stateFilter
,
stateFilter
,
apiPath
,
apiPath
,
showBlockInfo
=
true
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
const
{
pagination
,
pagination
,
...
@@ -47,8 +49,8 @@ const TxsContent = ({
...
@@ -47,8 +49,8 @@ const TxsContent = ({
if
(
isLoading
)
{
if
(
isLoading
)
{
return
(
return
(
<>
<>
<
Show
below=
"lg"
ssr=
{
false
}
><
TxsSkeletonMobile
/></
Show
>
<
Show
below=
"lg"
ssr=
{
false
}
><
TxsSkeletonMobile
showBlockInfo=
{
showBlockInfo
}
/></
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
><
TxsSkeletonDesktop
/></
Hide
>
<
Hide
below=
"lg"
ssr=
{
false
}
><
TxsSkeletonDesktop
showBlockInfo=
{
showBlockInfo
}
/></
Hide
>
</>
</>
);
);
}
}
...
@@ -61,8 +63,12 @@ const TxsContent = ({
...
@@ -61,8 +63,12 @@ const TxsContent = ({
return
(
return
(
<>
<>
<
Show
below=
"lg"
ssr=
{
false
}
><
Box
>
{
txs
.
map
(
tx
=>
<
TxsListItem
tx=
{
tx
}
key=
{
tx
.
hash
}
/>)
}
</
Box
></
Show
>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Hide
below=
"lg"
ssr=
{
false
}
><
TxsTable
txs=
{
txs
}
sort=
{
setSortByField
}
sorting=
{
sorting
}
top=
{
isPaginatorHidden
?
0
:
80
}
/></
Hide
>
<
Box
>
{
txs
.
map
(
tx
=>
<
TxsListItem
tx=
{
tx
}
key=
{
tx
.
hash
}
showBlockInfo=
{
showBlockInfo
}
/>)
}
</
Box
>
</
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
TxsTable
txs=
{
txs
}
sort=
{
setSortByField
}
sorting=
{
sorting
}
showBlockInfo=
{
showBlockInfo
}
top=
{
isPaginatorHidden
?
0
:
80
}
/>
</
Hide
>
</>
</>
);
);
})();
})();
...
...
ui/txs/TxsListItem.tsx
View file @
e74c29e9
...
@@ -28,7 +28,7 @@ import TxStatus from 'ui/shared/TxStatus';
...
@@ -28,7 +28,7 @@ import TxStatus from 'ui/shared/TxStatus';
import
TxAdditionalInfo
from
'
ui/txs/TxAdditionalInfo
'
;
import
TxAdditionalInfo
from
'
ui/txs/TxAdditionalInfo
'
;
import
TxType
from
'
ui/txs/TxType
'
;
import
TxType
from
'
ui/txs/TxType
'
;
const
TxsListItem
=
({
tx
}:
{
tx
:
Transactio
n
})
=>
{
const
TxsListItem
=
({
tx
,
showBlockInfo
}:
{
tx
:
Transaction
;
showBlockInfo
:
boolea
n
})
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
iconColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
const
iconColor
=
useColorModeValue
(
'
blue.600
'
,
'
blue.300
'
);
...
@@ -77,7 +77,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -77,7 +77,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
{
tx
.
method
}
{
tx
.
method
}
</
Text
>
</
Text
>
</
Flex
>
</
Flex
>
{
tx
.
block
!==
null
&&
(
{
showBlockInfo
&&
tx
.
block
!==
null
&&
(
<
Box
mt=
{
2
}
>
<
Box
mt=
{
2
}
>
<
Text
as=
"span"
>
Block
</
Text
>
<
Text
as=
"span"
>
Block
</
Text
>
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
...
...
ui/txs/TxsSkeletonDesktop.tsx
View file @
e74c29e9
...
@@ -3,10 +3,17 @@ import React from 'react';
...
@@ -3,10 +3,17 @@ import React from 'react';
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
const
TxsInternalsSkeletonDesktop
=
()
=>
{
interface
Props
{
showBlockInfo
:
boolean
;
}
const
TxsInternalsSkeletonDesktop
=
({
showBlockInfo
}:
Props
)
=>
{
return
(
return
(
<
Box
mb=
{
8
}
>
<
Box
mb=
{
8
}
>
<
SkeletonTable
columns=
{
[
'
32px
'
,
'
20%
'
,
'
18%
'
,
'
15%
'
,
'
11%
'
,
'
292px
'
,
'
18%
'
,
'
18%
'
]
}
/>
<
SkeletonTable
columns=
{
showBlockInfo
?
[
'
32px
'
,
'
20%
'
,
'
18%
'
,
'
15%
'
,
'
11%
'
,
'
292px
'
,
'
18%
'
,
'
18%
'
]
:
[
'
32px
'
,
'
20%
'
,
'
18%
'
,
'
15%
'
,
'
292px
'
,
'
18%
'
,
'
18%
'
]
}
/>
</
Box
>
</
Box
>
);
);
};
};
...
...
ui/txs/TxsSkeletonMobile.tsx
View file @
e74c29e9
import
{
Skeleton
,
Flex
,
Box
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Skeleton
,
Flex
,
Box
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
const
TxInternalsSkeletonMobile
=
()
=>
{
interface
Props
{
showBlockInfo
:
boolean
;
}
const
TxInternalsSkeletonMobile
=
({
showBlockInfo
}:
Props
)
=>
{
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
const
borderColor
=
useColorModeValue
(
'
blackAlpha.200
'
,
'
whiteAlpha.200
'
);
return
(
return
(
...
@@ -25,7 +29,7 @@ const TxInternalsSkeletonMobile = () => {
...
@@ -25,7 +29,7 @@ const TxInternalsSkeletonMobile = () => {
<
Skeleton
w=
"100%"
h=
"30px"
mt=
{
3
}
/>
<
Skeleton
w=
"100%"
h=
"30px"
mt=
{
3
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
3
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
3
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
<
Skeleton
w=
"100%"
h=
{
6
}
mt=
{
6
}
/>
{
showBlockInfo
&&
<
Skeleton
w=
"100%"
h=
{
6
}
mt=
{
6
}
/>
}
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
<
Skeleton
w=
"50%"
h=
{
6
}
mt=
{
2
}
/>
</
Flex
>
</
Flex
>
...
...
ui/txs/TxsTab.tsx
View file @
e74c29e9
...
@@ -25,6 +25,7 @@ const TxsTab = ({ tab }: Props) => {
...
@@ -25,6 +25,7 @@ const TxsTab = ({ tab }: Props) => {
queryName=
{
QueryKeys
.
txsPending
}
queryName=
{
QueryKeys
.
txsPending
}
stateFilter=
"pending"
stateFilter=
"pending"
apiPath=
"/api/transactions"
apiPath=
"/api/transactions"
showBlockInfo=
{
false
}
/>
/>
);
);
};
};
...
...
ui/txs/TxsTable.tsx
View file @
e74c29e9
...
@@ -15,9 +15,10 @@ type Props = {
...
@@ -15,9 +15,10 @@ type Props = {
sort
:
(
field
:
'
val
'
|
'
fee
'
)
=>
()
=>
void
;
sort
:
(
field
:
'
val
'
|
'
fee
'
)
=>
()
=>
void
;
sorting
?:
Sort
;
sorting
?:
Sort
;
top
:
number
;
top
:
number
;
showBlockInfo
:
boolean
;
}
}
const
TxsTable
=
({
txs
,
sort
,
sorting
,
top
}:
Props
)
=>
{
const
TxsTable
=
({
txs
,
sort
,
sorting
,
top
,
showBlockInfo
}:
Props
)
=>
{
return
(
return
(
<
Table
variant=
"simple"
minWidth=
"810px"
size=
"xs"
>
<
Table
variant=
"simple"
minWidth=
"810px"
size=
"xs"
>
<
TheadSticky
top=
{
top
}
>
<
TheadSticky
top=
{
top
}
>
...
@@ -26,7 +27,7 @@ const TxsTable = ({ txs, sort, sorting, top }: Props) => {
...
@@ -26,7 +27,7 @@ const TxsTable = ({ txs, sort, sorting, top }: Props) => {
<
Th
width=
"20%"
>
Type
</
Th
>
<
Th
width=
"20%"
>
Type
</
Th
>
<
Th
width=
"18%"
>
Txn hash
</
Th
>
<
Th
width=
"18%"
>
Txn hash
</
Th
>
<
Th
width=
"15%"
>
Method
</
Th
>
<
Th
width=
"15%"
>
Method
</
Th
>
<
Th
width=
"11%"
>
Block
</
Th
>
{
showBlockInfo
&&
<
Th
width=
"11%"
>
Block
</
Th
>
}
<
Th
width=
{
{
xl
:
'
128px
'
,
base
:
'
66px
'
}
}
>
From
</
Th
>
<
Th
width=
{
{
xl
:
'
128px
'
,
base
:
'
66px
'
}
}
>
From
</
Th
>
<
Th
width=
{
{
xl
:
'
36px
'
,
base
:
'
0
'
}
}
></
Th
>
<
Th
width=
{
{
xl
:
'
36px
'
,
base
:
'
0
'
}
}
></
Th
>
<
Th
width=
{
{
xl
:
'
128px
'
,
base
:
'
66px
'
}
}
>
To
</
Th
>
<
Th
width=
{
{
xl
:
'
128px
'
,
base
:
'
66px
'
}
}
>
To
</
Th
>
...
@@ -51,6 +52,7 @@ const TxsTable = ({ txs, sort, sorting, top }: Props) => {
...
@@ -51,6 +52,7 @@ const TxsTable = ({ txs, sort, sorting, top }: Props) => {
<
TxsTableItem
<
TxsTableItem
key=
{
item
.
hash
}
key=
{
item
.
hash
}
tx=
{
item
}
tx=
{
item
}
showBlockInfo=
{
showBlockInfo
}
/>
/>
))
}
))
}
</
Tbody
>
</
Tbody
>
...
...
ui/txs/TxsTableItem.tsx
View file @
e74c29e9
...
@@ -34,7 +34,7 @@ import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo';
...
@@ -34,7 +34,7 @@ import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo';
import
TxType
from
'
./TxType
'
;
import
TxType
from
'
./TxType
'
;
const
TxsTableItem
=
({
tx
}:
{
tx
:
Transaction
})
=>
{
const
TxsTableItem
=
({
tx
,
showBlockInfo
}:
{
tx
:
Transaction
;
showBlockInfo
:
boolean
})
=>
{
const
addressFrom
=
(
const
addressFrom
=
(
<
Address
>
<
Address
>
<
Tooltip
label=
{
tx
.
from
.
implementation_name
}
>
<
Tooltip
label=
{
tx
.
from
.
implementation_name
}
>
...
@@ -102,9 +102,11 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -102,9 +102,11 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
)
:
'
-
'
}
)
:
'
-
'
}
</
Td
>
</
Td
>
<
Td
>
{
showBlockInfo
&&
(
{
tx
.
block
&&
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
}
<
Td
>
</
Td
>
{
tx
.
block
&&
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block
.
toString
()
})
}
>
{
tx
.
block
}
</
Link
>
}
</
Td
>
)
}
<
Show
above=
"xl"
ssr=
{
false
}
>
<
Show
above=
"xl"
ssr=
{
false
}
>
<
Td
>
<
Td
>
{
addressFrom
}
{
addressFrom
}
...
...
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