diff options
-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: { |