Skip to content

Commit

Permalink
Fix defaultProps of MuiDataGrid in createCometTheme() (#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesricky authored Jan 3, 2025
1 parent 8114a6a commit 9f2a127
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-beers-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/admin-theme": patch
---

Fix an issue where setting `defaultProps` of `MuiDataGrid` would override the `defaultProps` defined by `createCometTheme()`
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { GetMuiComponentTheme } from "./getComponentsTheme";
export const getMuiDataGrid: GetMuiComponentTheme<"MuiDataGrid"> = (component, { palette, shadows, spacing }) => ({
...component,
defaultProps: {
...component?.defaultProps,
components: {
/* @TODO: add FilterPanelAddIcon to display Comet Add Icon once MUI Datagrid is updated to v6 or higher */
QuickFilterIcon: Search,
Expand All @@ -39,8 +40,8 @@ export const getMuiDataGrid: GetMuiComponentTheme<"MuiDataGrid"> = (component, {
},
localeText: {
noRowsLabel: GRID_DEFAULT_LOCALE_TEXT.noResultsOverlayLabel,
...component?.defaultProps?.localeText,
},
...component?.defaultProps,
},
styleOverrides: mergeOverrideStyles<"MuiDataGrid">(component?.styleOverrides, {
root: {
Expand Down

0 comments on commit 9f2a127

Please sign in to comment.