1
- import { H4 , Paragraph , Spinner , useMedia , XStack , YStack } from '@my/ui'
1
+ import { Card , H4 , Paragraph , Spinner , useMedia , XStack , YStack } from '@my/ui'
2
2
import type { PostgrestError } from '@supabase/postgrest-js'
3
3
import type { InfiniteData , UseInfiniteQueryResult } from '@tanstack/react-query'
4
4
import { ActivityDetails } from 'app/features/activity/ActivityDetails'
@@ -26,14 +26,7 @@ export function RecentActivity() {
26
26
}
27
27
28
28
return (
29
- < XStack
30
- w = { '100%' }
31
- gap = { '$5' }
32
- f = { 1 }
33
- $gtLg = { {
34
- height : 0 ,
35
- } }
36
- >
29
+ < XStack w = { '100%' } gap = { '$5' } f = { 1 } >
37
30
< YStack
38
31
f = { 1 }
39
32
display = { selectedActivity && queryParams . activity ? 'none' : 'flex' }
@@ -49,6 +42,11 @@ export function RecentActivity() {
49
42
activity = { selectedActivity }
50
43
onClose = { handleCloseActivityDetails }
51
44
w = { '100%' }
45
+ $platform-web = { {
46
+ height : 'fit-content' ,
47
+ position : 'sticky' ,
48
+ top : 10 ,
49
+ } }
52
50
$gtLg = { {
53
51
maxWidth : '47%' ,
54
52
} }
@@ -66,7 +64,6 @@ function ActivityFeed({
66
64
onActivityPress : ( activity : Activity ) => void
67
65
} ) {
68
66
const { isAtEnd } = useScrollDirection ( )
69
- const media = useMedia ( )
70
67
71
68
const {
72
69
data,
@@ -78,10 +75,10 @@ function ActivityFeed({
78
75
} = activityFeedQuery
79
76
80
77
useEffect ( ( ) => {
81
- if ( isAtEnd && ! media . gtLg && hasNextPage && ! isFetchingNextPageActivities ) {
78
+ if ( isAtEnd && hasNextPage && ! isFetchingNextPageActivities ) {
82
79
fetchNextPage ( )
83
80
}
84
- } , [ isAtEnd , hasNextPage , fetchNextPage , isFetchingNextPageActivities , media . gtLg ] )
81
+ } , [ isAtEnd , hasNextPage , fetchNextPage , isFetchingNextPageActivities ] )
85
82
86
83
const sections = useMemo ( ( ) => {
87
84
if ( ! data ?. pages ) return [ ]
@@ -129,6 +126,7 @@ function ActivityFeed({
129
126
130
127
return (
131
128
< SectionList
129
+ style = { { flex : 1 } }
132
130
sections = { sections }
133
131
testID = { 'RecentActivity' }
134
132
showsVerticalScrollIndicator = { false }
@@ -167,7 +165,6 @@ function ActivityFeed({
167
165
renderSectionHeader = { ( { section : { title, index } } ) => (
168
166
< RowLabel first = { index === 0 } > { title } </ RowLabel >
169
167
) }
170
- onEndReached = { ( ) => hasNextPage && media . gtLg && fetchNextPage ( ) }
171
168
ListFooterComponent = {
172
169
! isLoadingActivities && isFetchingNextPageActivities ? < Spinner size = "small" /> : null
173
170
}
0 commit comments