BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
936 stars 325 forks source link

Allow passing `highlightDateContainerStyle` as a prop #261

Closed dezse97 closed 3 years ago

dezse97 commented 3 years ago

Solves #259 :)

peacechen commented 3 years ago

Thanks @dezse97 for adding this prop. I'll make some minor changes (code styling, remove version bump etc). Upon reviewing the existing props, the new one should behighlightDateContainerStyle to remain consistent

peacechen commented 3 years ago

@dezse97 Please test your fork after the changes I made. There was a logic error in the changes to _dateViewStyle that prevented the animation on the selected date.

dezse97 commented 3 years ago

Thank you for the changes and the quick review @peacechen. Yes, it's working fine after your changes as well. :) It can be merged from my side.

ysmike commented 3 years ago

Is this prop working for v2.1.5? @peacechen @dezse97

peacechen commented 3 years ago

Published in 2.1.6 I was waiting on other changes in the works, but it sounds like you need this feature now.

ysmike commented 3 years ago

Thank you! @peacechen It looks like dayContainerStyle overrides highlightDateContainerStyle. Is this the expected behavior? I'd like to style all the days of the week with a different styling for the selected date.

peacechen commented 3 years ago

The current code does have dayContainer style overriding the others: https://github.com/BugiDev/react-native-calendar-strip/blob/49ecc6f5039b40eb39fa243f4b850d7a330c3391/src/CalendarDay.js#L468

highlightDateContainerStyle should probably take precedence. Hopefully no one is using both. Would you mind testing it with _dateViewStyle and dayContainerStyle flipped in the day component above?

ysmike commented 3 years ago

When those two props swap places, the background color of the dayContainerStyle no longer works. Certain other props passed to the dayContainerStyle does apply whether flipped or not. Any thoughts? @peacechen

QuintonC commented 2 years ago

-- deleted as issues from previous comment are handled in https://github.com/BugiDev/react-native-calendar-strip/pull/318 --