Skip to content

Commit

Permalink
Pass through modifiers propType
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 24, 2018
1 parent 0875b1b commit d144670
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/components/CalendarMonth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CalendarDayPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';

import CalendarWeek from './CalendarWeek';
import CalendarDay from './CalendarDay';
import CalendarDay, { propTypes as CalendarDayPropTypes } from './CalendarDay';

import calculateDimension from '../utils/calculateDimension';
import getCalendarMonthWeeks from '../utils/getCalendarMonthWeeks';
Expand All @@ -29,12 +29,12 @@ import {
DAY_SIZE,
} from '../constants';

const propTypes = forbidExtraProps({
export const propTypes = {
...withStylesPropTypes,
month: momentPropTypes.momentObj,
isVisible: PropTypes.bool,
enableOutsideDays: PropTypes.bool,
modifiers: PropTypes.object,
modifiers: PropTypes.objectOf(CalendarDayPropTypes.modifiers),
orientation: ScrollableOrientationShape,
daySize: nonNegativeInteger,
onDayClick: PropTypes.func,
Expand All @@ -57,7 +57,7 @@ const propTypes = forbidExtraProps({
monthFormat: PropTypes.string,
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)),
dayAriaLabelFormat: PropTypes.string,
});
};

const defaultProps = {
month: moment(),
Expand Down Expand Up @@ -234,7 +234,7 @@ class CalendarMonth extends React.Component {
}
}

CalendarMonth.propTypes = propTypes;
CalendarMonth.propTypes = forbidExtraProps(propTypes);
CalendarMonth.defaultProps = defaultProps;

export default withStyles(({ reactDates: { color, font, spacing } }) => ({
Expand Down
10 changes: 5 additions & 5 deletions src/components/CalendarMonthGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { addEventListener } from 'consolidated-events';
import { CalendarDayPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';

import CalendarMonth from './CalendarMonth';
import CalendarMonth, { propTypes as CalendarMonthPropTypes } from './CalendarMonth';

import isTransitionEndSupported from '../utils/isTransitionEndSupported';
import getTransformStyles from '../utils/getTransformStyles';
Expand All @@ -29,14 +29,14 @@ import {
DAY_SIZE,
} from '../constants';

const propTypes = forbidExtraProps({
export const propTypes = {
...withStylesPropTypes,
enableOutsideDays: PropTypes.bool,
firstVisibleMonthIndex: PropTypes.number,
initialMonth: momentPropTypes.momentObj,
isAnimating: PropTypes.bool,
numberOfMonths: PropTypes.number,
modifiers: PropTypes.object,
modifiers: PropTypes.objectOf(CalendarMonthPropTypes.modifiers),
orientation: ScrollableOrientationShape,
onDayClick: PropTypes.func,
onDayMouseEnter: PropTypes.func,
Expand All @@ -62,7 +62,7 @@ const propTypes = forbidExtraProps({
monthFormat: PropTypes.string,
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)),
dayAriaLabelFormat: PropTypes.string,
});
};

const defaultProps = {
enableOutsideDays: false,
Expand Down Expand Up @@ -354,7 +354,7 @@ class CalendarMonthGrid extends React.Component {
}
}

CalendarMonthGrid.propTypes = propTypes;
CalendarMonthGrid.propTypes = forbidExtraProps(propTypes);
CalendarMonthGrid.defaultProps = defaultProps;

export default withStyles(({ reactDates: { color, zIndex } }) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/components/DayPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import OutsideClickHandler from 'react-outside-click-handler';
import { DayPickerPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';

import CalendarMonthGrid from './CalendarMonthGrid';
import CalendarMonthGrid, { propTypes as CalendarMonthGridPropTypes } from './CalendarMonthGrid';
import DayPickerNavigation from './DayPickerNavigation';
import DayPickerKeyboardShortcuts, {
TOP_LEFT,
Expand Down Expand Up @@ -86,7 +86,7 @@ const propTypes = forbidExtraProps({
renderMonthElement: mutuallyExclusiveProps(PropTypes.func, 'renderMonthText', 'renderMonthElement'),

// day props
modifiers: PropTypes.object,
modifiers: CalendarMonthGridPropTypes.modifiers,
renderCalendarDay: PropTypes.func,
renderDayContents: PropTypes.func,
onDayClick: PropTypes.func,
Expand Down

0 comments on commit d144670

Please sign in to comment.