summaryrefslogtreecommitdiff
path: root/app/(auth)/signin.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)/signin.tsx
parent7eb8ccae48b0cc18a9dcaa9c3626a02df8e6d919 (diff)
feat: gallery scanning preferences
Diffstat (limited to 'app/(auth)/signin.tsx')
-rw-r--r--app/(auth)/signin.tsx40
1 files changed, 38 insertions, 2 deletions
diff --git a/app/(auth)/signin.tsx b/app/(auth)/signin.tsx
index 1eac63b..e2d0eda 100644
--- a/app/(auth)/signin.tsx
+++ b/app/(auth)/signin.tsx
@@ -12,12 +12,18 @@ import {
} 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 SignIn() {
const { signIn } = useAuth();
+ const {
+ continueWithGoogle,
+ isLoading: googleLoading,
+ error: googleError,
+ } = useGoogleAuth();
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [loading, setLoading] = useState(false);
@@ -55,7 +61,7 @@ export default function SignIn() {
if (!result.success) {
setError(result.reason || t("signInError"));
}
- } catch (e) {
+ } catch {
setError(t("signInError"));
} finally {
setLoading(false);
@@ -103,14 +109,36 @@ export default function SignIn() {
error={passwordError}
/>
+ <TouchableOpacity
+ onPress={() => router.push("/(auth)/reset-password")}
+ style={styles.forgotPasswordLinkContainer}
+ >
+ <Text style={styles.link}>{t("forgotPassword")}</Text>
+ </TouchableOpacity>
+
{error ? <Text style={styles.error}>{error}</Text> : null}
<Button
title={t("signIn")}
onPress={handleSignIn}
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}>
@@ -151,6 +179,10 @@ const styles = StyleSheet.create({
fontSize: 14,
textAlign: "center",
},
+ googleHelp: {
+ textAlign: "center",
+ paddingHorizontal: 8,
+ },
footer: {
flexDirection: "row",
justifyContent: "center",
@@ -162,4 +194,8 @@ const styles = StyleSheet.create({
color: colors.primary,
fontWeight: "700",
},
+ forgotPasswordLinkContainer: {
+ alignItems: "flex-end",
+ marginTop: -8,
+ },
});