Skip to content

Commit 9523da5

Browse files
authored
Merge pull request #168 from atlp-rwanda/ft-fetch-articles-data
Integrate Supabase for Article Fetching, Update Project Images, and Add Social Sharing Functionality
2 parents 2bae82e + 1d1cce6 commit 9523da5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3227
-4255
lines changed

Diff for: .env.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare module '@env' {
2+
export const API_URL: string;
3+
export const APP_MAJOR_VERSION: string;
4+
export const APP_MINOR_VERSION: string;
5+
export const APP_PATCH_VERSION: string;
6+
}

Diff for: .env.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
EXPO_PUBLIC_API_URL=http://api.local
2-
EXPO_PUBLIC_API_KEY=api_key
2+
EXPO_PUBLIC_API_KEY=api_key
3+
4+
SUPABASE_URL=SUPABASE_URL
5+
SUPABASE_NON_KEY=SUPABASE_NON_KEY

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules/
77
dist/
88
web-build/
99
.env
10+
.env.example
1011

1112
# Native
1213
*.orig.*

Diff for: app/(app)/ActionMenu/AllDoctorScreen.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function DoctorScreen() {
9292
}
9393
setDoctors(data)
9494

95-
console.log('Fetched data:', data);
95+
// console.log('Fetched data:', data);
9696
}
9797

9898
fetchData();

Diff for: app/(app)/ActionMenu/FavoriteDoctorScreen.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ function DoctorScreen() {
9191
}
9292
setDoctors(data)
9393

94-
console.log('Fetched data:', data);
9594
}
9695

9796
fetchData();

Diff for: app/(app)/Appointments/MessagingAppointment/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
import { backArrowWhite } from "@/components/UI/icons/backArrow";
2626
import { WhiteMenuCircle } from "@/components/UI/icons/WhiteMenuCircle";
2727
import { MoreIcon } from "@/assets/icons/MoreCircleSvg";
28+
import { backArrowBlackIcon } from '@/constants/icon'
2829

