Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/MessagesContainer/components/DayAnimated/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@
}), [relativeScrolledPositionToBottomOfDay, containerHeight, dayTopOffset, isLoadingAnim])

const contentStyle = useAnimatedStyle(() => ({
opacity: opacity.value,
}), [opacity])
// Only show the floating header once the current day's inline separator has
// scrolled off the top (relativeScrolledPositionToBottomOfDay < 0). While the
// inline separator is still on screen (>= 0) it already shows the date, so
// hiding the floating copy avoids a duplicate date badge (#2709).
opacity: opacity.value * interpolate(
relativeScrolledPositionToBottomOfDay.value,
[-0.0001, 0],
[1, 0],
'clamp'
),
}), [opacity, relativeScrolledPositionToBottomOfDay])

const fadeOut = useCallback(() => {
'worklet'
Expand All @@ -92,7 +101,7 @@

useAnimatedReaction(
() => [scrolledY.value, daysPositionsArray],
(value, prevValue) => {

Check warning on line 104 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (24)

React Hook useAnimatedReaction has missing dependencies: 'daysPositionsArray' and 'scrolledY.value'. Either include them or remove the dependency array

Check warning on line 104 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (24)

React Hook useAnimatedReaction was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies

Check warning on line 104 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (22)

React Hook useAnimatedReaction has missing dependencies: 'daysPositionsArray' and 'scrolledY.value'. Either include them or remove the dependency array

Check warning on line 104 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (22)

React Hook useAnimatedReaction was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies
if (!isScrolledOnMount.value) {
isScrolledOnMount.value = true
return
Expand All @@ -110,7 +119,7 @@

useAnimatedReaction(
() => createdAtDate.value,
(value, prevValue) => {

Check warning on line 122 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (24)

React Hook useAnimatedReaction has a missing dependency: 'createdAtDate.value'. Either include it or remove the dependency array

Check warning on line 122 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (24)

React Hook useAnimatedReaction was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies

Check warning on line 122 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (22)

React Hook useAnimatedReaction has a missing dependency: 'createdAtDate.value'. Either include it or remove the dependency array

Check warning on line 122 in src/MessagesContainer/components/DayAnimated/index.tsx

View workflow job for this annotation

GitHub Actions / checks (22)

React Hook useAnimatedReaction was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies
if (value && value !== prevValue)
runOnJS(setCreatedAt)(value)
},
Expand Down
Loading