Skip to content

Commit

Permalink
Feat(Favorite Doctor) add state management to change button backgroun…
Browse files Browse the repository at this point in the history
…d if it is selected
  • Loading branch information
23nosurrend committed May 17, 2024
1 parent 2c69035 commit 9f38d85
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 439 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Online Doctor Appointment & Consultation App

# Test coverage

[![codecov](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica/graph/badge.svg?token=5OP0X0107C)](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica)

For coverage on other branches, please visit the [Codecov project page](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica) and select the appropriate branch.


## Table Of Content

- [Medica App](#medica-app)
Expand Down Expand Up @@ -124,8 +131,3 @@ Feel free to reach out to us:
## License

None At the moment !!
# Test coverage

[![codecov](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica/graph/badge.svg?token=5OP0X0107C)](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica)

For coverage on other branches, please visit the [Codecov project page](https://codecov.io/gh/atlp-rwanda/matadors-rn-medica) and select the appropriate branch.
11 changes: 8 additions & 3 deletions app/(app)/ActionMenu/FavoriteDoctorScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ function DoctorScreen() {
}}>

{data.categories.map((category, index) =>
<Pressable key={index} onPress={()=>handleCategoryChange(category)} style={[styles.categoryBtn,index==0?styles.firstCategoryBtn:{}]}>
<Pressable key={index} onPress={() => handleCategoryChange(category)} style={[styles.categoryBtn,
selectedCategory === category ? styles.firstCategoryBtn : {},
]}>

<Text style={[styles.categoryBtnText,index===0?styles.firstCategoryBtnText:{}]}>{category.name}</Text>
<Text style={[
styles.categoryBtnText,
selectedCategory === category ? styles.firstCategoryBtnText : {},
]}>{category.name}</Text>

</Pressable>
)}
Expand Down Expand Up @@ -256,7 +261,7 @@ const styles = StyleSheet.create({
},
body: {
width: "98%",
backgroundColor: "#F7F7F7",
backgroundColor:"#F7F7F7",
},
scroll: {
width: "100%",
Expand Down
14 changes: 7 additions & 7 deletions app/doctors.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"Doctors":[
{
"imageSource":"doctor1.png",
"name":"dentist Dr. Travis Westaby",
"name":"Dr. Travis Westaby",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"Alka Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand All @@ -147,7 +147,7 @@
"imageSource":"doctor2.png",
"name":"Dr. Nathaniel Valle",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"B&B Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand All @@ -157,7 +157,7 @@
"imageSource":"doctor3.png",
"name":"Dr. Beckett Calger",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"Venus Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand All @@ -167,7 +167,7 @@
"imageSource":"doctor4.png",
"name":"Dr. Jada Srnsky",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"Alka Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand All @@ -177,7 +177,7 @@
"imageSource":"doctor5.png",
"name":"Dr. Bernard Bliss",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"The Valley Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand All @@ -187,7 +187,7 @@
"imageSource":"doctor1.png",
"name":"Dr. Travis Westaby",
"iconComponent":"heart",
"professionalTitle":"Cardiologist",
"professionalTitle":"Dentist",
"hospital":"Alka Hospital",
"star":"star",
"review":"(4,5050 Reviews)",
Expand Down
Loading

0 comments on commit 9f38d85

Please sign in to comment.