import React, { Component } from "react";
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Image, Share, Alert } from "react-native";
import FastImage from 'react-native-fast-image'
import Icon from "react-native-vector-icons/FontAwesome5";
import Modal, { ModalContent } from 'react-native-modals';
import Switch from 'react-native-switch-pro';
import { colors } from "../../assets/styles/colors-theme";
import { Fonts } from '../../assets/styles/fonts-theme'
import Realm from 'realm'
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
import LoadingView from '../../common/loading';
import history from "../../common/history";
import NaviBar from "../../components/navi-bar";
import Migrations from "../../services/realm/Mirgrations";
import BackHeader from '../../components/backHeader'
import { inject, observer } from "mobx-react";
import { observable } from 'mobx'
import { queryUser } from "../../services/realm/realmManger";
import AsyncStorageHelper from '../../common/asyncStorageHelper'
import ImagePicker from 'react-native-image-crop-picker';
import { UserSchemea, ApartmentSchemea, DocSchemea,NotificationSchemea} from '../../services/realm/schemeas'
import { width, height } from "../../common/screen";
const asyncStorageHelper = new AsyncStorageHelper;

let realm = new Realm({ schema: [UserSchemea, ApartmentSchemea, DocSchemea,NotificationSchemea] });

@inject("appStore")
@observer
export default class GetApartmentRef extends Component {

    @observable
    AddTenantSwitch: false
    
    @observable
    apartmentData = {}
    constructor(props) {
        super(props);
        this.store = props.appStore;
    }


    componentWillMount(){
       this.store.createApartmentRefCode(this.props.navigation.state.params.id)
    }


    componentDidMount() {

    }

    renderRefCode(){
        if(this.apartmentData){
            return(
                <View>
                    <Text>
                        {'refCode: '}
                    </Text>
                </View>
            )
        }
    }

    
    render() {

        return (
            <View
                style={{
                    flex: 1
                }}
            >
                <LoadingView visible={this.store.loading} />

                <BackHeader instance={this} back={true} />
        
            </View >
        );
    }
}

const styles = StyleSheet.flatten({
    button: {
        marginTop: 20,
        width: 100,
        height: 40,
        alignItems: "center",
        justifyContent: "center",
        backgroundColor: colors.statusBarColor
    },
    buttonText: {
        color: "#fff"
    },
    textView: {
        color: colors.textColor,
        fontFamily: Fonts.ubuntu,
        fontSize: 17,
    },
    slide1: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',

    },

    shadowView: {
        width: scale(280),
        height: verticalScale(460),
        alignItems: 'center',
        borderWidth: 0.5,
        backgroundColor: 'white',
        borderColor: '#EAEDED',
        shadowColor: "#000",
        shadowOffset: {
            width: 0,
            height: 1,
        },
        shadowOpacity: 0.20,
        shadowRadius: 1.41,

        elevation: 2,
    },

    text: {
        marginTop: 7,
        color: colors.textColor,
        fontSize: 19,
        fontFamily: Fonts.ubuntu,
    },

});
