diff options
author | Ivan Chen <ivan@tagg.id> | 2021-01-19 11:05:30 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-01-19 11:05:30 -0500 |
commit | 886ebcbd29cc09b6edf6739e4560d6b3ccee2a59 (patch) | |
tree | 0d8e840594d1a5b87738981addebe06df7fe174c | |
parent | 1c03e73ca473184603fbf653ddfa3aa2e2eccdef (diff) |
using view instead of modal
-rw-r--r-- | src/components/common/TaggLoadingIndicator.tsx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/components/common/TaggLoadingIndicator.tsx b/src/components/common/TaggLoadingIndicator.tsx index d9143bd6..dd1ae332 100644 --- a/src/components/common/TaggLoadingIndicator.tsx +++ b/src/components/common/TaggLoadingIndicator.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import {Image, Modal, StyleSheet, View} from 'react-native'; +import {Image, StyleSheet, View} from 'react-native'; +import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; interface TaggLoadingIndicatorProps { fullscreen: boolean; @@ -9,14 +10,12 @@ const TaggLoadingIndicator: React.FC<TaggLoadingIndicatorProps> = ({ fullscreen = false, }) => { return fullscreen ? ( - <Modal transparent> - <View style={[styles.container, styles.horizontal]}> - <Image - source={require('../../assets/gifs/loading-animation.gif')} - style={styles.icon} - /> - </View> - </Modal> + <View style={[styles.fullscreen, styles.container, styles.horizontal]}> + <Image + source={require('../../assets/gifs/loading-animation.gif')} + style={styles.icon} + /> + </View> ) : ( <View style={[styles.container, styles.horizontal]}> <Image @@ -28,9 +27,16 @@ const TaggLoadingIndicator: React.FC<TaggLoadingIndicatorProps> = ({ }; const styles = StyleSheet.create({ + fullscreen: { + zIndex: 999, + position: 'absolute', + height: SCREEN_HEIGHT, + width: SCREEN_WIDTH, + }, container: { flex: 1, justifyContent: 'center', + alignItems: 'center', backgroundColor: 'rgba(0,0,0,0.3)', }, horizontal: { |