Tommy\2Fi-Staff 1 день тому
джерело
коміт
cc14a5e100
2 змінених файлів з 2 додано та 7 видалено
  1. +1
    -6
      src/components/SearchResults/SearchResults.tsx
  2. +1
    -1
      src/components/Shop/Shop.tsx

+ 1
- 6
src/components/SearchResults/SearchResults.tsx Переглянути файл

@@ -6,7 +6,6 @@ import React, {
MouseEvent,
SetStateAction,
useCallback,
useEffect,
useMemo,
useState,
} from "react";
@@ -202,11 +201,7 @@ function SearchResults<T extends ResultWithId>({
const { t } = useTranslation();
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);

useEffect(() => {
setPage(0);
}, [items]);

/// this
const handleChangePage: TablePaginationProps["onPageChange"] = (
_event,


+ 1
- 1
src/components/Shop/Shop.tsx Переглянути файл

@@ -205,7 +205,7 @@ const Shop: React.FC = () => {
// SearchBox onSearch will call this
const handleSearch = (inputs: Record<string, string>) => {
setFilters(inputs);
setPagingController((prev) => ({ ...prev, pageNum: 1 }));
setPagingController({ ...pagingController, pageNum: 1 });
const params: Record<string, string> = {};
Object.entries(inputs || {}).forEach(([k, v]) => {
if (v != null && String(v).trim() !== "") params[k] = String(v).trim();


Завантаження…
Відмінити
Зберегти