From 2b223a1a0a2366b2e08a741ae28c9f1fb7d98a32 Mon Sep 17 00:00:00 2001 From: Nitesh Sinha Date: Wed, 17 Mar 2021 19:48:27 +0530 Subject: [PATCH] minor improvements --- src/pages/Editor/containers/editContext.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/pages/Editor/containers/editContext.js b/src/pages/Editor/containers/editContext.js index 247a7e62..bd29be4b 100644 --- a/src/pages/Editor/containers/editContext.js +++ b/src/pages/Editor/containers/editContext.js @@ -64,17 +64,12 @@ const EditContextProvider = (props) => { setPages(pagesCopy); }; - const nextPage = () => { - if (currentPage < pages.length - 1) { - setCurrentPage((currentPage) => currentPage + 1); - } - }; + const nextPage = () => + currentPage < pages.length - 1 && + setCurrentPage((currentPage) => currentPage + 1); - const prevPage = () => { - if (currentPage > 0) { - setCurrentPage((currentPage) => currentPage - 1); - } - }; + const prevPage = () => + currentPage > 0 && setCurrentPage((currentPage) => currentPage - 1); const [headValues,] = useState({ headSize: null,