mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
Merge branch 'feat/new-catalogue' of github.com:hydralauncher/hydra into feat/new-catalogue
This commit is contained in:
commit
cbfe831e0c
@ -1,11 +1,13 @@
|
|||||||
@use "../../scss/globals.scss";
|
@use "../../scss/globals.scss";
|
||||||
|
|
||||||
.catalogue {
|
.catalogue {
|
||||||
|
overflow-y: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: calc(globals.$spacing-unit * 2);
|
gap: calc(globals.$spacing-unit * 2);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
|
||||||
&__filters-container {
|
&__filters-container {
|
||||||
width: 270px;
|
width: 270px;
|
||||||
|
@ -33,6 +33,7 @@ const PAGE_SIZE = 20;
|
|||||||
|
|
||||||
export default function Catalogue() {
|
export default function Catalogue() {
|
||||||
const abortControllerRef = useRef<AbortController | null>(null);
|
const abortControllerRef = useRef<AbortController | null>(null);
|
||||||
|
const cataloguePageRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const { steamDevelopers, steamPublishers } = useCatalogue();
|
const { steamDevelopers, steamPublishers } = useCatalogue();
|
||||||
|
|
||||||
@ -217,7 +218,7 @@ export default function Catalogue() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="catalogue">
|
<div className="catalogue" ref={cataloguePageRef}>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@ -310,7 +311,12 @@ export default function Catalogue() {
|
|||||||
<Pagination
|
<Pagination
|
||||||
page={page}
|
page={page}
|
||||||
totalPages={Math.ceil(itemsCount / PAGE_SIZE)}
|
totalPages={Math.ceil(itemsCount / PAGE_SIZE)}
|
||||||
onPageChange={(page) => dispatch(setPage(page))}
|
onPageChange={(page) => {
|
||||||
|
dispatch(setPage(page));
|
||||||
|
if (cataloguePageRef.current) {
|
||||||
|
cataloguePageRef.current.scrollTop = 0;
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user