Waseel: driver app, dispatch, POI suggestions, map fixes
This commit is contained in:
@@ -4,13 +4,17 @@ import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { RideCard } from "@/components/ride-card";
|
||||
import { images } from "@/constants";
|
||||
import { useFetch } from "@/lib/fetch";
|
||||
import { useT } from "@/lib/i18n";
|
||||
import { useTheme } from "@/lib/theme";
|
||||
import type { Ride } from "@/types/type";
|
||||
|
||||
const Rides = () => {
|
||||
const { data: recentRides, loading } = useFetch<Ride[]>("/(api)/ride/list");
|
||||
const { isDark } = useTheme();
|
||||
const t = useT();
|
||||
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<SafeAreaView className="bg-general-500 dark:bg-neutral-950">
|
||||
<FlatList
|
||||
data={recentRides}
|
||||
renderItem={({ item }) => <RideCard ride={item} />}
|
||||
@@ -25,23 +29,27 @@ const Rides = () => {
|
||||
<>
|
||||
<Image
|
||||
source={images.noResult}
|
||||
alt="No recent rides found"
|
||||
alt={t("rides.noRecentAlt")}
|
||||
className="w-40 h-40"
|
||||
resizeMode="contain"
|
||||
/>
|
||||
<Text className="text-sm">No recent rides found.</Text>
|
||||
<Text className="text-sm text-black dark:text-white">
|
||||
{t("rides.noRecent")}
|
||||
</Text>
|
||||
</>
|
||||
) : (
|
||||
<ActivityIndicator size="small" color="#000" />
|
||||
<ActivityIndicator size="small" color={isDark ? "#fff" : "#000"} />
|
||||
)}
|
||||
</View>
|
||||
}
|
||||
ListHeaderComponent={
|
||||
<Text className="text-2xl font-JakartaBold my-5">All rides</Text>
|
||||
<Text className="text-2xl font-JakartaBold my-5 text-black dark:text-white">
|
||||
{t("rides.allRides")}
|
||||
</Text>
|
||||
}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
export default Rides;
|
||||
export default Rides;
|
||||
Reference in New Issue
Block a user