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
74067a0d
Commit
74067a0d
authored
Sep 19, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pagination
parent
52c79416
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
22 deletions
+81
-22
Pagination.tsx
ui/txs/Pagination.tsx
+72
-0
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+5
-21
TxsValidated.tsx
ui/txs/TxsValidated.tsx
+4
-1
No files found.
ui/txs/Pagination.tsx
0 → 100644
View file @
74067a0d
import
{
ChevronLeftIcon
,
ChevronRightIcon
}
from
'
@chakra-ui/icons
'
;
import
{
Button
,
Flex
,
Input
,
IconButton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
type
Props
=
{
currentPage
:
number
;
maxPage
?:
number
;
isMobile
?:
boolean
;
}
const
MAX_PAGE_DEFAULT
=
50
;
const
Pagination
=
({
currentPage
,
maxPage
,
isMobile
}:
Props
)
=>
{
return
(
<
Flex
fontSize=
"sm"
width=
{
isMobile
?
'
100%
'
:
'
434px
'
}
justifyContent=
"space-between"
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
flexGrow=
{
1
}
>
<
IconButton
variant=
"outline"
size=
"sm"
aria
-
label=
"Next page"
w=
"36px"
icon=
{
<
ChevronLeftIcon
w=
{
5
}
h=
{
5
}
/>
}
/>
<
Flex
alignItems=
"center"
>
<
Button
variant=
"outline"
colorScheme=
"gray"
size=
"sm"
isActive
borderWidth=
"1px"
fontWeight=
{
400
}
mr=
{
3
}
h=
{
8
}
>
{
currentPage
}
</
Button
>
of
<
Button
variant=
"outline"
colorScheme=
"gray"
size=
"sm"
width=
{
8
}
borderWidth=
"1px"
fontWeight=
{
400
}
ml=
{
3
}
>
{
maxPage
||
MAX_PAGE_DEFAULT
}
</
Button
>
</
Flex
>
<
IconButton
variant=
"outline"
size=
"sm"
aria
-
label=
"Next page"
w=
"36px"
icon=
{
<
ChevronRightIcon
w=
{
5
}
h=
{
5
}
/>
}
/>
</
Flex
>
{
!
isMobile
&&
(
<
Flex
alignItems=
"center"
width=
"132px"
ml=
{
16
}
>
Go to
<
Input
w=
"84px"
h=
"32px"
size=
"sm"
ml=
{
2
}
/>
</
Flex
>
)
}
</
Flex
>
);
};
export
default
Pagination
;
ui/txs/TxsListItem.tsx
View file @
74067a0d
...
@@ -4,14 +4,9 @@ import {
...
@@ -4,14 +4,9 @@ import {
Flex
,
Flex
,
Icon
,
Icon
,
Link
,
Link
,
Drawer
,
Modal
,
DrawerBody
,
ModalContent
,
DrawerContent
,
ModalCloseButton
,
DrawerCloseButton
,
DrawerOverlay
,
// Modal,
// ModalContent,
// ModalCloseButton,
Text
,
Text
,
Tooltip
,
Tooltip
,
useColorModeValue
,
useColorModeValue
,
...
@@ -124,23 +119,12 @@ const TxsListItem = ({ tx }: {tx: any}) => {
...
@@ -124,23 +119,12 @@ const TxsListItem = ({ tx }: {tx: any}) => {
<
Text
as=
"span"
color=
{
secondaryTextColor
}
>
{
tx
.
fee
.
value
.
toFixed
(
8
)
}
</
Text
>
<
Text
as=
"span"
color=
{
secondaryTextColor
}
>
{
tx
.
fee
.
value
.
toFixed
(
8
)
}
</
Text
>
</
Box
>
</
Box
>
</
Box
>
</
Box
>
{
/*
<Modal isOpen={ isOpen } onClose={ onClose } size="full">
<
Modal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
size=
"full"
>
<
ModalContent
paddingTop=
{
4
}
>
<
ModalContent
paddingTop=
{
4
}
>
<
ModalCloseButton
/>
<
ModalCloseButton
/>
<
TxAdditionalInfo
tx=
{
tx
}
/>
<
TxAdditionalInfo
tx=
{
tx
}
/>
</
ModalContent
>
</
ModalContent
>
</Modal> */
}
</
Modal
>
<
Drawer
isOpen=
{
isOpen
}
placement=
"bottom"
onClose=
{
onClose
}
>
<
DrawerOverlay
/>
<
DrawerContent
>
<
DrawerCloseButton
/>
<
DrawerBody
p=
{
6
}
>
<
TxAdditionalInfo
tx=
{
tx
}
/></
DrawerBody
>
</
DrawerContent
>
</
Drawer
>
</>
</>
);
);
};
};
...
...
ui/txs/TxsValidated.tsx
View file @
74067a0d
...
@@ -4,6 +4,7 @@ import React from 'react';
...
@@ -4,6 +4,7 @@ import React from 'react';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
Filters
from
'
ui/shared/Filters
'
;
import
Filters
from
'
ui/shared/Filters
'
;
import
Pagination
from
'
./Pagination
'
;
import
TxsList
from
'
./TxsList
'
;
import
TxsList
from
'
./TxsList
'
;
import
TxsTable
from
'
./TxsTable
'
;
import
TxsTable
from
'
./TxsTable
'
;
...
@@ -14,7 +15,9 @@ const TxsValidated = () => {
...
@@ -14,7 +15,9 @@ const TxsValidated = () => {
<
Box
mb=
{
12
}
>
Only the first 10,000 elements are displayed
</
Box
>
<
Box
mb=
{
12
}
>
Only the first 10,000 elements are displayed
</
Box
>
<
Box
mb=
{
6
}
><
Filters
/></
Box
>
<
Box
mb=
{
6
}
><
Filters
/></
Box
>
{
isMobile
?
<
TxsList
/>
:
<
TxsTable
/>
}
{
isMobile
?
<
TxsList
/>
:
<
TxsTable
/>
}
{
/* pagination */
}
<
Box
mx=
{
isMobile
?
0
:
6
}
my=
{
isMobile
?
6
:
3
}
>
<
Pagination
currentPage=
{
1
}
isMobile=
{
isMobile
}
/>
</
Box
>
</>
</>
);
);
};
};
...
...
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