summaryrefslogtreecommitdiff
path: root/app/(auth)/signup.tsx
diff options
context:
space:
mode:
authorJustZvan <justzvan@justzvan.xyz>2026-04-06 15:32:51 +0200
committerJustZvan <justzvan@justzvan.xyz>2026-04-06 15:32:51 +0200
commit3273e7a0fbbce82f4ce6cacbcdb7b6d6848f6c1b (patch)
tree7662ab528c950e5b3605d3f134dc89f399417c8d /app/(auth)/signup.tsx
parent7eb8ccae48b0cc18a9dcaa9c3626a02df8e6d919 (diff)
feat: gallery scanning preferences
Diffstat (limited to 'app/(auth)/signup.tsx')
-rw-r--r--app/(auth)/signup.tsx43
1 files changed, 34 insertions, 9 deletions
diff --git a/app/(auth)/signup.tsx b/app/(auth)/signup.tsx
index 127ea9f..eded0b6 100644
--- a/app/(auth)/signup.tsx
+++ b/app/(auth)/signup.tsx
@@ -2,22 +2,28 @@ import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router";
import { useState } from "react";
import {
- KeyboardAvoidingView,
- Platform,
- ScrollView,
- StyleSheet,
- Text,
- TouchableOpacity,
- View,
+ KeyboardAvoidingView,
+ Platform,
+ ScrollView,
+ StyleSheet,
+ Text,
+ TouchableOpacity,
+ View,
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { useAuth } from "../../lib/auth";
+import { useGoogleAuth } from "../../lib/google-auth";
import { t } from "../../lib/locales";
import { colors } from "../../lib/theme";
import { Button, H1, Muted, TextInput } from "../../lib/ui";
export default function SignUp() {
const { signUp } = useAuth();
+ const {
+ continueWithGoogle,
+ isLoading: googleLoading,
+ error: googleError,
+ } = useGoogleAuth();
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [confirmPassword, setConfirmPassword] = useState("");
@@ -66,7 +72,7 @@ export default function SignUp() {
if (!result.success) {
setError(result.reason || t("signUpError"));
}
- } catch (e) {
+ } catch {
setError(t("signUpError"));
} finally {
setLoading(false);
@@ -129,8 +135,23 @@ export default function SignUp() {
title={t("signUp")}
onPress={handleSignUp}
loading={loading}
- disabled={loading}
+ disabled={loading || googleLoading}
/>
+
+ <Button
+ title={t("continueWithGoogle")}
+ variant="secondary"
+ onPress={continueWithGoogle}
+ loading={googleLoading}
+ disabled={loading || googleLoading}
+ />
+ <Muted style={styles.googleHelp}>
+ {t("googleAuthUnifiedHint")}
+ </Muted>
+
+ {googleError ? (
+ <Text style={styles.error}>{googleError}</Text>
+ ) : null}
</View>
<View style={styles.footer}>
@@ -171,6 +192,10 @@ const styles = StyleSheet.create({
fontSize: 14,
textAlign: "center",
},
+ googleHelp: {
+ textAlign: "center",
+ paddingHorizontal: 8,
+ },
footer: {
flexDirection: "row",
justifyContent: "center",