Waseel: driver app, dispatch, POI suggestions, map fixes
This commit is contained in:
+17
-13
@@ -4,10 +4,12 @@ import { Alert, Text, TouchableOpacity, View } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
|
||||
import { fetchAPI } from "@/lib/fetch";
|
||||
import { useT } from "@/lib/i18n";
|
||||
import { useSession } from "@/lib/session";
|
||||
|
||||
const RoleSelection = () => {
|
||||
const { setUserRole } = useSession();
|
||||
const t = useT();
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
||||
const chooseRole = async (role: "rider" | "driver") => {
|
||||
@@ -31,20 +33,20 @@ const RoleSelection = () => {
|
||||
);
|
||||
} catch (err) {
|
||||
console.log("[ROLE_SELECT]: ", err);
|
||||
Alert.alert("Error", "Could not save your choice. Please try again.");
|
||||
Alert.alert(t("auth.role.alertErrorTitle"), t("auth.role.alertErrorBody"));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView className="flex-1 bg-white justify-center px-7">
|
||||
<Text className="text-3xl font-JakartaExtraBold text-center">
|
||||
How will you use Waseel?
|
||||
<SafeAreaView className="flex-1 bg-white dark:bg-neutral-950 justify-center px-7">
|
||||
<Text className="text-3xl font-JakartaExtraBold text-center text-black dark:text-white">
|
||||
{t("auth.role.title")}
|
||||
</Text>
|
||||
|
||||
<Text className="text-base text-general-200 font-Jakarta text-center mt-3 mb-10">
|
||||
You can change this later by contacting support.
|
||||
<Text className="text-base text-general-200 dark:text-neutral-400 font-Jakarta text-center mt-3 mb-10">
|
||||
{t("auth.role.subtitle")}
|
||||
</Text>
|
||||
|
||||
<TouchableOpacity
|
||||
@@ -54,26 +56,28 @@ const RoleSelection = () => {
|
||||
>
|
||||
<Text className="text-5xl mb-3">🧍</Text>
|
||||
<Text className="text-2xl font-JakartaBold text-white">
|
||||
I'm a Rider
|
||||
{t("auth.role.riderTitle")}
|
||||
</Text>
|
||||
<Text className="text-sm font-Jakarta text-white/80 text-center mt-2">
|
||||
Book rides and get around Lebanon
|
||||
{t("auth.role.riderDesc")}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
onPress={() => chooseRole("driver")}
|
||||
disabled={saving}
|
||||
className="bg-general-600 rounded-2xl p-7 items-center"
|
||||
className="bg-general-600 dark:bg-primary-500/20 border border-primary-500 rounded-2xl p-7 items-center"
|
||||
>
|
||||
<Text className="text-5xl mb-3">🚗</Text>
|
||||
<Text className="text-2xl font-JakartaBold">I'm a Driver</Text>
|
||||
<Text className="text-sm font-Jakarta text-general-200 text-center mt-2">
|
||||
Give rides and earn money
|
||||
<Text className="text-2xl font-JakartaBold text-black dark:text-white">
|
||||
{t("auth.role.driverTitle")}
|
||||
</Text>
|
||||
<Text className="text-sm font-Jakarta text-general-200 dark:text-neutral-400 text-center mt-2">
|
||||
{t("auth.role.driverDesc")}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
export default RoleSelection;
|
||||
export default RoleSelection;
|
||||
Reference in New Issue
Block a user