Enabled 'dense' mode for Table cells.
Hardcoded cell styling for Table was removed to enable 'dense' as a cell padding choice. Padding customisation for inherited smallSize was added. Dense mode was chosen for sentry issues table rows.
This commit is contained in:
@@ -35,7 +35,6 @@ import ViewColumn from '@material-ui/icons/ViewColumn';
|
||||
import MTable, {
|
||||
Column,
|
||||
MaterialTableProps,
|
||||
MTableCell,
|
||||
MTableHeader,
|
||||
MTableToolbar,
|
||||
Options,
|
||||
@@ -96,14 +95,6 @@ const tableIcons = {
|
||||
)),
|
||||
};
|
||||
|
||||
const useCellStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
root: {
|
||||
color: theme.palette.grey[500],
|
||||
padding: theme.spacing(0, 2, 0, 2.5),
|
||||
height: '56px',
|
||||
},
|
||||
}));
|
||||
|
||||
const useHeaderStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
header: {
|
||||
padding: theme.spacing(1, 2, 1, 2.5),
|
||||
@@ -169,7 +160,6 @@ export function Table<T extends object = {}>({
|
||||
subtitle,
|
||||
...props
|
||||
}: TableProps<T>) {
|
||||
const cellClasses = useCellStyles();
|
||||
const headerClasses = useHeaderStyles();
|
||||
const toolbarClasses = useToolbarStyles();
|
||||
const theme = useTheme<BackstageTheme>();
|
||||
@@ -185,9 +175,6 @@ export function Table<T extends object = {}>({
|
||||
return (
|
||||
<MTable<T>
|
||||
components={{
|
||||
Cell: cellProps => (
|
||||
<MTableCell className={cellClasses.root} {...cellProps} />
|
||||
),
|
||||
Header: headerProps => (
|
||||
<MTableHeader classes={headerClasses} {...headerProps} />
|
||||
),
|
||||
|
||||
@@ -118,9 +118,12 @@ export function createThemeOverrides(theme: BackstageTheme): Overrides {
|
||||
verticalAlign: 'middle',
|
||||
lineHeight: '1',
|
||||
margin: 0,
|
||||
padding: '8px',
|
||||
padding: theme.spacing(3, 2, 3, 2.5),
|
||||
borderBottom: 0,
|
||||
},
|
||||
sizeSmall: {
|
||||
padding: theme.spacing(1, 2, 1, 2.5),
|
||||
},
|
||||
head: {
|
||||
wordBreak: 'break-word',
|
||||
overflow: 'hidden',
|
||||
|
||||
@@ -64,7 +64,7 @@ const SentryIssuesTable: FC<SentryIssuesTableProps> = ({ sentryIssues }) => {
|
||||
return (
|
||||
<Table
|
||||
columns={columns}
|
||||
options={{ paging: true, search: false, pageSize: 5 }}
|
||||
options={{ padding: 'dense', paging: true, search: false, pageSize: 5 }}
|
||||
title="Sentry issues"
|
||||
data={sentryIssues}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user