feat: expose isAnimated flag to renderDay for floating day header (#2721)#2748
Merged
Conversation
renderDay is used for both the inline day separators and the floating animated day header. Previously there was no way to tell the two apart, so a custom renderDay was forced to use the same look for both. Pass isAnimated in the DayProps given to renderDay (true for the floating header, false for the inline separators) so a single renderDay can branch and style each differently. dateFormat/dateFormatCalendar already flow to the floating header, so custom date formats stay in sync there too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2721
Problem
renderDayis used for both the inline day separators and the floating/animated day header that sticks to the top while scrolling. There was no way to distinguish the two inside a customrenderDay, so users were forced to give both the same look.Fix
Pass an
isAnimatedflag in theDayPropshanded torenderDay:truefor the floating animated headerfalse(orundefined) for the inline separatorsA single
renderDaycan now branch on it:dateFormat/dateFormatCalendaralready flow through to the floating header, so custom date formats stay in sync there too (the second half of the issue).This is non-breaking -
isAnimatedis an additive optional field onDayProps; existingrenderDaycallbacks keep working unchanged.Validation
Verified on the Android emulator with a branching
renderDay: the inline separators render one style while the floating header renders a distinct one as it appears during scroll.