123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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(
- <TouchableWithoutFeedback style={styles.stdcontainer}>
- <ImageBackground style={styles.regcontainer} source={require('../../assets/yellow-white.jpg')}>
- <Text style={styles.stdcontainer}> Please select a time frame for the appointment</Text>
- <CustomButton marginTop={25} title="8:00am-9:00am" onPress={() => this.time_assignment(1,)}/>
-
- </ImageBackground>
- </TouchableWithoutFeedback>
- );
- }
- }
-
|