import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  Modal,
  ActivityIndicator,
  TouchableHighlight,
  Text
} from 'react-native';
import history from "./history";
import Global from '../services/Global'
 export default class AddFunction extends Component {
     render(){
         return(
    <Modal
      transparent={true}
      animationType={'none'}
      visible={this.props.visible}
      onRequestClose={() => {console.log('c lose modal')}}>
      <View style={styles.modalBackground}>
      <TouchableHighlight onPress = {this.props.close}>
          <Text>
              close
          </Text>
      </TouchableHighlight>
        <View style={styles.activityIndicatorWrapper}>
        <TouchableHighlight onPress = {()=>history.push(this.props.instance, '/apartmentDetails')}>
          <Text>
              Add Apartment
          </Text>
      </TouchableHighlight>
        </View>
      </View>
    </Modal>
  )
}
}


const styles = StyleSheet.create({
  modalBackground: {
    flex: 1,
    alignItems: 'center',
    flexDirection: 'column',
    justifyContent: 'center',
    backgroundColor: '#00000040'
  },
  activityIndicatorWrapper: {
    backgroundColor: '#FFFFFF',
    height: 100,
    width: 100,
    borderRadius: 10,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'space-around'
  }
});
