Skip to content

Commit 033c210

Browse files
chrisbobbegnprice
authored andcommitted
StreamListScreen: Use Screen component, like other screens
I don't see a special reason for this component to avoid using the Screen component. It didn't use Screen back when it was part of a tab rendered by MainTabsScreen, and that made sense. But in 9d11e78, it took on this new role as a regular stack screen on the AppNavigator, and the norm is to use Screen for those. I see just two functional changes, and they both seem like improvements: - The bottom inset is now padded, so now the list doesn't overlap with any notches, native UI, etc. - Like other screens, this one now shows the OfflineNotice.
1 parent 9e829ac commit 033c210

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/subscriptions/StreamListScreen.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
import React, { useCallback, useMemo } from 'react';
44
import type { Node } from 'react';
5-
import { View, FlatList } from 'react-native';
5+
import { FlatList } from 'react-native';
66

7+
import Screen from '../common/Screen';
78
import type { RouteProp } from '../react-navigation';
89
import type { AppNavigationProp } from '../nav/AppNavigator';
910
import { createStyleSheet } from '../styles';
1011
import { useDispatch, useSelector } from '../react-redux';
1112
import ZulipButton from '../common/ZulipButton';
12-
import LoadingBanner from '../common/LoadingBanner';
1313
import SearchEmptyState from '../common/SearchEmptyState';
1414
import * as api from '../api';
1515
import { delay } from '../utils/async';
@@ -19,12 +19,8 @@ import { doNarrow } from '../actions';
1919
import { caseInsensitiveCompareFunc } from '../utils/misc';
2020
import StreamItem from '../streams/StreamItem';
2121
import { getSubscriptionsById } from './subscriptionSelectors';
22-
import ModalNavBar from '../nav/ModalNavBar';
2322

2423
const styles = createStyleSheet({
25-
wrapper: {
26-
flex: 1,
27-
},
2824
button: {
2925
margin: 16,
3026
},
@@ -71,9 +67,7 @@ export default function StreamListScreen(props: Props): Node {
7167
);
7268

7369
return (
74-
<View style={styles.wrapper}>
75-
<ModalNavBar canGoBack title="All streams" />
76-
<LoadingBanner />
70+
<Screen scrollEnabled={false} title="All streams">
7771
{canCreateStreams && (
7872
<ZulipButton
7973
style={styles.button}
@@ -121,6 +115,6 @@ export default function StreamListScreen(props: Props): Node {
121115
)}
122116
/>
123117
)}
124-
</View>
118+
</Screen>
125119
);
126120
}

0 commit comments

Comments
 (0)