refactor: 페이징 표시 정리

main
minuk926 3 years ago
parent ae4fabf4dd
commit 62d7b80125

@ -12,6 +12,7 @@ const CustomPagination = ({ totalCount, pageSize }) => {
return ( return (
<Grid sx={{ padding: '10px', display: 'flex', justifyContent: 'center' }}> <Grid sx={{ padding: '10px', display: 'flex', justifyContent: 'center' }}>
{pageCount > 1 && (
<Pagination <Pagination
// sx={(theme) => ({ padding: theme.spacing(1.5, 0) })} // sx={(theme) => ({ padding: theme.spacing(1.5, 0) })}
color="primary" color="primary"
@ -29,6 +30,8 @@ const CustomPagination = ({ totalCount, pageSize }) => {
apiRef.current.setPage(value - 1); apiRef.current.setPage(value - 1);
}} }}
/> />
)}
{pageCount > 1 && (
<FiberManualRecordIcon <FiberManualRecordIcon
fontSize="small" fontSize="small"
sx={{ sx={{
@ -37,8 +40,11 @@ const CustomPagination = ({ totalCount, pageSize }) => {
color: '#4caf50' color: '#4caf50'
}} }}
/> />
<Typography variant="h5" color="inherit"> )}
{page * pageSize + 1} / {totalCount} <Typography variant="span" color="inherit">
{/* 전체 {totalCount} 건 현재페이지 {pageCount > 1 ? `${page * pageSize + 1} / ${totalCount} 건` : `${totalCount}`} */}
{totalCount > 0 ? `전체 ${totalCount}` : ``}
{pageCount > 1 ? `[ ${page + 1} / ${pageCount} ]` : ``}
</Typography> </Typography>
</Grid> </Grid>
); );

Loading…
Cancel
Save