Skip to content

Commit 5115a26

Browse files
chrisbobbegnprice
authored andcommitted
offline notice: Render on remaining screens
I've audited all our screens and found just these two where we weren't yet showing the OfflineNotice, and added it: - The lightbox screen, where the offline notice might give the reason why an image isn't loading. - FullScreenLoading, which we show when we're waiting for server data, where the notice might give the reason we don't have server data. Taking care that the OfflineNotice's position is consistent with its position on all the other screens (see previous commit): always at the top of the screen, just below the top inset.
1 parent 6ae7772 commit 5115a26

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/common/FullScreenLoading.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
77
import { BRAND_COLOR, createStyleSheet } from '../styles';
88
import LoadingIndicator from './LoadingIndicator';
99
import ZulipStatusBar from './ZulipStatusBar';
10+
import OfflineNotice from './OfflineNotice';
1011

1112
const componentStyles = createStyleSheet({
1213
center: {
@@ -35,6 +36,7 @@ export default function FullScreenLoading(props: Props): Node {
3536
backgroundColor: BRAND_COLOR,
3637
}}
3738
/>
39+
<OfflineNotice />
3840
<LoadingIndicator color="black" size={80} showLogo />
3941
</View>
4042
</>

src/lightbox/LightboxHeader.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { createStyleSheet } from '../styles';
99
import UserAvatarWithPresence from '../common/UserAvatarWithPresence';
1010
import { Icon } from '../common/Icons';
1111
import { AvatarURL } from '../utils/avatar';
12+
import OfflineNotice from '../common/OfflineNotice';
1213

1314
const styles = createStyleSheet({
1415
text: {
@@ -29,7 +30,7 @@ const styles = createStyleSheet({
2930
alignSelf: 'center',
3031
marginVertical: 4,
3132
},
32-
wrapper: {
33+
contentArea: {
3334
flex: 1,
3435
flexDirection: 'row',
3536
paddingHorizontal: 16,
@@ -60,8 +61,9 @@ export default function LightboxHeader(props: Props): Node {
6061
const subheader = `${displayDate} at ${time}`;
6162

6263
return (
63-
<SafeAreaView mode="padding" edges={['top', 'right', 'left']}>
64-
<View style={styles.wrapper}>
64+
<SafeAreaView mode="padding" edges={['top']}>
65+
<OfflineNotice />
66+
<SafeAreaView mode="padding" edges={['right', 'left']} style={styles.contentArea}>
6567
<UserAvatarWithPresence size={36} avatarUrl={avatarUrl} email={senderEmail} />
6668
<View style={styles.text}>
6769
<Text style={styles.name} numberOfLines={1}>
@@ -74,7 +76,7 @@ export default function LightboxHeader(props: Props): Node {
7476
<Pressable style={styles.rightIconTouchTarget} onPress={onPressBack} hitSlop={12}>
7577
{({ pressed }) => <Icon size={24} color={pressed ? 'gray' : 'white'} name="x" />}
7678
</Pressable>
77-
</View>
79+
</SafeAreaView>
7880
</SafeAreaView>
7981
);
8082
}

0 commit comments

Comments
 (0)