Skip to content

Commit 7eae4e9

Browse files
chrisbobbegnprice
authored andcommitted
safe areas: Put OfflineNotice on each tab screen, out of top inset
This fixes a regression introduced in fc06c94. In that commit, we asked MainTabsScreen to stop padding the top inset, and asked each individual tab screen to pad it. With this <OfflineNotice /> being left behind in MainTabsScreen, it lost its protection from the top inset, and on my device the crucial "No Internet connection" text was completely hidden by the notch. So, remove that single <OfflineNotice /> and add one in each of the four tab screens, using each screen's protection against rendering content in the top inset.
1 parent f6fd683 commit 7eae4e9

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/account-info/ProfileScreen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { getOwnUser } from '../users/userSelectors';
1919
import { getIdentity } from '../account/accountsSelectors';
2020
import { useNavigation } from '../react-navigation';
2121
import { showConfirmationDialog } from '../utils/info';
22+
import OfflineNotice from '../common/OfflineNotice';
2223

2324
const styles = createStyleSheet({
2425
buttonRow: {
@@ -128,6 +129,7 @@ export default function ProfileScreen(props: Props): Node {
128129

129130
return (
130131
<SafeAreaView mode="padding" edges={['top']} style={{ flex: 1 }}>
132+
<OfflineNotice />
131133
<ScrollView>
132134
<AccountDetails user={ownUser} />
133135
<AwayStatusSwitch />

src/main/HomeScreen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { BRAND_COLOR, createStyleSheet } from '../styles';
1717
import LoadingBanner from '../common/LoadingBanner';
1818
import ServerCompatBanner from '../common/ServerCompatBanner';
1919
import ServerPushSetupBanner from '../common/ServerPushSetupBanner';
20+
import OfflineNotice from '../common/OfflineNotice';
2021

2122
const styles = createStyleSheet({
2223
wrapper: {
@@ -40,6 +41,7 @@ export default function HomeScreen(props: Props): Node {
4041

4142
return (
4243
<SafeAreaView mode="padding" edges={['top']} style={styles.wrapper}>
44+
<OfflineNotice />
4345
<View style={styles.iconList}>
4446
<TopTabButton
4547
name="globe"

src/main/MainTabsScreen.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import HomeScreen from './HomeScreen';
1515
import PmConversationsScreen from '../pm-conversations/PmConversationsScreen';
1616
import { IconInbox, IconStream, IconPeople } from '../common/Icons';
1717
import OwnAvatar from '../common/OwnAvatar';
18-
import OfflineNotice from '../common/OfflineNotice';
1918
import ProfileScreen from '../account-info/ProfileScreen';
2019
import styles, { BRAND_COLOR, ThemeContext } from '../styles';
2120
import SubscriptionsScreen from '../streams/SubscriptionsScreen';
@@ -54,7 +53,6 @@ export default function MainTabsScreen(props: Props): Node {
5453

5554
return (
5655
<View style={[styles.flexed, { backgroundColor }]}>
57-
<OfflineNotice />
5856
<Tab.Navigator {...bottomTabNavigatorConfig()} lazy={false} backBehavior="none">
5957
<Tab.Screen
6058
name="home"

src/pm-conversations/PmConversationsScreen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import LoadingBanner from '../common/LoadingBanner';
1515
import { IconPeople, IconPerson } from '../common/Icons';
1616
import PmConversationList from './PmConversationList';
1717
import { getRecentConversations } from '../selectors';
18+
import OfflineNotice from '../common/OfflineNotice';
1819

1920
const styles = createStyleSheet({
2021
container: {
@@ -54,6 +55,7 @@ export default function PmConversationsScreen(props: Props): Node {
5455
edges={['top']}
5556
style={[styles.container, { backgroundColor: context.backgroundColor }]}
5657
>
58+
<OfflineNotice />
5759
<View style={styles.row}>
5860
<ZulipButton
5961
secondary

src/streams/SubscriptionsScreen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { caseInsensitiveCompareFunc } from '../utils/misc';
2121
import StreamItem from './StreamItem';
2222
import ModalNavBar from '../nav/ModalNavBar';
2323
import NestedNavRow from '../common/NestedNavRow';
24+
import OfflineNotice from '../common/OfflineNotice';
2425

2526
const styles = createStyleSheet({
2627
container: {
@@ -73,6 +74,7 @@ export default function SubscriptionsScreen(props: Props): Node {
7374
<View style={styles.container}>
7475
{/* Consumes the top inset. */}
7576
<ModalNavBar canGoBack={false} title="Streams" />
77+
<OfflineNotice />
7678

7779
<LoadingBanner />
7880
{subscriptions.length === 0 ? (

0 commit comments

Comments
 (0)