generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #954 from amitamrutiya/custom-theme
feat: update theme for mui datatable
- Loading branch information
Showing
4 changed files
with
118 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { Components, Theme } from '@mui/material/styles'; | ||
|
||
const MuiTable: Components<Theme>['MuiTable'] = { | ||
styleOverrides: { | ||
root: { | ||
borderCollapse: 'separate', | ||
borderSpacing: '0' | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableBody: Components<Theme>['MuiTableBody'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { backgroundColor: theme.palette.background.constant?.table }; | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableCell: Components<Theme>['MuiTableCell'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { borderBottom: `1px solid ${theme.palette.icon.disabled}` }; | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableFooter: Components<Theme>['MuiTableFooter'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { | ||
backgroundColor: theme.palette.background.card | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableHead: Components<Theme>['MuiTableHead'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { | ||
backgroundColor: theme.palette.background.card, | ||
fontWeight: 'bold', | ||
textTransform: 'uppercase' | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableRow: Components<Theme>['MuiTableRow'] = { | ||
styleOverrides: { | ||
root: { | ||
'&.Mui-disabled': { | ||
cursor: 'not-allowed' | ||
} | ||
} | ||
} | ||
}; | ||
|
||
const MuiTableSortLabel: Components<Theme>['MuiTableSortLabel'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { | ||
'& .MuiTableSortLabel-icon': { | ||
color: `${theme.palette.icon.default} !important` | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
const MUIDataTableSelectCell: Components<Theme>['MUIDataTableSelectCell'] = { | ||
styleOverrides: { | ||
root: { | ||
backgroundColor: 'transparent' | ||
} | ||
} | ||
}; | ||
|
||
const MuiToolbar: Components<Theme>['MuiToolbar'] = { | ||
styleOverrides: { | ||
root: ({ theme }) => { | ||
return { | ||
backgroundColor: theme.palette.background.card, | ||
color: theme.palette.text.default | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
export const MuiTableCombineTheme = { | ||
MuiTable, | ||
MuiTableBody, | ||
MuiTableCell, | ||
MuiTableFooter, | ||
MuiTableHead, | ||
MuiTableRow, | ||
MuiTableSortLabel, | ||
MUIDataTableSelectCell, | ||
MuiToolbar | ||
}; |