diff options
Diffstat (limited to 'src/view/screens')
-rw-r--r-- | src/view/screens/Home.tsx | 3 | ||||
-rw-r--r-- | src/view/screens/Notifications.tsx | 8 | ||||
-rw-r--r-- | src/view/screens/PostDownvotedBy.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/PostRepostedBy.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/PostThread.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Profile.tsx | 3 | ||||
-rw-r--r-- | src/view/screens/ProfileFollowers.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/ProfileFollows.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/ProfileMembers.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Search.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Settings.tsx | 1 |
11 files changed, 21 insertions, 1 deletions
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index a1d202738..078fb9800 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -9,6 +9,7 @@ import {useStores} from '../../state' import {FeedModel} from '../../state/models/feed-view' import {ScreenParams} from '../routes' import {s, colors} from '../lib/styles' +import {useOnMainScroll} from '../lib/useOnMainScroll' const HITSLOP = {left: 20, top: 20, right: 20, bottom: 20} @@ -18,6 +19,7 @@ export const Home = observer(function Home({ scrollElRef, }: ScreenParams) { const store = useStores() + const onMainScroll = useOnMainScroll(store) const [hasSetup, setHasSetup] = useState<boolean>(false) const {appState} = useAppState({ onForeground: () => doPoll(true), @@ -95,6 +97,7 @@ export const Home = observer(function Home({ style={{flex: 1}} onPressCompose={onPressCompose} onPressTryAgain={onPressTryAgain} + onScroll={onMainScroll} /> {defaultFeedView.hasNewLatest ? ( <TouchableOpacity diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx index b168ffaff..8af9d0713 100644 --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -5,9 +5,11 @@ import {Feed} from '../com/notifications/Feed' import {useStores} from '../../state' import {NotificationsViewModel} from '../../state/models/notifications-view' import {ScreenParams} from '../routes' +import {useOnMainScroll} from '../lib/useOnMainScroll' export const Notifications = ({navIdx, visible}: ScreenParams) => { const store = useStores() + const onMainScroll = useOnMainScroll(store) useEffect(() => { if (!visible) { @@ -33,7 +35,11 @@ export const Notifications = ({navIdx, visible}: ScreenParams) => { return ( <View style={{flex: 1}}> <ViewHeader title="Notifications" /> - <Feed view={store.me.notifications} onPressTryAgain={onPressTryAgain} /> + <Feed + view={store.me.notifications} + onPressTryAgain={onPressTryAgain} + onScroll={onMainScroll} + /> </View> ) } diff --git a/src/view/screens/PostDownvotedBy.tsx b/src/view/screens/PostDownvotedBy.tsx index b16ec5c0a..ab110f8f9 100644 --- a/src/view/screens/PostDownvotedBy.tsx +++ b/src/view/screens/PostDownvotedBy.tsx @@ -14,6 +14,7 @@ export const PostDownvotedBy = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { store.nav.setTitle(navIdx, 'Downvoted by') + store.shell.setMinimalShellMode(false) } }, [store, visible]) diff --git a/src/view/screens/PostRepostedBy.tsx b/src/view/screens/PostRepostedBy.tsx index d8e4b910e..4e84617df 100644 --- a/src/view/screens/PostRepostedBy.tsx +++ b/src/view/screens/PostRepostedBy.tsx @@ -14,6 +14,7 @@ export const PostRepostedBy = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { store.nav.setTitle(navIdx, 'Reposted by') + store.shell.setMinimalShellMode(false) } }, [store, visible]) diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index 1e63ac390..4caf144bf 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -29,6 +29,7 @@ export const PostThread = ({navIdx, visible, params}: ScreenParams) => { return } setTitle() + store.shell.setMinimalShellMode(false) if (!view.hasLoaded && !view.isLoading) { console.log('Fetching post thread', uri) view.setup().then( diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index 93a7147b5..86be47fbd 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -18,6 +18,7 @@ import {EmptyState} from '../com/util/EmptyState' import {ViewHeader} from '../com/util/ViewHeader' import * as Toast from '../com/util/Toast' import {s, colors} from '../lib/styles' +import {useOnMainScroll} from '../lib/useOnMainScroll' const LOADING_ITEM = {_reactKey: '__loading__'} const END_ITEM = {_reactKey: '__end__'} @@ -25,6 +26,7 @@ const EMPTY_ITEM = {_reactKey: '__empty__'} export const Profile = observer(({navIdx, visible, params}: ScreenParams) => { const store = useStores() + const onMainScroll = useOnMainScroll(store) const [hasSetup, setHasSetup] = useState<boolean>(false) const uiState = useMemo( () => new ProfileUiModel(store, {user: params.name}), @@ -252,6 +254,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => { ListFooterComponent={Footer} refreshing={uiState.isRefreshing || false} onSelectView={onSelectView} + onScroll={onMainScroll} onRefresh={onRefresh} onEndReached={onEndReached} /> diff --git a/src/view/screens/ProfileFollowers.tsx b/src/view/screens/ProfileFollowers.tsx index b19a5bc37..49b3e2e05 100644 --- a/src/view/screens/ProfileFollowers.tsx +++ b/src/view/screens/ProfileFollowers.tsx @@ -12,6 +12,7 @@ export const ProfileFollowers = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { store.nav.setTitle(navIdx, `Followers of ${name}`) + store.shell.setMinimalShellMode(false) } }, [store, visible, name]) diff --git a/src/view/screens/ProfileFollows.tsx b/src/view/screens/ProfileFollows.tsx index e54b562e7..58df6e76d 100644 --- a/src/view/screens/ProfileFollows.tsx +++ b/src/view/screens/ProfileFollows.tsx @@ -12,6 +12,7 @@ export const ProfileFollows = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { store.nav.setTitle(navIdx, `Followed by ${name}`) + store.shell.setMinimalShellMode(false) } }, [store, visible, name]) diff --git a/src/view/screens/ProfileMembers.tsx b/src/view/screens/ProfileMembers.tsx index b4b6c7e50..9d6723fe9 100644 --- a/src/view/screens/ProfileMembers.tsx +++ b/src/view/screens/ProfileMembers.tsx @@ -12,6 +12,7 @@ export const ProfileMembers = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { store.nav.setTitle(navIdx, `Members of ${name}`) + store.shell.setMinimalShellMode(false) } }, [store, visible, name]) diff --git a/src/view/screens/Search.tsx b/src/view/screens/Search.tsx index 1cc0a5fe9..f80ade35c 100644 --- a/src/view/screens/Search.tsx +++ b/src/view/screens/Search.tsx @@ -29,6 +29,7 @@ export const Search = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { + store.shell.setMinimalShellMode(false) autocompleteView.setup() textInput.current?.focus() store.nav.setTitle(navIdx, `Search`) diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 599bb5793..a1281e0d7 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -18,6 +18,7 @@ export const Settings = observer(function Settings({ if (!visible) { return } + store.shell.setMinimalShellMode(false) store.nav.setTitle(navIdx, 'Settings') }, [visible, store]) |