Skip to content

Commit

Permalink
[docs] Fix customized day rendering demo style (#6342) (#6399)
Browse files Browse the repository at this point in the history
Co-authored-by: Ambrish-git <51455372+Ambrish-git@users.noreply.github.com>
  • Loading branch information
LukasTy and Ambrish-git committed Oct 6, 2022
1 parent 1911757 commit cf0e14a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
Expand Up @@ -8,15 +8,22 @@ import { StaticDateRangePicker } from '@mui/x-date-pickers-pro/StaticDateRangePi
import { DateRangePickerDay as MuiDateRangePickerDay } from '@mui/x-date-pickers-pro/DateRangePickerDay';

const DateRangePickerDay = styled(MuiDateRangePickerDay)(
({ theme, isHighlighting, isStartOfHighlighting, isEndOfHighlighting }) => ({
...(isHighlighting && {
borderRadius: 0,
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
'&:hover, &:focus': {
backgroundColor: theme.palette.primary.dark,
},
}),
({
theme,
isHighlighting,
isStartOfHighlighting,
isEndOfHighlighting,
outsideCurrentMonth,
}) => ({
...(!outsideCurrentMonth &&
isHighlighting && {
borderRadius: 0,
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
'&:hover, &:focus': {
backgroundColor: theme.palette.primary.dark,
},
}),
...(isStartOfHighlighting && {
borderTopLeftRadius: '50%',
borderBottomLeftRadius: '50%',
Expand Down
Expand Up @@ -13,15 +13,22 @@ import { DateRange } from '@mui/x-date-pickers-pro/DateRangePicker';
import { Dayjs } from 'dayjs';

const DateRangePickerDay = styled(MuiDateRangePickerDay)(
({ theme, isHighlighting, isStartOfHighlighting, isEndOfHighlighting }) => ({
...(isHighlighting && {
borderRadius: 0,
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
'&:hover, &:focus': {
backgroundColor: theme.palette.primary.dark,
},
}),
({
theme,
isHighlighting,
isStartOfHighlighting,
isEndOfHighlighting,
outsideCurrentMonth,
}) => ({
...(!outsideCurrentMonth &&
isHighlighting && {
borderRadius: 0,
backgroundColor: theme.palette.primary.main,
color: theme.palette.common.white,
'&:hover, &:focus': {
backgroundColor: theme.palette.primary.dark,
},
}),
...(isStartOfHighlighting && {
borderTopLeftRadius: '50%',
borderBottomLeftRadius: '50%',
Expand Down

0 comments on commit cf0e14a

Please sign in to comment.