timepill-app/src/component/loading.js
xuwenyang 84ce205ee6 1. 用户详情页用户信息
2. 用户详情页今天日记列表
2019-05-20 22:16:47 +08:00

39 lines
No EOL
870 B
JavaScript

import React, { Component } from 'react';
import {StyleSheet, Text, View, ActivityIndicator} from 'react-native';
import Api from '../util/api'
export default class Loading extends Component {
constructor(props) {
super(props);
this.state = {
color: props.color ? props.color : '#aaa'
}
}
render() {
if (this.props.visible) {
return (
<View style={localStyle.loading}>
<ActivityIndicator size="large" color={this.state.color} />
</View>
);
} else {
return null;
}
}
}
const localStyle = StyleSheet.create({
loading: {
position: 'absolute',
left: 0,
width: Api.DEVICE_WINDOW.width,
top: 200,
justifyContent: 'center',
alignItems: 'center'
}
});