From e342dbfc347aa72fe3f90b9f26452b27e0dab2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Sat, 12 Sep 2026 01:14:58 -0300 Subject: [PATCH] fix: apply mui table styling on confirm delete dialog for other tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/components/mui/tables/editable-table/index.js | 8 +++++--- .../mui/tables/sortable-table-v2/mui-table-sortable-v2.js | 5 +++-- src/components/mui/tables/sortable-table/index.js | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/mui/tables/editable-table/index.js b/src/components/mui/tables/editable-table/index.js index afcd2f8a..ed9cf98f 100644 --- a/src/components/mui/tables/editable-table/index.js +++ b/src/components/mui/tables/editable-table/index.js @@ -154,7 +154,8 @@ const MuiTableEditable = ({ onDelete, onCellChange, // New prop for handling cell value changes deleteDialogBody, - tableSx = {} + tableSx = {}, + confirmButtonColor = null }) => { // State to track which cell is currently being edited const [editingCell, setEditingCell] = React.useState(null); @@ -170,7 +171,7 @@ const MuiTableEditable = ({ onDelete, getName, deleteDialogBody, - confirmButtonColor: "warning" + confirmButtonColor: confirmButtonColor || "error" }); const isEditable = (col, row) => @@ -384,7 +385,8 @@ MuiTableEditable.propTypes = { onArchive: PropTypes.func, onDelete: PropTypes.func, onCellChange: PropTypes.func, - deleteDialogBody: PropTypes.func + deleteDialogBody: PropTypes.func, + confirmButtonColor: PropTypes.string }; export default MuiTableEditable; diff --git a/src/components/mui/tables/sortable-table-v2/mui-table-sortable-v2.js b/src/components/mui/tables/sortable-table-v2/mui-table-sortable-v2.js index 6de3d793..6fce8512 100644 --- a/src/components/mui/tables/sortable-table-v2/mui-table-sortable-v2.js +++ b/src/components/mui/tables/sortable-table-v2/mui-table-sortable-v2.js @@ -60,7 +60,8 @@ const MuiTableSortableV2 = ({ deleteDialogBody = null, onReorder, idKey = "id", - updateOrderKey = "order" + updateOrderKey = "order", + confirmButtonColor = null }) => { const { sortCol, sortDir } = options; @@ -98,7 +99,7 @@ const MuiTableSortableV2 = ({ `${T.translate("general.row_remove_warning")} ${getName(item)}`, iconType: "warning", showCancelButton: true, - confirmButtonColor: "#DD6B55", + confirmButtonColor: confirmButtonColor || "error", confirmButtonText: T.translate("general.yes_delete") }); diff --git a/src/components/mui/tables/sortable-table/index.js b/src/components/mui/tables/sortable-table/index.js index 4f384131..871217f8 100644 --- a/src/components/mui/tables/sortable-table/index.js +++ b/src/components/mui/tables/sortable-table/index.js @@ -55,7 +55,8 @@ const MuiTableSortable = ({ onReorder, idKey = "id", updateOrderKey = "order", - tableSx = {} + tableSx = {}, + confirmButtonColor = null }) => { const { sortCol, sortDir } = options; @@ -86,7 +87,7 @@ const MuiTableSortable = ({ getId: (item) => item[idKey || "id"], deleteDialogTitle, deleteDialogBody, - confirmButtonColor: "#DD6B55" + confirmButtonColor: confirmButtonColor || "error" }); return (