From 7fa9b3cdd2c93d28d2d3a4e42db39c305674e38e Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Mon, 19 Aug 2024 22:32:02 -0500 Subject: [PATCH] rearrange state declarations for pages totalPages shouldn't need to be in state, since this component won't be changing it. renamed pageNumberInput to just pageInput. Was just something that happened in the course of working on it. currentPage doesn't need to have it's own state separate from pageInput, they should always be the same *value*. --- client/homebrew/brewRenderer/toolBar/toolBar.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.jsx b/client/homebrew/brewRenderer/toolBar/toolBar.jsx index bd5445f8b..8c2d7464c 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.jsx +++ b/client/homebrew/brewRenderer/toolBar/toolBar.jsx @@ -7,13 +7,9 @@ const MAX_ZOOM = 300; const MIN_ZOOM = 10; const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{ - const [state, setState] = useState({ - currentPage : currentPage, - totalPages : totalPages, - pageNumberInput : currentPage, - }); const [zoomLevel, setZoomLevel] = useState(100); + const [pageInput, setPageInput] = useState(currentPage); useEffect(()=>{ onZoomChange(zoomLevel);