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
f02904c3
Commit
f02904c3
authored
Nov 04, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix margin of action bar
parent
473d2b27
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
74 additions
and
64 deletions
+74
-64
BlocksContent.tsx
ui/blocks/BlocksContent.tsx
+31
-20
BlocksList.tsx
ui/blocks/BlocksList.tsx
+1
-1
BlocksTable.tsx
ui/blocks/BlocksTable.tsx
+1
-1
Block.tsx
ui/pages/Block.tsx
+1
-3
Blocks.tsx
ui/pages/Blocks.tsx
+1
-3
PrivateTags.tsx
ui/pages/PrivateTags.tsx
+1
-1
Transaction.tsx
ui/pages/Transaction.tsx
+1
-3
Transactions.tsx
ui/pages/Transactions.tsx
+1
-1
ActionBar.tsx
ui/shared/ActionBar.tsx
+7
-7
RoutedTabs.tsx
ui/shared/RoutedTabs/RoutedTabs.tsx
+4
-2
TxsContent.tsx
ui/txs/TxsContent.tsx
+20
-18
TxsHeader.tsx
ui/txs/TxsHeader.tsx
+5
-4
No files found.
ui/blocks/BlocksContent.tsx
View file @
f02904c3
...
...
@@ -61,6 +61,7 @@ const BlocksContent = ({ type }: Props) => {
handler
:
handleNewBlockMessage
,
});
const
content
=
(()
=>
{
if
(
isLoading
)
{
return
(
<>
...
...
@@ -68,7 +69,6 @@ const BlocksContent = ({ type }: Props) => {
<
BlocksSkeletonMobile
/>
</
Show
>
<
Show
above=
"lg"
key=
"skeleton-desktop"
>
<
Skeleton
h=
{
6
}
mb=
{
8
}
w=
"150px"
/>
<
SkeletonTable
columns=
{
[
'
125px
'
,
'
120px
'
,
'
21%
'
,
'
64px
'
,
'
35%
'
,
'
22%
'
,
'
22%
'
]
}
/>
</
Show
>
</>
...
...
@@ -85,13 +85,24 @@ const BlocksContent = ({ type }: Props) => {
return
(
<>
<
Text
as=
"span"
>
Total of
{
data
.
items
[
0
].
height
.
toLocaleString
()
}
blocks
</
Text
>
{
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
above=
"lg"
key=
"content-desktop"
><
BlocksTable
data=
{
data
.
items
}
/></
Show
>
</>
);
})();
return
(
<>
{
data
?
<
Text
mb=
{
{
base
:
0
,
lg
:
6
}
}
>
Total of
{
data
.
items
[
0
].
height
.
toLocaleString
()
}
blocks
</
Text
>
:
<
Skeleton
h=
"24px"
w=
"200px"
mb=
{
{
base
:
0
,
lg
:
6
}
}
/>
}
<
ActionBar
>
<
Pagination
ml=
"auto"
{
...
pagination
}
/>
</
ActionBar
>
{
socketAlert
&&
<
Alert
status=
"warning"
mt=
{
8
}
as=
"a"
href=
{
window
.
document
.
location
.
href
}
>
{
socketAlert
}
</
Alert
>
}
<
Show
below=
"lg"
key=
"content-mobile"
><
BlocksList
data=
{
data
.
items
}
/></
Show
>
<
Show
above=
"lg"
key=
"content-desktop"
><
BlocksTable
data=
{
data
.
items
}
/></
Show
>
{
content
}
</>
);
};
...
...
ui/blocks/BlocksList.tsx
View file @
f02904c3
...
...
@@ -12,7 +12,7 @@ interface Props {
const
BlocksList
=
({
data
}:
Props
)
=>
{
return
(
<
Box
mt=
{
8
}
>
<
Box
>
<
AnimatePresence
initial=
{
false
}
>
{
/* TODO prop "enableTimeIncrement" should be set to false for second and later pages */
}
{
data
.
map
((
item
)
=>
<
BlocksListItem
key=
{
item
.
height
}
data=
{
item
}
enableTimeIncrement
/>)
}
...
...
ui/blocks/BlocksTable.tsx
View file @
f02904c3
...
...
@@ -17,7 +17,7 @@ interface Props {
const
BlocksTable
=
({
data
}:
Props
)
=>
{
return
(
<
Table
variant=
"simple"
minWidth=
"1040px"
size=
"md"
fontWeight=
{
500
}
mt=
{
8
}
>
<
Table
variant=
"simple"
minWidth=
"1040px"
size=
"md"
fontWeight=
{
500
}
>
<
Thead
top=
{
80
}
>
<
Tr
>
<
Th
width=
"125px"
>
Block
</
Th
>
...
...
ui/pages/Block.tsx
View file @
f02904c3
...
...
@@ -24,9 +24,7 @@ const BlockPageContent = () => {
return
(
<
Page
>
<
PageTitle
text=
{
`Block #${ router.query.id }`
}
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
tabListMarginBottom=
{
{
base
:
6
,
lg
:
12
}
}
/>
</
Page
>
);
};
...
...
ui/pages/Blocks.tsx
View file @
f02904c3
...
...
@@ -17,9 +17,7 @@ const BlocksPageContent = () => {
return
(
<
Page
>
<
PageTitle
text=
"Blocks"
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
tabListMarginBottom=
{
{
base
:
6
,
lg
:
8
}
}
/>
</
Page
>
);
};
...
...
ui/pages/PrivateTags.tsx
View file @
f02904c3
...
...
@@ -17,7 +17,7 @@ const PrivateTags = () => {
return
(
<
Page
>
<
PageTitle
text=
"Private tags"
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
tabListMarginBottom=
{
{
base
:
6
,
lg
:
8
}
}
/>
</
Page
>
);
};
...
...
ui/pages/Transaction.tsx
View file @
f02904c3
...
...
@@ -75,9 +75,7 @@ const TransactionPageContent = () => {
</
Flex
>
)
}
</
Flex
>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
tabListMarginBottom=
{
{
base
:
6
,
lg
:
12
}
}
/>
</
Page
>
);
};
...
...
ui/pages/Transactions.tsx
View file @
f02904c3
...
...
@@ -22,7 +22,7 @@ const Transactions = () => {
<
Page
hideMobileHeaderOnScrollDown
>
<
Box
h=
"100%"
>
<
PageTitle
text=
"Transactions"
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
<
RoutedTabs
tabs=
{
TABS
}
tabListMarginBottom=
{
{
base
:
6
,
lg
:
8
}
}
/>
</
Box
>
</
Page
>
);
...
...
ui/shared/ActionBar.tsx
View file @
f02904c3
import
{
Flex
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
useColorModeValue
,
chakra
}
from
'
@chakra-ui/react
'
;
import
throttle
from
'
lodash/throttle
'
;
import
React
from
'
react
'
;
...
...
@@ -6,12 +6,13 @@ import ScrollDirectionContext from 'ui/ScrollDirectionContext';
type
Props
=
{
children
:
React
.
ReactNode
;
className
?:
string
;
}
const
TOP_UP
=
106
;
const
TOP_DOWN
=
0
;
const
ActionBar
=
({
children
}:
Props
)
=>
{
const
ActionBar
=
({
children
,
className
}:
Props
)
=>
{
const
[
isSticky
,
setIsSticky
]
=
React
.
useState
(
false
);
const
ref
=
React
.
useRef
<
HTMLDivElement
>
(
null
);
...
...
@@ -43,17 +44,16 @@ const ActionBar = ({ children }: Props) => {
<
ScrollDirectionContext
.
Consumer
>
{
(
scrollDirection
)
=>
(
<
Flex
className=
{
className
}
backgroundColor=
{
bgColor
}
// mt=
{
-6
}
pt=
{
6
}
pb=
{
6
}
py=
{
6
}
mx=
{
{
base
:
-
4
,
lg
:
0
}
}
px=
{
{
base
:
4
,
lg
:
0
}
}
justifyContent=
"space-between"
width=
{
{
base
:
'
100vw
'
,
lg
:
'
unset
'
}
}
position=
"sticky"
top=
{
{
base
:
scrollDirection
===
'
down
'
?
`${ TOP_DOWN }px`
:
`${ TOP_UP }px`
,
lg
:
0
}
}
transitionProperty=
"top,box-shadow"
transitionProperty=
"top,box-shadow
,background-color,color
"
transitionDuration=
"slow"
zIndex=
{
{
base
:
'
sticky2
'
,
lg
:
'
docked
'
}
}
boxShadow=
{
{
base
:
isSticky
?
'
md
'
:
'
none
'
,
lg
:
'
none
'
}
}
...
...
@@ -66,4 +66,4 @@ const ActionBar = ({ children }: Props) => {
);
};
export
default
ActionBar
;
export
default
chakra
(
ActionBar
)
;
ui/shared/RoutedTabs/RoutedTabs.tsx
View file @
f02904c3
import
type
{
ChakraProps
}
from
'
@chakra-ui/react
'
;
import
{
Tab
,
Tabs
,
...
...
@@ -25,9 +26,10 @@ const hiddenItemStyles: StyleProps = {
interface
Props
{
tabs
:
Array
<
RoutedTab
>
;
tabListMarginBottom
?:
ChakraProps
[
'
marginBottom
'
];
}
const
RoutedTabs
=
({
tabs
}:
Props
)
=>
{
const
RoutedTabs
=
({
tabs
,
tabListMarginBottom
}:
Props
)
=>
{
const
router
=
useRouter
();
const
[
activeTabIndex
,
setActiveTabIndex
]
=
useState
<
number
>
(
tabs
.
length
+
1
);
useEffect
(()
=>
{
...
...
@@ -59,7 +61,7 @@ const RoutedTabs = ({ tabs }: Props) => {
return
(
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
handleTabChange
}
index=
{
activeTabIndex
}
>
<
TabList
marginBottom=
{
{
base
:
6
,
lg
:
12
}
}
marginBottom=
{
tabListMarginBottom
}
flexWrap=
"nowrap"
whiteSpace=
"nowrap"
ref=
{
listRef
}
...
...
ui/txs/TxsContent.tsx
View file @
f02904c3
...
...
@@ -65,31 +65,33 @@ const TxsContent = ({
}
=
useQueryWithPages
<
TransactionsResponse
>
(
apiPath
,
queryName
,
stateFilter
&&
{
filter
:
stateFilter
});
// } = useQueryWithPages({ ...filters, filter: stateFilter, apiPath });
const
content
=
(()
=>
{
if
(
isError
)
{
return
<
DataFetchAlert
/>;
}
const
txs
=
data
?.
items
;
if
(
!
isLoading
&&
!
txs
)
{
if
(
!
isLoading
&&
!
txs
?.
length
)
{
return
<
Alert
>
There are no transactions.
</
Alert
>;
}
let
content
=
(
if
(
!
isLoading
&&
txs
)
{
return
<
TxsWithSort
txs=
{
txs
}
sorting=
{
sorting
}
sort=
{
sort
}
/>;
}
return
(
<>
<
Show
below=
"lg"
ssr=
{
false
}
><
TxsSkeletonMobile
/></
Show
>
<
Show
above=
"lg"
ssr=
{
false
}
><
TxsSkeletonDesktop
/></
Show
>
</>
);
if
(
!
isLoading
&&
txs
)
{
content
=
<
TxsWithSort
txs=
{
txs
}
sorting=
{
sorting
}
sort=
{
sort
}
/>;
}
})();
return
(
<>
{
showDescription
&&
<
Box
mb=
{
12
}
>
Only the first 10,000 elements are displayed
</
Box
>
}
<
TxsHeader
sorting=
{
sorting
}
setSorting=
{
setSorting
}
paginationProps=
{
pagination
}
/>
{
showDescription
&&
<
Box
mb=
{
{
base
:
6
,
lg
:
12
}
}
>
Only the first 10,000 elements are displayed
</
Box
>
}
<
TxsHeader
mt=
{
-
6
}
sorting=
{
sorting
}
setSorting=
{
setSorting
}
paginationProps=
{
pagination
}
/>
{
content
}
</>
);
...
...
ui/txs/TxsHeader.tsx
View file @
f02904c3
import
{
HStack
}
from
'
@chakra-ui/react
'
;
import
{
HStack
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
Sort
}
from
'
types/client/txs-sort
'
;
...
...
@@ -16,13 +16,14 @@ type Props = {
sorting
:
Sort
;
setSorting
:
(
val
:
Sort
|
((
val
:
Sort
)
=>
Sort
))
=>
void
;
paginationProps
:
PaginationProps
;
className
?:
string
;
}
const
TxsHeader
=
({
sorting
,
setSorting
,
paginationProps
}:
Props
)
=>
{
const
TxsHeader
=
({
sorting
,
setSorting
,
paginationProps
,
className
}:
Props
)
=>
{
const
isMobile
=
useIsMobile
(
false
);
return
(
<
ActionBar
>
<
ActionBar
className=
{
className
}
>
<
HStack
>
{
/* api is not implemented */
}
{
/* <TxsFilters
...
...
@@ -51,4 +52,4 @@ const TxsHeader = ({ sorting, setSorting, paginationProps }: Props) => {
);
};
export
default
TxsHeader
;
export
default
chakra
(
TxsHeader
)
;
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