From 6ecaddbf87b2f192b59ea1c69d85bd990be5910b Mon Sep 17 00:00:00 2001 From: Imen Chermiti Date: Thu, 26 Oct 2023 14:27:13 +0200 Subject: [PATCH] feat: new design fixes --- .../EstablishmentTable/EstablishmentTable.jsx | 1 + .../PaginationTable/PaginationTable.jsx | 44 ++++++++++++------- .../SearchAwesomeTable/SearchAwesomeTable.js | 8 ++-- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/client/src/components/DataSheets/Sections/SharedComponents/EstablishmentTable/EstablishmentTable.jsx b/src/client/src/components/DataSheets/Sections/SharedComponents/EstablishmentTable/EstablishmentTable.jsx index fdacbf11..e283ed8f 100644 --- a/src/client/src/components/DataSheets/Sections/SharedComponents/EstablishmentTable/EstablishmentTable.jsx +++ b/src/client/src/components/DataSheets/Sections/SharedComponents/EstablishmentTable/EstablishmentTable.jsx @@ -138,6 +138,7 @@ const EstablishmentTable = ({ etablissements, entreprise }) => { currentPage={currentPage} totalPages={totalPages} handlePageClick={handlePageClick} + displayButtons /> )}{" "} diff --git a/src/client/src/components/DataSheets/Sections/SharedComponents/PaginationTable/PaginationTable.jsx b/src/client/src/components/DataSheets/Sections/SharedComponents/PaginationTable/PaginationTable.jsx index 16d8b2ac..aadefb27 100644 --- a/src/client/src/components/DataSheets/Sections/SharedComponents/PaginationTable/PaginationTable.jsx +++ b/src/client/src/components/DataSheets/Sections/SharedComponents/PaginationTable/PaginationTable.jsx @@ -4,7 +4,12 @@ import React from "react"; import LeftArrow from "../../../../shared/Icons/LeftArrow.jsx"; import RightArrow from "../../../../shared/Icons/RightArrow.jsx"; -const PaginationTable = ({ currentPage, totalPages, handlePageClick }) => { +const PaginationTable = ({ + currentPage, + displayButtons = false, + totalPages, + handlePageClick, +}) => { const renderPaginationButtons = () => { const buttons = []; const firstPage = 1; @@ -59,28 +64,33 @@ const PaginationTable = ({ currentPage, totalPages, handlePageClick }) => { }; return (
- + {displayButtons && ( + + )} {renderPaginationButtons()} - + {displayButtons && ( + + )}
); }; PaginationTable.propTypes = { currentPage: PropTypes.number.isRequired, + displayButtons: PropTypes.bool, handlePageClick: PropTypes.func.isRequired, totalPages: PropTypes.string.isRequired, }; diff --git a/src/client/src/components/SearchAwesomeTable/SearchAwesomeTable.js b/src/client/src/components/SearchAwesomeTable/SearchAwesomeTable.js index 58c62995..45f96032 100644 --- a/src/client/src/components/SearchAwesomeTable/SearchAwesomeTable.js +++ b/src/client/src/components/SearchAwesomeTable/SearchAwesomeTable.js @@ -5,10 +5,10 @@ import PropTypes from "prop-types"; import React from "react"; import { withRouter } from "react-router"; +import PaginationTable from "../DataSheets/Sections/SharedComponents/PaginationTable/PaginationTable.jsx"; import LeftArrow from "../shared/Icons/LeftArrow.jsx"; import RightArrow from "../shared/Icons/RightArrow.jsx"; import LoadSpinner from "../shared/LoadSpinner"; -import Pager from "./Pager"; const SearchAwesomeTable = ({ showPagination = false, @@ -83,10 +83,10 @@ const SearchAwesomeTable = ({ {prevText} -