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
7072bfd2
Commit
7072bfd2
authored
Oct 21, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide filters
parent
2cedd588
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
TxsContent.tsx
ui/txs/TxsContent.tsx
+11
-9
TxsFilters.tsx
ui/txs/TxsFilters.tsx
+5
-0
No files found.
ui/txs/TxsContent.tsx
View file @
7072bfd2
...
...
@@ -6,11 +6,11 @@ import type { Sort } from 'types/client/txs-sort';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
FilterInput
from
'
ui/shared/FilterInput
'
;
//
import FilterInput from 'ui/shared/FilterInput';
import
Pagination
from
'
ui/shared/Pagination
'
;
import
SortButton
from
'
ui/shared/SortButton
'
;
import
TxsFilters
from
'
./TxsFilters
'
;
//
import TxsFilters from './TxsFilters';
import
TxsSkeletonDesktop
from
'
./TxsSkeletonDesktop
'
;
import
TxsSkeletonMobile
from
'
./TxsSkeletonMobile
'
;
import
TxsWithSort
from
'
./TxsWithSort
'
;
...
...
@@ -26,7 +26,7 @@ const TxsContent = ({
stateFilter
,
}:
Props
)
=>
{
const
[
sorting
,
setSorting
]
=
useState
<
Sort
>
();
const
[
filters
,
setFilters
]
=
useState
<
Partial
<
TTxsFilters
>>
({
type
:
[],
method
:
[]
});
//
const [ filters, setFilters ] = useState<Partial<TTxsFilters>>({ type: [], method: [] });
const
sort
=
useCallback
((
field
:
'
val
'
|
'
fee
'
)
=>
()
=>
{
if
(
field
===
'
val
'
)
{
...
...
@@ -62,7 +62,8 @@ const TxsContent = ({
onNextPageClick
,
hasPagination
,
resetPage
,
}
=
useQueryWithPages
({
...
filters
,
filter
:
stateFilter
});
}
=
useQueryWithPages
({
filter
:
stateFilter
});
// } = useQueryWithPages({ ...filters, filter: stateFilter });
const
isMobile
=
useIsMobile
(
false
);
...
...
@@ -91,12 +92,12 @@ const TxsContent = ({
<>
{
showDescription
&&
<
Box
mb=
{
12
}
>
Only the first 10,000 elements are displayed
</
Box
>
}
<
HStack
mb=
{
6
}
>
{
/*
TODO
*/
}
<
TxsFilters
{
/*
api is not implemented
*/
}
{
/*
<TxsFilters
filters={ filters }
onFiltersChange={ setFilters }
appliedFiltersNum={ 0 }
/>
/>
*/
}
{
isMobile
&&
(
<
SortButton
// eslint-disable-next-line react/jsx-no-bind
...
...
@@ -105,13 +106,14 @@ const TxsContent = ({
display=
{
{
base
:
'
block
'
,
lg
:
'
none
'
}
}
/>
)
}
<
FilterInput
{
/* api is not implemented */
}
{
/* <FilterInput
// eslint-disable-next-line react/jsx-no-bind
onChange={ () => {} }
maxW="360px"
size="xs"
placeholder="Search by addresses, hash, method..."
/>
/>
*/
}
</
HStack
>
{
content
}
<
Box
mx=
{
{
base
:
0
,
lg
:
6
}
}
my=
{
{
base
:
6
,
lg
:
3
}
}
>
...
...
ui/txs/TxsFilters.tsx
View file @
7072bfd2
...
...
@@ -41,6 +41,11 @@ const METHOD_OPTIONS = [
{
title
:
'
Commit
'
,
id
:
'
commit
'
},
];
// TODO: i think we need to reload page after applying filters,
// because we need to reset pagination, clear query caches, reconnect websocket...
// also mobile version of filters is not implemented
const
TxsFilters
=
({
onFiltersChange
,
filters
,
appliedFiltersNum
}:
Props
)
=>
{
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
...
...
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