Skip to content

Commit

Permalink
fix:add loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Latiah committed Jul 24, 2024
1 parent feb0dbe commit cbd52c6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 52 deletions.
18 changes: 9 additions & 9 deletions app/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Profile = () => {
nextTo: "notification",
leftIcon: icons.notification,
},
{ text: t("profile.payment"), nextTo: "payment", leftIcon: icons.wallet },
// { text: t("profile.payment"), nextTo: "payment", leftIcon: icons.wallet },
{
text: t("profile.security"),
nextTo: "security",
Expand All @@ -101,12 +101,12 @@ const Profile = () => {
nextTo: "language",
leftIcon: icons.language,
},
{
text: t("profile.dark_mode"),
nextTo: "mode",
leftIcon: icons.eye,
mode: true,
},
// {
// text: t("profile.dark_mode"),
// nextTo: "mode",
// leftIcon: icons.eye,
// mode: true,
// },
{
text: t("profile.help_center"),
nextTo: "help",
Expand Down Expand Up @@ -192,9 +192,9 @@ const Profile = () => {
{t("profile.title")}
</Text>
</View>
<Touchable>
{/* <Touchable>
<SvgXml xml={moreOutlinedIcon} className="self-end" />
</Touchable>
</Touchable> */}
</View>
<ScrollView
className="flex-1 p-6"
Expand Down
30 changes: 4 additions & 26 deletions app/Doctors/searchDoctor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,22 @@ import { View, Image, Animated,
Easing
} from "react-native";
import { SearchInput } from "../../components/searchinput2";
import { UIActivityIndicator } from "react-native-indicators";

export default function searchDoctor() {

const [selectedCategory, setSelectedCategory] = useState("all");
const [searchQuery, setSearchQuery] = useState("");
const [selectedRating, setSelectedRating] = useState(0);
const rotateValue = new Animated.Value(0);
const rotate = rotateValue.interpolate({
inputRange: [0, 1],
outputRange: ["0deg", "360deg"],
});
const [loading, setLoading]=useState(true);

const spin = () => {
rotateValue.setValue(0);
Animated.timing(rotateValue, {
toValue: 1,
duration: 2500,
easing: Easing.linear,
useNativeDriver: true,
}).start(() => {
setTimeout(() => {
}, 2000);
});
};
useEffect(() => {

spin();

}
)


return (
<View className="flex-1 bg-white px-4 py-5">
<View className="flex-1 justify-center items-center">
<View>
<Animated.View style={{ transform: [{ rotate }] }}>
<Image source={require("../../assets/doctors/loading.png")} />
</Animated.View>
<UIActivityIndicator color={"#246BFD"} size={32} />
</View>
</View>
</View>
Expand Down
8 changes: 2 additions & 6 deletions app/articles/ArticlesDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Share,
} from "react-native";
import { supabase } from "../supabase";

import { UIActivityIndicator } from "react-native-indicators";
interface Article {
id: string;
title: string;
Expand Down Expand Up @@ -209,11 +209,7 @@ export default function ArticlesDetails() {
if (loading) {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text
style={{ fontSize: 20, fontFamily: "UrbanistBold", color: "#212121" }}
>
Loading...
</Text>
<UIActivityIndicator color={"#246BFD"} size={32} />
</View>
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/articles/ArticlesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { router, useLocalSearchParams, useNavigation } from "expo-router";
import FieldComponent from "@/components/FieldComponent";
import ArticleCard from "@/components/cards/ArticleCard";
import { supabase } from "../supabase";

import { UIActivityIndicator } from "react-native-indicators";
interface Article {
id: number;
title: string;
Expand Down Expand Up @@ -76,7 +76,7 @@ export default function Article() {
if (loading) {
return (
<View style={styles.loadingContainer}>
<Text style={styles.loadingText}>Loading...</Text>
<UIActivityIndicator color={"#246BFD"} size={32} />
</View>
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/articles/BookMarkedArticle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ScrollView,
TouchableOpacity,
} from "react-native";

import { UIActivityIndicator } from "react-native-indicators";
interface Article {
id: number;
title: string;
Expand Down Expand Up @@ -133,7 +133,7 @@ export default function BookMarkedArticle() {

<ScrollView showsVerticalScrollIndicator={false}>
{loading ? (
<Text>Loading...</Text>
<UIActivityIndicator color={"#246BFD"} size={32} />
) : (
bookmarkedArticles.map((article, index) => (
<ArticleCard key={index} article={article} />
Expand Down
1 change: 0 additions & 1 deletion app/articles/SeeAllArticles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { router, useNavigation } from "expo-router";
import FieldComponent from "@/components/FieldComponent";
import ArticleCard from "@/components/cards/ArticleCard";
import { supabase } from "../supabase";

interface Article {
id: number;
title: string;
Expand Down
8 changes: 4 additions & 4 deletions app/chat-history/chatHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ if(MessageError)throw MessageError;
fetchAppointments();
},[])
const renderHistory = (appointment: any, index:number) => {
const latestMessage = messages
.filter((message: any) => message.appointment_id === appointment.id)
.slice(-1)[0]?.message;
return (
<View key={index} className="flex flex-row w-1/1 justify-between items-center py-3 ">
<View className="flex-none w-[20%]">
Expand All @@ -70,15 +73,12 @@ fetchAppointments();
<Text className="font-UrbanistBold text-[16px] pb-2">
{appointment.doctor.name}
</Text>
<Text className="font-UrbanistRegular text-grey">...</Text>
<Text className="font-UrbanistRegular text-grey"> {latestMessage ? latestMessage: ""}</Text>
</TouchableOpacity>
<View className="flex-auto w-[30%] justify-start">
<Text className="font-UrbanistRegular text-grey pb-2 text-right">
{appointment.appointment_date}
</Text>
<Text className="font-UrbanistRegular text-grey text-right">
{appointment.appointment_time.slice(0,5)}
</Text>
</View>
</View>
);
Expand Down
4 changes: 2 additions & 2 deletions app/settings/friends.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { router } from "expo-router";
import { Icon } from "@/components/Icon";
import * as Contacts from "expo-contacts";
import { supabase } from "../supabase";

import { UIActivityIndicator } from "react-native-indicators";
interface Contact {
image: any;
name: string;
Expand Down Expand Up @@ -167,7 +167,7 @@ export default function Friends() {
if (loading) {
return (
<View className="flex-1 justify-center items-center bg-white">
<Text>Loading...</Text>
<UIActivityIndicator color={"#246BFD"} size={32} />
</View>
);
}
Expand Down

0 comments on commit cbd52c6

Please sign in to comment.