Skip to content

Commit

Permalink
update styled args and pass styleProps to each slot
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed May 21, 2021
1 parent 778b370 commit 51c922e
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions packages/material-ui-lab/src/CalendarPicker/CalendarPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,20 @@ const useUtilityClasses = (
return composeClasses(slots, getCalendarPickerUtilityClass, classes);
};

const CalendarPickerRoot = styled(
PickerView,
{},
{ name: 'MuiCalendarPicker', slot: 'Root', overridesResolver: (props, styles) => styles.root },
)({
const CalendarPickerRoot = styled(PickerView, {
name: 'MuiCalendarPicker',
slot: 'Root',
overridesResolver: (props, styles) => styles.root,
})({
display: 'flex',
flexDirection: 'column',
});

const CalendarPickerViewTransitionContainer = styled(
FadeTransitionGroup,
{},
{
name: 'MuiCalendarPicker',
slot: 'ViewTransitionContainer',
overridesResolver: (props, styles) => styles.viewTransitionContainer,
},
)({
const CalendarPickerViewTransitionContainer = styled(FadeTransitionGroup, {
name: 'MuiCalendarPicker',
slot: 'ViewTransitionContainer',
overridesResolver: (props, styles) => styles.viewTransitionContainer,
})({
overflowY: 'auto',
});

Expand Down Expand Up @@ -259,7 +255,7 @@ const CalendarPicker = React.forwardRef(function CalendarPicker<TDate extends an
const classes = useUtilityClasses(styleProps);

return (
<CalendarPickerRoot ref={ref} className={clsx(classes.root, className)}>
<CalendarPickerRoot ref={ref} className={clsx(classes.root, className)} styleProps={styleProps}>
<PickersCalendarHeader
{...other}
views={views}
Expand All @@ -277,6 +273,7 @@ const CalendarPicker = React.forwardRef(function CalendarPicker<TDate extends an
reduceAnimations={reduceAnimations}
className={classes.viewTransitionContainer}
transKey={openView}
styleProps={styleProps}
>
<div>
{openView === 'year' && (
Expand Down

0 comments on commit 51c922e

Please sign in to comment.