From 5cf71760ad0ecd132938ce8c026b8e3e6b4755b1 Mon Sep 17 00:00:00 2001 From: Baris G Date: Thu, 9 Nov 2023 15:05:14 +0100 Subject: [PATCH] ONGLET VRAIMENT FINI --- frontend/src/components/OngletElixir.jsx | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/OngletElixir.jsx b/frontend/src/components/OngletElixir.jsx index 2452536..0bb669b 100644 --- a/frontend/src/components/OngletElixir.jsx +++ b/frontend/src/components/OngletElixir.jsx @@ -29,6 +29,7 @@ function OngletElixir() { setDifficulty(value); setSearchValue(""); setSearchActive(!isActive); + setPageActuel(0); } useEffect(() => { @@ -66,14 +67,14 @@ function OngletElixir() { } function handlePageNext(slice) { - if (!(slice + 32 > 156)) { - setPageActuel(pageActuel + 32); + if (!(slice + 36 > 156)) { + setPageActuel(pageActuel + 36); } } function handlePagePrevious(slice) { - if (!(slice - 32 < 0)) { - setPageActuel(pageActuel - 32); + if (!(slice - 36 < 0)) { + setPageActuel(pageActuel - 36); } } @@ -95,6 +96,8 @@ function OngletElixir() { onChange={(event) => { setSearchValue(event.target.value.toLowerCase()); setSearchActive(!!event.target.value); + setPageActuel(0); + setDifficulty(null); }} className="rounded-xl shadow-xl input-searchbar transition p-1 border-4 border-white" /> @@ -102,28 +105,36 @@ function OngletElixir() {