Skip to content

Commit

Permalink
fix(react-grid-material-ui): fix styled components' styles that use t…
Browse files Browse the repository at this point in the history
…heme.spacing with a negative sign (#3660)
  • Loading branch information
Madobyte committed Jul 27, 2023
1 parent 23fc6f3 commit 6f6588a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Expand Up @@ -13,13 +13,18 @@ const StyledCheckboxMUI = styled(CheckboxMUI)(({ theme }) => ({
marginTop: '-1px',
marginBottom: '-1px',
marginRight: theme.spacing(2),
marginLeft: -theme.spacing(2),
marginLeft: `-${theme.spacing(2)}`,
padding: theme.spacing(1),
},
}));

export const TableTreeCheckbox = ({
disabled, checked, indeterminate, onChange, className, ...restProps
disabled,
checked,
indeterminate,
onChange,
className,
...restProps
}) => (
<StyledCheckboxMUI
className={classNames(classes.checkbox, className)}
Expand Down
Expand Up @@ -16,7 +16,7 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({
[`&.${classes.button}`]: {
marginTop: '-1px',
marginBottom: '-1px',
marginLeft: -theme.spacing(1),
marginLeft: `-${theme.spacing(1)}`,
marginRight: theme.spacing(2),
padding: theme.spacing(1),
},
Expand All @@ -27,15 +27,20 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({
}));

export const TableTreeExpandButton = ({
visible, expanded, onToggle,
visible,
expanded,
onToggle,
className,
...restProps
}) => (
<StyledIconButton
className={classNames({
[classes.button]: true,
[classes.hidden]: !visible,
}, className)}
className={classNames(
{
[classes.button]: true,
[classes.hidden]: !visible,
},
className,
)}
onClick={(e) => {
if (!visible) return;
e.stopPropagation();
Expand All @@ -44,9 +49,7 @@ export const TableTreeExpandButton = ({
tabIndex={visible ? 0 : -1}
{...restProps}
>
{expanded
? <ExpandMore />
: <ChevronRight />}
{expanded ? <ExpandMore /> : <ChevronRight />}
</StyledIconButton>
);

Expand Down

0 comments on commit 6f6588a

Please sign in to comment.