import React, { Component } from 'react';
import { View, Modal, ActivityIndicator } from 'react-native';
import Text from './Text';

export default class IndicatorLoading extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }

  render() {
    return (
      <View>
        <Modal animationType="none"
          transparent={true}
          visible={this.props.loadingVisible}
          onRequestClose={() => {
            Alert.alert('Modal has been closed.');
          }}>
            <View style={{flex:1,backgroundColor:'#00000080',justifyContent:'center',alignItems:'center'}}>
              <View style={{padding:16,flexDirection:'row',backgroundColor:'white',borderRadius:10,justifyContent:'center',alignItems:'center'}}>
                <ActivityIndicator size="large" color="gray" />
                <Text style={{fontSize: 14,marginLeft: 10,}}>Loading...</Text>
              </View>
            </View>
        </Modal>
      </View>
    );
  }
}