2930
interface PatientType {
3031
id: string;
@@ -93,7 +94,7 @@ function AppointmentMessaging() {
9394
theme === "light" ? Colors.others.white : Colors.dark._1,
9495
}}
9596
>
96-
<SvgXml xml={backArrowWhite} />
97+
<SvgXml xml={theme === 'dark' ? backArrowWhite : backArrowBlackIcon } />
9798
<Text
9899
style={{
99100
fontSize: 24,

Diff for: app/(app)/Appointments/Review/ReviewBlankform.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import {
5959
</Text>
6060
</View>
6161
<View style={{ gap: 24, justifyContent: "center", alignItems: "center" }}>
62-
<Image source={require("@/assets/images/Drake.png")} />
62+
<Image source={require("@/assets/images/Drake.png")} style={{width: 200, height: 200, borderRadius: 100}}/>
6363
<Text
6464
style={[
6565
Typography.heading._5,

Diff for: app/(app)/Appointments/Review/ReviewScreen.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const [rating, setRating ] = useState(0);
3737
</View>
3838

3939
<View>
40-
<Image source={require('@/assets/images/Drake.png')} />
40+
<Image source={require('@/assets/images/Drake.png')} style={{width: 200, height: 200, borderRadius: 100}}/>
4141
</View>
4242
<View style={{justifyContent:'center', alignItems: 'center'}}>
4343
<Text style={[Typography.heading._5, {color: theme === 'dark' ? '#FFFFFF' : '#212121', width: 260}]}>How was your experience

Diff for: app/(app)/Appointments/VideoCallAppointment/VideoCall.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
<ImageBackground
1919
style={styles.Background}
2020
resizeMode="cover"
21-
source={require("@/assets/images/MariaBackblur.png")}
21+
source={require("@/assets/images/Dr maria.png")}
2222
>
2323
<View style={styles.backArrow}>
2424
<TouchableOpacity onPress={()=> router.back()}>
@@ -29,7 +29,7 @@ import {
2929

3030
<View style={styles.middlePart}>
3131
<View style={styles.patient}>
32-
<Image source={require('@/assets/images/SinglePatient.png')} />
32+
<Image source={require('@/assets/images/SinglePatient.png')} style={{width: 120, height: 180, borderRadius: 20}}/>
3333

3434
<TouchableOpacity style={{position:'relative', marginTop: '-27%',marginLeft: '72%'}}>
3535
<SvgXml xml={CameraIcon} />

Diff for: app/(app)/Appointments/VideoCallAppointment/VideoCallRinging.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
</View>
2929

3030
<View style={styles.middlePart}>
31-
<Image source={require("@/assets/images/MariaEllipse.png")} />
31+
<Image source={require("@/assets/images/Dr jenny.png")} style={{width: 200, height: 200, borderRadius: 100}}/>
3232

3333
<View style={styles.middleText}>
3434
<Text style={[Typography.heading._3, { color: "#FFFFFF" }]}>

Diff for: app/(app)/Appointments/VideoCallAppointment/VideoCallSessionEnded.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const SessionEnded = () => {
6666
</View>
6767

6868
<View style={styles.detail}>
69-
<Image source={require("@/assets/images/MariaSmallEllipse.png")} />
69+
<Image source={require("@/assets/images/Dr maria.png")} style={{width: 200, height: 200, borderRadius: 100}}/>
7070
{doctorDetails &&
7171
doctorDetails.map((data: doctor) => (
7272
<View style={styles.detail}>

Diff for: app/(app)/Appointments/VoiceCallAppointment/SessionEnded.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const SessionEnded = () => {
6666
</View>
6767

6868
<View style={styles.detail}>
69-
<Image source={require("@/assets/images/Jenny.png")} />
69+
<Image source={require("@/assets/images/Jenny.png")} style={{width: 200, height: 200, borderRadius: 100}}/>
7070
{doctorDetails &&
7171
doctorDetails.map((data: doctor) => (
7272
<View style={styles.detail}>

Diff for: app/(app)/Appointments/VoiceCallAppointment/VoiceCallRinging.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const VoiceCallRinging = () => {
2828
</View>
2929

3030
<View style={styles.middlePart}>
31-
<Image source={require("@/assets/images/Jenny.png")} />
31+
<Image source={require("@/assets/images/Jenny.png")} style={{width: 200, height: 200, borderRadius: 100}}/>
3232

3333
<View style={styles.middleText}>
3434
<Text style={[Typography.heading._3, { color: "#FFFFFF" }]}>

Diff for: app/(app)/Articles/ArticleDetails.tsx

-82
This file was deleted.

Diff for: app/(app)/Articles/ArticleSeeAll.tsx

+90-33
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,109 @@
1-
2-
import React ,{ useContext }from 'react';
3-
import { View, Text, Image, SafeAreaView, ScrollView,TouchableOpacity, Pressable } from 'react-native';
4-
import {router, useNavigation } from 'expo-router';
1+
import React, { useContext, useState } from "react";
2+
import {
3+
View,
4+
Text,
5+
SafeAreaView,
6+
ScrollView,
7+
TouchableOpacity,
8+
Pressable,
9+
} from "react-native";
10+
import { router } from "expo-router";
511
import FieldComponent from "@/components/FieldComponent";
6-
import ArticleCard from '@/components/cards/ArticleCard';
7-
import { articles } from "@/constants/Articles";
8-
import { Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons';
12+
import ArticleCard from "@/components/cards/ArticleCard";
13+
import {
14+
Ionicons,
15+
MaterialCommunityIcons,
16+
MaterialIcons,
17+
} from "@expo/vector-icons";
918
import { ThemeContext } from "@/ctx/ThemeContext";
1019

11-
1220
export default function SeeAllArticles() {
1321
const { theme, changeTheme } = useContext(ThemeContext);
22+
1423
return (
15-
<SafeAreaView style={{ paddingTop: 40, backgroundColor: theme === "light" ? "#FFFFFF" : "#181A20" ,height: "100%"}}>
24+
<SafeAreaView
25+
style={{
26+
paddingTop: 40,
27+
backgroundColor: theme === "light" ? "#FFFFFF" : "#181A20",
28+
height: "100%",
29+
}}
30+
>
1631
<ScrollView showsVerticalScrollIndicator={false}>
17-
<View style={{ display: "flex", flexDirection: "row", justifyContent: "space-between" }}>
18-
<View style={{ display: "flex", flexDirection: "row", gap: 15, padding: 15 }}>
19-
<Pressable
20-
onPress={()=> router.back()}
32+
<View
33+
style={{
34+
display: "flex",
35+
flexDirection: "row",
36+
justifyContent: "space-between",
37+
}}
38+
>
39+
<View
40+
style={{
41+
display: "flex",
42+
flexDirection: "row",
43+
gap: 15,
44+
padding: 15,
45+
}}
46+
>
47+
<Pressable
48+
onPress={() => router.back()}
49+
style={{
50+
paddingTop: 5,
51+
}}
52+
>
53+
<MaterialIcons
54+
name="arrow-back"
55+
size={23}
2156
style={{
22-
paddingTop: 5
23-
}}
24-
><MaterialIcons name="arrow-back" size={23} style={{
2557
alignSelf: "center",
26-
color: theme === 'light' ? '#212121' : '#FFFFFF',
27-
}}/>
28-
</Pressable>
29-
<Text style={{ fontSize: 24,color: theme === 'light' ? '#212121' : '#FFFFFF',}}>Articles</Text>
58+
color: theme === "light" ? "#212121" : "#FFFFFF",
59+
}}
60+
/>
61+
</Pressable>
62+
<Text
63+
style={{
64+
fontSize: 24,
65+
color: theme === "light" ? "#212121" : "#FFFFFF",
66+
}}
67+
>
68+
Articles
69+
</Text>
3070
</View>
31-
<View style={{ display: "flex", flexDirection: "row", gap: 15, padding: 15 }}>
71+
<View
72+
style={{
73+
display: "flex",
74+
flexDirection: "row",
75+
gap: 15,
76+
padding: 15,
77+
}}
78+
>
3279
<TouchableOpacity>
33-
<Ionicons name="search-outline" size={24} style={{ color: theme === 'light' ? "#212121" : '#FFFFFF' }} />
34-
</TouchableOpacity>
80+
<Ionicons
81+
name="search-outline"
82+
size={24}
83+
style={{ color: theme === "light" ? "#212121" : "#FFFFFF" }}
84+
/>
85+
</TouchableOpacity>
86+
3587
<TouchableOpacity>
36-
<MaterialCommunityIcons name="dots-horizontal-circle-outline" size={24} style={{color: theme === 'light' ? "#212121" : '#FFFFFF'}} />
37-
</TouchableOpacity>
88+
<MaterialCommunityIcons
89+
name="dots-horizontal-circle-outline"
90+
size={24}
91+
style={{ color: theme === "light" ? "#212121" : "#FFFFFF" }}
92+
/>
93+
</TouchableOpacity>
3894
</View>
3995
</View>
40-
<View style={{padding:5}}>
41-
<FieldComponent/>
42-
96+
<View style={{ padding: 5 }}>
97+
<FieldComponent />
4398
</View>
44-
45-
46-
<ScrollView style={{marginTop:10}}showsVerticalScrollIndicator={false}>
47-
{articles.map((article, index) => <ArticleCard key={index} article={article}/>)}
99+
100+
<ScrollView
101+
style={{ marginTop: 10 }}
102+
showsVerticalScrollIndicator={false}
103+
>
104+
<ArticleCard />
48105
</ScrollView>
49106
</ScrollView>
50107
</SafeAreaView>
51108
);
52-
}
109+
}

0 commit comments

Comments
 (0)