fix(CalendarDay): apply styles for start and end modifiers #796
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous versions of the library would add the
CalendarDay--selected-start
andCalendarDay--selected-end
class names whenselected-start
andselected-end
modifiers were passed.I think after the switch to
react-with-styles
these classes got lost and making it harder to modify the styles of the beginning and end of a range.I'm not very familiar with
react-with-styles
, so I don't know if this is the proper way to get those class names set in the component.I would also like to add unit tests for this, but I didn't see tests in
CalendarDay
regarding other modifiers and I'm not quite sure how to test this. I see that the wrapper gets the class names in the test, but they have what it seems a random modifier at the end. Also, thereact-with-styles
docs mention thatcss(...)
returns an object with an opaque structure, so definitely, checking the value of the props added by this object doesn't seem a good testing option.Fixes #786.