diff --git a/app/(app)/History/MessageHistory/index.tsx b/app/(app)/History/MessageHistory/index.tsx index 5774aa9a..26154521 100644 --- a/app/(app)/History/MessageHistory/index.tsx +++ b/app/(app)/History/MessageHistory/index.tsx @@ -1,10 +1,196 @@ -import React from 'react' -import { Text, View } from 'react-native' +import { MoreIcon } from "@/assets/icons/MoreCircleSvg"; +import { SearchIcon } from "@/assets/icons/SearchSvg"; +import { Colors } from "@/constants/Colors"; +import Typography from "@/constants/Typography"; +import { router } from "expo-router"; +import { StatusBar } from "expo-status-bar"; +import React, { ReactElement, useState } from "react"; +import { Platform, TouchableOpacity } from "react-native"; +import { Image, ImageBackground, Text, View, FlatList,ScrollView } from "react-native"; +import { SvgXml } from "react-native-svg"; +import data from "../history.json" +import NofoundComponent from "@/components/NofoundComponent"; +import SearchComponent from "@/components/SearchComponent"; +import Historyheader from "@/components/Historyheader"; +import { DoctorComponentVoice,DoctorComponentVideo } from "@/components/CardComponent"; +import MessageComponent from "@/components/MessageComponent"; +import { rightArrow } from "@/assets/icons/Right_arrow"; + + + + +interface imageMapProp{ + [key:string]:ReturnType +} +interface iconMappingProp{ + [key :string]:ReactElement +} + +const imageMap:imageMapProp = { + 'doctor1.png': require("../../../../assets/images/Doctors/doctor1.png"), + 'doctor2.png': require("../../../../assets/images/Doctors/doctor2.png"), + 'doctor3.png': require("../../../../assets/images/Doctors/doctor3.png"), + 'doctor4.png': require("../../../../assets/images/Doctors/doctor4.png"), + 'doctor5.png':require("../../../../assets/images/Doctors/doctor5.png") + +} +export const iconMapping:iconMappingProp = { + rightArrow: , + +} const index = () => { + const [showSearch, setShowSearch] = useState(false) + const [searchTerm, setSearchTerm] = useState('') + const [selectedCategory, setSelectedCategory] = useState(data.categories[0]) + const handleSearchSubmit = (text: string) => { + setSearchTerm(text.toLowerCase()) + } + const handleSearchPressed = () => { + setShowSearch(true) + } + + const handleCategoryPressed = (category: any) => { + setSelectedCategory(category) + } + + const filteredDoctors=searchTerm.length>0 ? selectedCategory.Doctors.filter(doctor=>doctor.name.toLowerCase().includes(searchTerm)):selectedCategory.Doctors return ( - index - ) -} + + + + + + { + !showSearch ? ( + + ) + : ( + + ) + } + + + + + {data.categories.map((category, index) => + + handleCategoryPressed(category)} style={{display:"flex",justifyContent:"center",alignItems:"center"}}> + + {category.name} + + + + + )} + + + + + { + filteredDoctors.length > 0 ? ( + filteredDoctors.map((doctor: any, index: number) => ( + selectedCategory.name === "Messaging" ? ( + + ) :selectedCategory.name==="Voice Call"? + ( + + + ) : selectedCategory.name === "Video Call" ? + + ( + + + ):null + + + + )) + + ): + ( + + + ) + } + + + + + + ); +}; -export default index \ No newline at end of file +export default index; \ No newline at end of file diff --git a/app/(app)/History/VoiceCallHistory/index.tsx b/app/(app)/History/VoiceCallHistory/index.tsx index 199bccb7..a1b91a22 100644 --- a/app/(app)/History/VoiceCallHistory/index.tsx +++ b/app/(app)/History/VoiceCallHistory/index.tsx @@ -1,9 +1,9 @@ import React from 'react' -import { View } from 'react-native' +import { View,Text } from 'react-native' const index = () => { return ( - index + index ) } diff --git a/app/(app)/History/_layout.tsx b/app/(app)/History/_layout.tsx index a6e42e0b..f3d063c6 100644 --- a/app/(app)/History/_layout.tsx +++ b/app/(app)/History/_layout.tsx @@ -1,5 +1,9 @@ import { Stack } from "expo-router"; export default function Layout() { - return ; + return ( + + + + ); } diff --git a/app/(app)/History/history.json b/app/(app)/History/history.json new file mode 100644 index 00000000..ccd4b2a1 --- /dev/null +++ b/app/(app)/History/history.json @@ -0,0 +1,254 @@ +{ + "categories":[ + { + "name":"Messaging", + "Doctors":[ + { + "imageSource":"doctor1.png", + "name":"Dr. Travis Westaby", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor2.png", + "name":"Dr. Nathaniel Valle", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor3.png", + "name":"Dr. Beckett Calger", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor4.png", + "name":"Dr. Jada Srnsky", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor5.png", + "name":"Dr. Bernard Bliss", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor1.png", + "name":"Dr. Travis Westaby", + "iconComponent":"heart", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + } + ] + }, + { + "name":"Voice Call", + "Doctors":[ + { + "imageSource":"doctor1.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor2.png", + "name":"Dr. Nathaniel Valle", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor3.png", + "name":"Dr. Beckett Calger", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor4.png", + "name":"Dr. Jada Srnsky", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor5.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor2.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + } + ] + }, + { + "name":"Video Call", + "Doctors":[ + { + "imageSource":"doctor1.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor2.png", + "name":"Dr. Nathaniel Valle", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor3.png", + "name":"Dr. Beckett Calger", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor4.png", + "name":"Dr. Jada Srnsky", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor5.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + }, + { + "imageSource":"doctor2.png", + "name":"Dr. Travis Westaby", + "iconComponent":"rightArrow", + "professionalTitle":"Cardiologist", + "hospital":"Alka Hospital", + "timeFrame":"ToDay", + "time":"10:00 PM", + "Message":"My pleasure all the best Sir!", + "star":"star", + "review":"(4,5050 Reviews)", + "rate":"4.5" + } + ] + } + + ] +} \ No newline at end of file diff --git a/assets/icons/Right_arrow.ts b/assets/icons/Right_arrow.ts new file mode 100644 index 00000000..e73f001d --- /dev/null +++ b/assets/icons/Right_arrow.ts @@ -0,0 +1,10 @@ +export const rightArrow=` + + + + + + + + +` \ No newline at end of file diff --git a/components/CardComponent.tsx b/components/CardComponent.tsx new file mode 100644 index 00000000..0ff16917 --- /dev/null +++ b/components/CardComponent.tsx @@ -0,0 +1,137 @@ +import { Colors } from "@/constants/Colors"; +import Typography from "@/constants/Typography"; +import React, { ReactElement } from "react"; +import { Image, Text, TouchableOpacity } from "react-native"; +import { ImageURISource, View } from "react-native"; +import { router } from "expo-router"; +interface DoctorComponentProps { + imageSource: ImageURISource | number; + name: string; + iconComponent?: ReactElement; + method: string; + day: string; + time: string; +} +function DoctorComponentVoice({ + imageSource, + iconComponent, + name, + method, + day, + time, +}: DoctorComponentProps) { + return ( + router.push("History/VoiceCallHistory")} + style={{ + borderRadius: 10, + borderColor: "white", + flexDirection: "row", + alignItems: "center", + justifyContent: "space-between", + backgroundColor: Colors.others.white, + padding: 20, + shadowColor: "#cfcfcf", + shadowOffset: { width: -2, height: 4 }, + shadowOpacity: 3, + shadowRadius: 2, + elevation: 10, + marginBottom: 5, + marginTop:5 + }} + > + + + + + + {name} + {method} + + {day} | + {time} + + + + {iconComponent} + + ); +} + + + +function DoctorComponentVideo({ + imageSource, + iconComponent, + name, + method, + day, + time, +}: DoctorComponentProps) { + return ( + + + + + + + {name} + {method} + + {day} | + {time} + + + + {iconComponent} + + ); +} +export {DoctorComponentVoice,DoctorComponentVideo} \ No newline at end of file diff --git a/components/Historyheader.tsx b/components/Historyheader.tsx new file mode 100644 index 00000000..ae8cb0b7 --- /dev/null +++ b/components/Historyheader.tsx @@ -0,0 +1,64 @@ +import React from 'react'; + +import { MoreIcon } from "@/assets/icons/MoreCircleSvg"; +import { SearchIcon } from "@/assets/icons/SearchSvg"; +import { Colors } from "@/constants/Colors"; +import Typography from "@/constants/Typography"; +import { router } from "expo-router"; +import { StatusBar } from "expo-status-bar"; +import { Platform, TouchableOpacity } from "react-native"; +import { Image, ImageBackground, Text, View, FlatList } from "react-native"; +import { SvgXml } from "react-native-svg"; +import NofoundComponent from "@/components/NofoundComponent"; +import SearchComponent from "@/components/SearchComponent"; + +interface header{ + onSearchPressed: () => void, + +} + + +function Historyheader({onSearchPressed}:header) { + return ( + + + + + + + History + + + + + + + + + + + + + + + + + ); +} + +export default Historyheader; \ No newline at end of file diff --git a/components/MessageComponent.tsx b/components/MessageComponent.tsx new file mode 100644 index 00000000..196cddc3 --- /dev/null +++ b/components/MessageComponent.tsx @@ -0,0 +1,45 @@ +import { Colors } from "@/constants/Colors"; +import Typography from "@/constants/Typography"; +import React, { ReactElement } from "react"; +import { Image, Text, TouchableOpacity } from "react-native"; +import { ImageURISource, View } from "react-native"; +import { router } from "expo-router"; + +interface DoctorComponentProps { + imageSource: ImageURISource | number; + name: string; + iconComponent?: ReactElement; + time: string; + message: string, + timeFrame:string + +} +function MessageComponent({ + imageSource, + name, + timeFrame, + time, + message +}: DoctorComponentProps) { + return ( + router.push("History/MessageHistory/Chats")} + style={{flexDirection: "row", alignItems: "center", justifyContent: "space-between",marginBottom:20,borderWidth:1,borderColor:"white",backgroundColor:"white"}}> + + + + + + {name} + {message} + + + + {timeFrame} + {time} + + + ); +} + +export default MessageComponent; \ No newline at end of file diff --git a/components/SearchComponent.tsx b/components/SearchComponent.tsx index b0d0dd93..047abd28 100644 --- a/components/SearchComponent.tsx +++ b/components/SearchComponent.tsx @@ -10,7 +10,7 @@ import { router } from 'expo-router'; interface searchComponentProps{ onSearchSubmit: (searchTerm: string) => void, - filterAction:()=>void + filterAction?:()=>void } function SearchComponent({onSearchSubmit,filterAction}:searchComponentProps) { const [value, setValue] = useState("") @@ -60,6 +60,7 @@ const styles = StyleSheet.create({ flexDirection: 'row', justifyContent: "center", alignItems: "center", + }, outer: { width: "80%",