Skip to content
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 verticalHeight prop for DayPicker #773

Merged
merged 1 commit into from
Oct 23, 2017

Conversation

ingiulio
Copy link
Contributor

Addresses #632

👋

These changes allow the user of DayPicker to specify a vertical height (applied only when on vertical orientation), while keeping the current behavior (an arbitrary size) as the default if no height is specified.

This is actually slightly different than what the issue's title suggests, but imho it seems easier for the user to just have full control on the height rather than trying different "factors". Open to different opinions obviously!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 12f1479 on ingiulio:daypicker_vertical_height into ** on airbnb:master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling ef1e9d0 on ingiulio:daypicker_vertical_height into ** on airbnb:master**.

Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me. Should we pass the prop through the DateRangePicker/SingleDatePicker components as well?

@ljharb ljharb added the semver-minor: new stuff Any feature or API addition. label Oct 17, 2017
@@ -55,6 +55,7 @@ const propTypes = forbidExtraProps({
hideKeyboardShortcutsPanel: PropTypes.bool,
daySize: nonNegativeInteger,
isRTL: PropTypes.bool,
verticalHeight: PropTypes.number,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a nonNegativeInteger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, I can't think of a case where it would in fact make sense to use a negative height 🤔

@ingiulio
Copy link
Contributor Author

@majapw ok! I'll add it there too.

Btw, is the Changes unknown [etc] message from coveralls something new?

@ljharb
Copy link
Member

ljharb commented Oct 17, 2017

@ingiulio try rebasing on the latest master, on the command line?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 86.775% when pulling 6698278 on ingiulio:daypicker_vertical_height into a448352 on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 86.775% when pulling b0eac7b on ingiulio:daypicker_vertical_height into a448352 on airbnb:master.

@majapw
Copy link
Collaborator

majapw commented Oct 20, 2017

This PR will be ready to go once you can set the verticalHeight prop in the SingleDatePicker, DateRangePicker, DayPickerSingleDateController, and DayPickerRangeController.

I also reran the pending test.

@ingiulio
Copy link
Contributor Author

Done, thank you!
Do you think the stories for SingleDatePicker and DateRangePicker are useful? I guess they help verify the props are passed through properly, but if they don't add much value please let me know and I'll just remove them.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 86.775% when pulling 81912e9 on ingiulio:daypicker_vertical_height into a448352 on airbnb:master.

Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think more examples is always a great idea! :) If we were to add a visual diffing tool like https://github.com/Galooshi/happo or something, every example we've already written would add that much more. I'm pretty happy with this.

Could you also add verticalHeight: nonNegativeInteger to the DateRangePickerShape and SingleDatePickerShape files? :)

After that, I'll merge this in. :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 86.709% when pulling 8e222a7 on ingiulio:daypicker_vertical_height into e2e5767 on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 86.709% when pulling fb1a15b on ingiulio:daypicker_vertical_height into e2e5767 on airbnb:master.

Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@majapw majapw merged commit 6850c56 into react-dates:master Oct 23, 2017
@ingiulio ingiulio deleted the daypicker_vertical_height branch October 24, 2017 04:35
@ingiulio
Copy link
Contributor Author

Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor: new stuff Any feature or API addition.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants