fix(mobile): keyboard-avoidance i Screen så formulär inte göms bakom tangentbordet (FAS 35)
CI / Typecheck, test & build (push) Successful in 1m40s
CI / Typecheck, test & build (push) Successful in 1m40s
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 && (
|
||||
|
||||
@@ -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"]}>
|
||||
{content}
|
||||
<KeyboardAvoidingView
|
||||
style={{ flex: 1 }}
|
||||
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||
>
|
||||
{content}
|
||||
</KeyboardAvoidingView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user