Skip to content

Instantly share code, notes, and snippets.

@krose422
Created October 25, 2017 13:17
Show Gist options
  • Save krose422/ec503d74d691290a1fceae0614d4a57a to your computer and use it in GitHub Desktop.
Save krose422/ec503d74d691290a1fceae0614d4a57a to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {
StyleSheet,
View,
Modal,
ActivityIndicator
} from 'react-native';
const Loader = props => {
const {
loading,
...attributes
} = props;
return (
<Modal
transparent={true}
animationType={'none'}
visible={loading}
onRequestClose={() => {console.log('close modal')}}>
<View style={styles.modalBackground}>
<View style={styles.activityIndicatorWrapper}>
<ActivityIndicator
animating={loading} />
</View>
</View>
</Modal>
)
}
const styles = StyleSheet.create({
modalBackground: {
flex: 1,
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'space-around',
backgroundColor: '#00000040'
},
activityIndicatorWrapper: {
backgroundColor: '#FFFFFF',
height: 100,
width: 100,
borderRadius: 10,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-around'
}
});
export default Loader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment