fix(mobile): keyboard-avoidance i Screen så formulär inte göms bakom tangentbordet (FAS 35)
CI / Typecheck, test & build (push) Successful in 1m40s

This commit is contained in:
Sven (AAMOS AI)
2026-08-14 04:01:44 +07:00
parent e3d50707e8
commit 5f9526cb07
5 changed files with 15 additions and 7 deletions
@@ -32,7 +32,7 @@ export default function ForgotPasswordScreen() {
if (sent) {
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<Title>{t("auth.forgotSentTitle")}</Title>
<Body muted>{t("auth.forgotSentBody")}</Body>
<Spacer size={spacing.sm} />
@@ -44,7 +44,7 @@ export default function ForgotPasswordScreen() {
}
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<Title>{t("auth.forgotTitle")}</Title>
<Body muted>{t("auth.forgotBody")}</Body>
<Input
+1 -1
View File
@@ -44,7 +44,7 @@ export default function LoginScreen() {
};
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<View style={{ alignItems: "center", marginBottom: spacing.lg }}>
<Title>{BRAND.name}</Title>
<Body muted>Hushållets mat-OS</Body>
+1 -1
View File
@@ -76,7 +76,7 @@ export default function RegisterScreen() {
};
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<View style={{ alignItems: "center", marginBottom: spacing.lg }}>
<Title>{t("auth.register")}</Title>
<Small>{t("auth.trialNote")}</Small>
@@ -38,7 +38,7 @@ export default function ResetPasswordScreen() {
if (done) {
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<Title>{t("auth.resetDoneTitle")}</Title>
<Body muted>{t("auth.resetDoneBody")}</Body>
<Spacer size={spacing.sm} />
@@ -48,7 +48,7 @@ export default function ResetPasswordScreen() {
}
return (
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
<Title>{t("auth.resetTitle")}</Title>
<Body muted>{t("auth.resetBody")}</Body>
{!params.token && (
+8
View File
@@ -1,6 +1,8 @@
import type { PropsWithChildren, ReactNode } from "react";
import {
ActivityIndicator,
KeyboardAvoidingView,
Platform,
Pressable,
ScrollView,
StyleSheet,
@@ -25,6 +27,7 @@ export function Screen({
<ScrollView
contentContainerStyle={[styles.screenContent, style]}
keyboardShouldPersistTaps="handled"
keyboardDismissMode="on-drag"
>
{children}
</ScrollView>
@@ -33,7 +36,12 @@ export function Screen({
);
return (
<SafeAreaView style={styles.screen} edges={["top"]}>
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior={Platform.OS === "ios" ? "padding" : undefined}
>
{content}
</KeyboardAvoidingView>
</SafeAreaView>
);
}