Skip to content

Commit 59176bd

Browse files
chrisbobbegnprice
authored andcommitted
FullScreenLoading: Center LoadingIndicator vertically in the whole screen
Not just in the area below the top inset, or, when the offline notice is shown, the top inset and the offline notice. The spinner graphic isn't nearly big enough to run afoul of any of the insets or the offline notice.
1 parent 40c8e3b commit 59176bd

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/common/FullScreenLoading.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
import React from 'react';
33
import type { Node } from 'react';
44
import { View } from 'react-native';
5-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
65

76
import { BRAND_COLOR, createStyleSheet } from '../styles';
87
import LoadingIndicator from './LoadingIndicator';
98
import ZulipStatusBar from './ZulipStatusBar';
10-
import { OfflineNoticePlaceholder } from '../boot/OfflineNoticeProvider';
119

1210
const componentStyles = createStyleSheet({
1311
center: {
@@ -24,19 +22,16 @@ type Props = $ReadOnly<{||}>;
2422
* Meant to be used to cover the whole screen.
2523
*/
2624
export default function FullScreenLoading(props: Props): Node {
27-
const insets = useSafeAreaInsets();
28-
2925
return (
3026
<>
3127
<ZulipStatusBar backgroundColor={BRAND_COLOR} />
28+
{
29+
// No need for `OfflineNoticePlaceholder` here: the content, a
30+
// loading indicator centered on the whole screen, isn't near the
31+
// top of the screen, so it doesn't need protection from being
32+
// hidden under the offline notice.
33+
}
3234
<View style={componentStyles.center}>
33-
<View
34-
style={{
35-
height: insets.top,
36-
backgroundColor: BRAND_COLOR,
37-
}}
38-
/>
39-
<OfflineNoticePlaceholder />
4035
<LoadingIndicator color="black" size={80} showLogo />
4136
</View>
4237
</>

0 commit comments

Comments
 (0)