diff options
author | Ivan Chen <ivan@tagg.id> | 2021-01-19 10:28:27 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-01-19 10:28:27 -0500 |
commit | 1c03e73ca473184603fbf653ddfa3aa2e2eccdef (patch) | |
tree | c3d656557a0c22cbcc31acb598e6c5ce3a80f2bf /src/components | |
parent | d981c6d8f420e0344a70209bc3cb2de929b41842 (diff) |
redesigned tagg loading indicator, added indicator to image upload
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/common/TaggLoadingIndicator.tsx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/components/common/TaggLoadingIndicator.tsx b/src/components/common/TaggLoadingIndicator.tsx index c3c44bf9..d9143bd6 100644 --- a/src/components/common/TaggLoadingIndicator.tsx +++ b/src/components/common/TaggLoadingIndicator.tsx @@ -1,11 +1,23 @@ import * as React from 'react'; -import {Image, StyleSheet, View} from 'react-native'; +import {Image, Modal, StyleSheet, View} from 'react-native'; -type TaggLoadingIndicatorProps = { - color: string; -}; -const TaggLoadingIndicator: React.FC<TaggLoadingIndicatorProps> = ({color}) => { - return ( +interface TaggLoadingIndicatorProps { + fullscreen: boolean; +} + +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.container, styles.horizontal]}> <Image source={require('../../assets/gifs/loading-animation.gif')} @@ -19,6 +31,7 @@ const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', + backgroundColor: 'rgba(0,0,0,0.3)', }, horizontal: { flexDirection: 'row', |