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

make nav arrows configurable #161

Merged
merged 3 commits into from
Nov 3, 2016
Merged

make nav arrows configurable #161

merged 3 commits into from
Nov 3, 2016

Conversation

Mythra
Copy link
Contributor

@Mythra Mythra commented Nov 2, 2016

fixes #112

This PR was originally #154 , but I ended up making a mess of git (multiple reorders + squashing after reorder is hard 😞 ). So go look there for comments. However here is the original PR message:

This PR adds in the ability to specify navPrev, and navNext to DayPicker incase they want to override the default SVGs that come bundled with react-dates (e.g. ChevronUp, ChevronDown, LeftArrow, and RightArrow).

If navPrev, or navNext aren't specified then DayPicker will fall back to the current behavior of:

isVertical ? <ChevronUp /> : <LeftArrow />;

for the previous button, and:

isVertical ? <ChevronDown /> : <RightArrow />;

for the next button.

I also tried to make this work as much with existing code as possible. As such even with custom icons the class names: DayPicker__nav--prev, and DayPicker__nav--next are still rendered even with custom icons. If you really want to target something inside of your custom icon, you can always tag class names/ids onto the props you pass in. E.g.:

<DayPicker
  navPrev={
    <span className={'MySuperAwesomeIcon'}>
       'Prev'
    </span>
  }
/>

@Mythra
Copy link
Contributor Author

Mythra commented Nov 2, 2016

@majapw Here's the new PR sorry about the mess I made with #154 😞

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.

No problem at all! ✌️ Thank you so much for all the hard work. :) This is super. I'll merge it in as soon as tests pass and do a release today. :)

@Mythra
Copy link
Contributor Author

Mythra commented Nov 2, 2016

🙇‍♂️ Sounds awesome! Thanks for providing such quick reviews!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 88.726% when pulling 135f61e on SecurityInsanity:c_navigation into 213f268 on airbnb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 88.726% when pulling 135f61e on SecurityInsanity:c_navigation into 213f268 on airbnb:master.

@majapw majapw merged commit e539dfe into react-dates:master Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make navigation arrows configurable
3 participants