diff options
author | Ivan Chen <ivan@thetaggid.com> | 2021-01-20 16:38:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 16:38:05 -0500 |
commit | 929dac6e6768cd5c4c64e12543bd89ee3d46bcd1 (patch) | |
tree | 404df78a82cdffcb8df03f539a2c094ea614af83 /src/components/common | |
parent | 7b45e8d238f392183f3c1742f22495a2f9c6fb7f (diff) | |
parent | 61a848800100596c78e07f57353880e630954d24 (diff) |
Merge pull request #191 from IvanIFChen/tma493-new-loading-indicator
[TMA-493] New Loading Indicator
Diffstat (limited to 'src/components/common')
-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; |