From 62d7b80125d087f8d1e118877ec8a40ecb6472bf Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 1 Apr 2022 12:33:08 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=8E=98=EC=9D=B4=EC=A7=95=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/form/CustomPagination.js | 60 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/views/form/CustomPagination.js b/src/views/form/CustomPagination.js index a741bf4..9554e3c 100644 --- a/src/views/form/CustomPagination.js +++ b/src/views/form/CustomPagination.js @@ -12,33 +12,39 @@ const CustomPagination = ({ totalCount, pageSize }) => { return ( - ({ padding: theme.spacing(1.5, 0) })} - color="primary" - variant="outlined" - shape="rounded" - size="small" - showFirstButton - showLastButton - count={pageCount} - page={page + 1} - boundaryCount={5} - siblingCount={2} - pagesize={10} - onChange={(event, value) => { - apiRef.current.setPage(value - 1); - }} - /> - - - {page * pageSize + 1} / {totalCount} + {pageCount > 1 && ( + ({ padding: theme.spacing(1.5, 0) })} + color="primary" + variant="outlined" + shape="rounded" + size="small" + showFirstButton + showLastButton + count={pageCount} + page={page + 1} + boundaryCount={5} + siblingCount={2} + pagesize={10} + onChange={(event, value) => { + apiRef.current.setPage(value - 1); + }} + /> + )} + {pageCount > 1 && ( + + )} + + {/* 전체 {totalCount} 건 현재페이지 {pageCount > 1 ? `${page * pageSize + 1} / ${totalCount} 건` : `${totalCount}`} */} + {totalCount > 0 ? `전체 ${totalCount} 건 ` : ``} + {pageCount > 1 ? `[ ${page + 1} / ${pageCount} ]` : ``} );