-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vertical scrollable orientation #250
Conversation
06cdd62
to
bbbdd20
Compare
@majapw I've update this PR with a new PropType shape |
bbbdd20
to
c06e35e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A handful of comments, but looking good overall.
@@ -35,6 +35,10 @@ | |||
text-align: center; | |||
// necessary to not hide borders in FF | |||
margin-bottom: 2px; | |||
|
|||
.CalendarMonth--vertical-scrollable & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is not terribly clear? I'd rather have
.CalendarMonth--horizontal.CalendarMonth__caption,
.CalendarMonth--vertical.CalendarMonth__caption {
padding: 15px 0 35px;
}
.CalendarMonth--vertical-scrollable.CalendarMonth__caption {
padding: 5px 0;
}
} = this.props; | ||
|
||
const onNextMonthClick = orientation === VERTICAL_SCROLLABLE | ||
? this.multiplyScrollableMonths | ||
: this.onNextMonthClic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.onNextMonthClick
, you're missing a k.
Also we prefer an if... then
over a multiline ternary.
const dayPickerClassNames = cx('DayPicker', { | ||
'DayPicker--horizontal': this.isHorizontal(), | ||
'DayPicker--vertical': this.isVertical(), | ||
'DayPicker--vertical-scrollable': this.props.orientation === VERTICAL_SCROLLABLE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you mean to be reused the verticalScrollable
from line 404
ANCHOR_RIGHT, | ||
VERTICAL_ORIENTATION, | ||
VERTICAL_SCROLLABLE, | ||
} from '../constants'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to make this addition?
@@ -36,10 +36,11 @@ const propTypes = { | |||
// DayPicker props | |||
enableOutsideDays: PropTypes.bool, | |||
numberOfMonths: PropTypes.number, | |||
orientation: OrientationShape, | |||
orientation: ScrollableOrientationShape, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct?
c06e35e
to
b049184
Compare
Thanks @majapw, fixed up the PR. The orientation changes in |
b049184
to
ff7ccc8
Compare
ff7ccc8
to
72d0b1f
Compare
Changes Unknown when pulling 72d0b1f on moonboots:vertical-scrollable into ** on airbnb:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! Will merge in and do a release ASAP.
Also I'm thinking it'd be good to have some stories for the DayPickerRangeController
@majapw @moonboots Curious if there was a reason that this orientation wasn't included for In dealing with responsive decisions, this might be a much useful option. |
to: @majapw
Adds a new orientation that makes
DayPicker
vertically scrollable instead of using pagination. This scrollableDayPicker
will fill the height of its parent and shownumberOfMonths
.Replaces this previous PR. I've separated css by component and threaded the new orientation property throughout.