Styled buttons
This commit is contained in:
1 parent
171bc69efd
commit
6042d87a7d
2 files changed
+45
-17
No files matched your search
@@ -125,3 +125,28 @@
|
|||||||
.MuiPaper-root + .MuiPagination-root div.MuiPaginationItem-root {
|
.MuiPaper-root + .MuiPagination-root div.MuiPaginationItem-root {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.MuiTablePagination-root p {
|
||||||
|
color: var(--env-var-color-5);
|
||||||
|
}
|
||||||
|
.MuiTablePagination-root button {
|
||||||
|
min-width: 0;
|
||||||
|
padding: 4px;
|
||||||
|
margin-left: 5px;
|
||||||
|
border-color: #ebebeb;
|
||||||
|
}
|
||||||
|
.MuiTablePagination-root svg {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
.MuiTablePagination-root svg path {
|
||||||
|
stroke: var(--env-var-color-5);
|
||||||
|
stroke-width: 1.3;
|
||||||
|
}
|
||||||
|
.MuiTablePagination-root button.Mui-disabled {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
.MuiTablePagination-root button:not(.Mui-disabled):hover {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
border-color: #f4f4f4;
|
||||||
|
}
|
||||||
@@ -17,10 +17,10 @@ import RightArrowDouble from "../../assets/icons/right-arrow-double.svg?react";
|
|||||||
import LeftArrow from "../../assets/icons/left-arrow.svg?react";
|
import LeftArrow from "../../assets/icons/left-arrow.svg?react";
|
||||||
import RightArrow from "../../assets/icons/right-arrow.svg?react";
|
import RightArrow from "../../assets/icons/right-arrow.svg?react";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
import Button from "../Button";
|
||||||
|
|
||||||
const TablePaginationActions = (props) => {
|
const TablePaginationActions = (props) => {
|
||||||
const { count, page, rowsPerPage, onPageChange } = props;
|
const { count, page, rowsPerPage, onPageChange } = props;
|
||||||
console.log(count);
|
|
||||||
|
|
||||||
const handleFirstPageButtonClick = (event) => {
|
const handleFirstPageButtonClick = (event) => {
|
||||||
onPageChange(event, 0);
|
onPageChange(event, 0);
|
||||||
@@ -37,34 +37,34 @@ const TablePaginationActions = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ flexShrink: 0, ml: 2.5 }}>
|
<Box sx={{ flexShrink: 0, ml: 2.5 }}>
|
||||||
<IconButton
|
<Button
|
||||||
|
level="secondary"
|
||||||
|
img={<LeftArrowDouble />}
|
||||||
onClick={handleFirstPageButtonClick}
|
onClick={handleFirstPageButtonClick}
|
||||||
disabled={page === 0}
|
disabled={page === 0}
|
||||||
aria-label="first page"
|
aria-label="first page"
|
||||||
>
|
/>
|
||||||
<LeftArrowDouble />
|
<Button
|
||||||
</IconButton>
|
level="secondary"
|
||||||
<IconButton
|
img={<LeftArrow />}
|
||||||
onClick={handleBackButtonClick}
|
onClick={handleBackButtonClick}
|
||||||
disabled={page === 0}
|
disabled={page === 0}
|
||||||
aria-label="previous page"
|
aria-label="previous page"
|
||||||
>
|
/>
|
||||||
<LeftArrow />
|
<Button
|
||||||
</IconButton>
|
level="secondary"
|
||||||
<IconButton
|
img={<RightArrow />}
|
||||||
onClick={handleNextButtonClick}
|
onClick={handleNextButtonClick}
|
||||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||||
aria-label="next page"
|
aria-label="next page"
|
||||||
>
|
/>
|
||||||
<RightArrow />
|
<Button
|
||||||
</IconButton>
|
level="secondary"
|
||||||
<IconButton
|
img={<RightArrowDouble />}
|
||||||
onClick={handleLastPageButtonClick}
|
onClick={handleLastPageButtonClick}
|
||||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||||
aria-label="last page"
|
aria-label="last page"
|
||||||
>
|
/>
|
||||||
<RightArrowDouble />
|
|
||||||
</IconButton>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -193,6 +193,9 @@ const BasicTable = ({ data, paginated, type, reversed, rows = 5 }) => {
|
|||||||
rowsPerPageOptions={[5, 10, 15, 25]}
|
rowsPerPageOptions={[5, 10, 15, 25]}
|
||||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||||
ActionsComponent={TablePaginationActions}
|
ActionsComponent={TablePaginationActions}
|
||||||
|
labelDisplayedRows={({ page, count }) =>
|
||||||
|
`Page ${page + 1} of ${Math.max(0, Math.ceil(count / rowsPerPage))}`
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user