Created
October 25, 2017 13:17
-
-
Save krose422/ec503d74d691290a1fceae0614d4a57a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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