-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: History chats calls implementation (#154)
What does this PR do? Display Message chat history screen for appointments that happened between a patient and a doctor. It also shows completed appointments Description of Task to be completed? Fetch booked appointment details from the database Track appointment booked with the current time to mark it as booked if it is passed that time How should this be manually tested? Log in and go to history you can switch between messages where you will find what was discussed in chats you had with a doctor. Navigate to the appointment screens and click on completed appointment to see the appointments which are passed the current time as they are considered completed you can also leave a review when the appointment has been completed by clicking on the leave review button Any background context you want to provide? N/A
- Loading branch information
Showing
17 changed files
with
269 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,51 @@ | ||
import React from "react"; | ||
import { View, ScrollView } from "react-native"; | ||
import DoctorVideo from "@/components/cards/DoctorVideo"; | ||
import { useRouter } from "expo-router"; | ||
import { DoctorCard } from "./types"; // Import the types | ||
// import React, {useState, useEffect} from "react"; | ||
// import { View, ScrollView } from "react-native"; | ||
// import DoctorVideo from "@/components/cards/DoctorVideo"; | ||
// import { useRouter } from "expo-router"; | ||
// import { DoctorCard } from "./types"; | ||
// import { supabase } from "../supabase"; | ||
// const VideoCall = () => { | ||
// const router = useRouter(); | ||
// const [appointment, setAppointment]=useState<any[]>([]); | ||
|
||
const VideoCall = () => { | ||
const router = useRouter(); | ||
// useEffect(()=>{ | ||
// const fetchAppointments=async()=>{ | ||
// const {data, error}=await supabase.auth.getUser(); | ||
// if(error) throw error; | ||
// const userId=data?.user?.id; | ||
// const {data:AppointmentData, error:Error}=await supabase.from("appointment").select("*, doctor(name,image)").eq("patient_id", userId).eq("package","Video Call") | ||
// if(Error) throw Error | ||
// if(AppointmentData){ | ||
// setAppointment(AppointmentData); | ||
// } | ||
// } | ||
// fetchAppointments(); | ||
// },[]) | ||
|
||
// const handlePress = (appointmentId:any) => { | ||
// router.push({ | ||
// pathname: "/chat-history/VideoRecord", | ||
// params: {appointmentId}, | ||
// }); | ||
// }; | ||
// return ( | ||
// <View style={{ backgroundColor: "white" }}> | ||
// <ScrollView style={{ backgroundColor: "#FAFAFA", paddingBottom: 6 }}> | ||
// {appointment.map((appointments, index) => ( | ||
// <DoctorVideo | ||
// key={index} | ||
// onPress={() => handlePress(appointments.id)} | ||
// doctorName={appointments.doctor.name} | ||
// doctorImage={appointments.doctor.image} | ||
// callType={appointments.package} | ||
// callDay={appointments.appointment_date} | ||
// callTime={appointments.appointment_time.slice(0,5)} | ||
// isVideoCallScreen={false} | ||
// /> | ||
// ))} | ||
// </ScrollView> | ||
// </View> | ||
// ); | ||
// }; | ||
|
||
const docCards: DoctorCard[] = [ | ||
{ | ||
name: "Dr. Randy Wigham", | ||
callDay: "Wednesday", | ||
callTime: "1:00 PM", | ||
images: require("../../assets/doctors/doc2.png"), | ||
}, | ||
{ | ||
name: "Dr. Jenny Watson", | ||
callDay: "Wednesday", | ||
callTime: "1:00 PM", | ||
images: require("../../assets/doctors/doc3.png"), | ||
}, | ||
{ | ||
name: "Dr. Raul Zirkind", | ||
callDay: "Wednesday", | ||
callTime: "1:00 PM", | ||
images: require("../../assets/doctors/doc1.png"), | ||
}, | ||
{ | ||
name: "Dr. Elijah Baranick", | ||
callDay: "Wednesday", | ||
callTime: "1:00 PM", | ||
images: require("../../assets/doctors/doc2.png"), | ||
}, | ||
{ | ||
name: "Dr. Stephen Shute", | ||
callDay: "Wednesday", | ||
callTime: "1:00 PM", | ||
images: require("../../assets/doctors/doc5.png"), | ||
}, | ||
]; | ||
|
||
const handlePress = (doctor: DoctorCard) => { | ||
router.push({ | ||
pathname: "/chat-history/VideoRecord", | ||
params: { doctor: JSON.stringify(doctor) }, | ||
}); | ||
}; | ||
|
||
return ( | ||
<View style={{ backgroundColor: "white" }}> | ||
<ScrollView style={{ backgroundColor: "#FAFAFA", paddingBottom: 6 }}> | ||
{docCards.map((doctor, index) => ( | ||
<DoctorVideo | ||
key={index} | ||
onPress={() => handlePress(doctor)} | ||
doctorName={doctor.name} | ||
doctorImage={doctor.images} | ||
callType="Video Call" | ||
callDay={doctor.callDay} | ||
callTime={doctor.callTime} | ||
isVideoCallScreen={false} | ||
/> | ||
))} | ||
</ScrollView> | ||
</View> | ||
); | ||
}; | ||
|
||
export default VideoCall; | ||
// export default VideoCall; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.