import React from "react"; import firebase from "firebase"; import { Component } from "react"; import { TouchableWithoutFeedback, ImageBackground, Text } from "react-native"; import { styles } from "../../config/styles"; import CustomButton from "../../components/CustomButton"; export default class Time extends Component{ constructor(props){ super(props); this.state = { Appointment : this.props.route.params.Appointment_Date, int2_id : this.props.route.params.int_id, } this.time_assignment = this.time_assignment.bind(this); } time_assignment(desired_time, selectedTime){ if(desired_time == 1){ selectedTime = "8:00am-9:00am" } console.log(this.props.route.params) const user = firebase.auth().currentUser const uid = user.uid const month = this.state.Appointment.month const day = this.state.Appointment.day const _time_ = selectedTime const i_id = this.state.int2_id firebase.firestore() .collection('APPOINTMENTS') .add({ i_id : i_id, uid1: uid, Month : month, Day: day, Time: _time_}) this.props.navigation.navigate('Home') } render(){ return( Please select a time frame for the appointment this.time_assignment(1,)}/> ); } }