diff --git a/src/components/ClientAppointmentCard.js b/src/components/ClientAppointmentCard.js index 68d3f60..6da955a 100644 --- a/src/components/ClientAppointmentCard.js +++ b/src/components/ClientAppointmentCard.js @@ -53,7 +53,7 @@ export default class ClientAppointmentCard extends Component { this.props.service.crntState==="cancled"? ( - {this.props.service.title} + {this.props.service.title} at {this.state.businessName} @@ -71,15 +71,15 @@ export default class ClientAppointmentCard extends Component { ( this.props.service.crntState==="done"? ( - - {this.props.service.title} + + {this.props.service.title} at {this.state.businessName} {this.props.service.description} - Cancled + Done diff --git a/src/components/SignUpBusiness.js b/src/components/SignUpBusiness.js index e1019c1..be2b922 100644 --- a/src/components/SignUpBusiness.js +++ b/src/components/SignUpBusiness.js @@ -89,7 +89,7 @@ class SignuBusiness extends Component{ email: this.state.email, RegNo:this.state.registration_num, businessTypes:this.state.business_type, - type:this.state.business_type, + type:"business", imageURL:"https://firebasestorage.googleapis.com/v0/b/appointme-17cfe.appspot.com/o/profilePic%2Fgroup%20dp.png?alt=media&token=52b8eef0-465a-46c5-b2ce-a2b4367bac24", workingDays:this.state.workingDays, startTime:"06:00", diff --git a/src/components/appnmntModal.js b/src/components/appnmntModal.js index 9908edf..6d81cbc 100644 --- a/src/components/appnmntModal.js +++ b/src/components/appnmntModal.js @@ -58,26 +58,35 @@ class Appointment extends Component { this.setState({ number:num, }) - }).catch((error)=>{ - if(error) - { - console.log("eroor"); - this.setState({ - number:1, - }) - } - else{ - console.log("no erojoajj"); - } - }) + }); } + dateChanged=(newDate)=>{ + var dateDirect=newDate.getFullYear()+'/'+(newDate.getMonth()+1)+'/'+newDate.getDate(); + + firebase.database().ref('Appointments/'+this.state.businessId+'/'+dateDirect+'/variables').once('value').then((snapshot)=> { + var num=(snapshot.val().count)+1; + this.setState({ + number:num, + }) + }).catch((error)=> + { + this.setState({ + number:1, + }) + }); + } + handleChange=(e)=>{ this.setState({ [e.target.id]:e.target.value }) + if(e.target.id==="date") + { + this.dateChanged(e.target.value); + } } handleSelect=(e)=>{ diff --git a/src/components/home.js b/src/components/home.js index 5610ebe..7f51291 100644 --- a/src/components/home.js +++ b/src/components/home.js @@ -38,10 +38,16 @@ class Home extends Component { if(data_list) { var keys=Object.keys(data_list); + + var j=0; for(var i=0;i

Why are you wasting time in a queue?

Make an appointment easily from the world best appointment website. It will make your job easier

- Make an appointment + {/* Make an appointment */} @@ -172,9 +177,9 @@ class Home extends Component { { this.props.authenticated==="business"? ( -
- {this.state.noAppointment?

No appointments today

:{apponointments}} -
+ <> + {this.state.noAppointment?
No appointments today
:
{apponointments}
} + ): ( <> diff --git a/src/components/homePage/appointmentCard.js b/src/components/homePage/appointmentCard.js index a893d19..233a843 100644 --- a/src/components/homePage/appointmentCard.js +++ b/src/components/homePage/appointmentCard.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import {Card, CardImg, CardTitle, CardText, CardColumns,CardSubtitle, CardBody} from 'reactstrap'; +import {Card, CardImg, CardTitle, CardText, CardColumns,Badge,CardSubtitle, CardBody} from 'reactstrap'; import { MDBBtn } from "mdbreact"; export default class appointmentCard extends Component { @@ -9,7 +9,7 @@ export default class appointmentCard extends Component { return (
- {this.props.service.title} + {this.props.service.number}{this.props.service.title} {this.props.service.description}