Files
mattermost-mobile/app/components/loading.js
2018-06-19 19:14:50 -04:00

52 lines
1.1 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {
ActivityIndicator,
StyleSheet,
View,
ViewPropTypes,
} from 'react-native';
export default class Loading extends PureComponent {
static propTypes = {
size: PropTypes.string,
color: PropTypes.string,
style: ViewPropTypes.style,
};
static defaultProps = {
size: 'large',
color: 'grey',
style: {},
};
render() {
return (
<View style={styles.container}>
<ActivityIndicator
style={[styles.loading, this.props.style]}
animating={true}
size={this.props.size}
color={this.props.color}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
loading: {
marginLeft: 3,
},
});