Update load latest to show when there's new activity with an indicator
This commit is contained in:
parent
6f02548bca
commit
e89103915d
5 changed files with 59 additions and 9 deletions
|
@ -246,6 +246,7 @@ const FeedPage = observer(
|
|||
feed.refresh()
|
||||
}, [feed, scrollToTop])
|
||||
|
||||
const hasNew = feed.hasNewLatest && !feed.isRefreshing
|
||||
return (
|
||||
<View testID={testID} style={s.h100pct}>
|
||||
<Feed
|
||||
|
@ -260,8 +261,12 @@ const FeedPage = observer(
|
|||
renderEmptyState={renderEmptyState}
|
||||
headerOffset={HEADER_OFFSET}
|
||||
/>
|
||||
{isScrolledDown && (
|
||||
<LoadLatestBtn onPress={onPressLoadLatest} label="Load new posts" />
|
||||
{(isScrolledDown || hasNew) && (
|
||||
<LoadLatestBtn
|
||||
onPress={onPressLoadLatest}
|
||||
label="Load new posts"
|
||||
showIndicator={hasNew}
|
||||
/>
|
||||
)}
|
||||
<FAB
|
||||
testID="composeFAB"
|
||||
|
|
|
@ -88,6 +88,9 @@ export const NotificationsScreen = withAuthRequired(
|
|||
),
|
||||
)
|
||||
|
||||
const hasNew =
|
||||
store.me.notifications.hasNewLatest &&
|
||||
!store.me.notifications.isRefreshing
|
||||
return (
|
||||
<View testID="notificationsScreen" style={s.hContentRegion}>
|
||||
<ViewHeader title="Notifications" canGoBack={false} />
|
||||
|
@ -98,10 +101,11 @@ export const NotificationsScreen = withAuthRequired(
|
|||
onScroll={onMainScroll}
|
||||
scrollElRef={scrollElRef}
|
||||
/>
|
||||
{isScrolledDown && (
|
||||
{(isScrolledDown || hasNew) && (
|
||||
<LoadLatestBtn
|
||||
onPress={onPressLoadLatest}
|
||||
label="Load new notifications"
|
||||
showIndicator={hasNew}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue