diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/common/TaggLoadingIndicator.tsx | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/src/components/common/TaggLoadingIndicator.tsx b/src/components/common/TaggLoadingIndicator.tsx index cfb99e80..91c68622 100644 --- a/src/components/common/TaggLoadingIndicator.tsx +++ b/src/components/common/TaggLoadingIndicator.tsx @@ -1,27 +1,53 @@ import * as React from 'react'; -import {ActivityIndicator, StyleSheet, View} from 'react-native'; +import {Image, StyleSheet, View} from 'react-native'; +import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; -type TaggLoadingIndicatorProps = { - color: string; -}; -const TaggLoadingIndicator: React.FC<TaggLoadingIndicatorProps> = ({color}) => { +interface TaggLoadingIndicatorProps { + fullscreen: boolean; +} + +const TaggLoadingIndicator: React.FC<TaggLoadingIndicatorProps> = ({ + fullscreen = false, +}) => { return ( - <View style={[styles.container, styles.horizontal]}> - <ActivityIndicator size="large" color={color} /> + <View + style={[ + fullscreen ? styles.fullscreen : {}, + styles.container, + styles.horizontal, + ]}> + <Image + source={require('../../assets/gifs/loading-animation.gif')} + style={styles.icon} + /> </View> ); }; 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: { flexDirection: 'row', justifyContent: 'space-around', padding: 10, }, + icon: { + alignSelf: 'center', + justifyContent: 'center', + width: '40%', + aspectRatio: 2, + }, }); export default TaggLoadingIndicator; |