This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-Mob/app/(root)/auth/language.tsx
kirukib 7310a349c5 Add Gishen mobile app with complete demo shopping and care flows.
Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 01:21:32 +03:00

59 lines
2.1 KiB
TypeScript

import { router } from "expo-router";
import { useTranslation } from "react-i18next";
import { Pressable, View } from "react-native";
import { Button } from "@/components/ui/Button";
import { AppHeader } from "@/components/ui/Header";
import { Screen } from "@/components/ui/Screen";
import { Text } from "@/components/ui/Text";
import { routes } from "@/lib/routes";
import { useLangStore, type Language } from "@/lib/stores/langStore";
import { colors, gutter } from "@/lib/theme";
const OPTIONS: { code: Language; label: string; hint: string }[] = [
{ code: "en", label: "English", hint: "Continue in English" },
{ code: "am", label: "አማርኛ", hint: "በአማርኛ ይቀጥሉ" },
];
export default function LanguageScreen() {
const { t } = useTranslation();
const language = useLangStore((s) => s.language);
const setLanguage = useLangStore((s) => s.setLanguage);
return (
<Screen>
<AppHeader title={t("common.language")} subtitle="Choose your preferred language" />
<View style={{ flex: 1, paddingHorizontal: gutter, paddingTop: 8 }}>
<View style={{ gap: 12 }}>
{OPTIONS.map((opt) => {
const selected = language === opt.code;
return (
<Pressable
key={opt.code}
onPress={() => setLanguage(opt.code)}
style={{
padding: 18,
borderRadius: 20,
backgroundColor: colors.surface,
borderWidth: selected ? 2 : 1,
borderColor: selected ? colors.brand : colors.line,
}}
>
<Text variant="h3">{opt.label}</Text>
<Text variant="caption" color={colors.muted} style={{ marginTop: 4 }}>
{opt.hint}
</Text>
</Pressable>
);
})}
</View>
<View style={{ flex: 1 }} />
<Button
title={t("common.continue")}
onPress={() => router.push(routes.otp)}
style={{ marginBottom: 16 }}
/>
</View>
</Screen>
);
}