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) {
|
if (sent) {
|
||||||
return (
|
return (
|
||||||
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
|
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
|
||||||
<Title>{t("auth.forgotSentTitle")}</Title>
|
<Title>{t("auth.forgotSentTitle")}</Title>
|
||||||
<Body muted>{t("auth.forgotSentBody")}</Body>
|
<Body muted>{t("auth.forgotSentBody")}</Body>
|
||||||
<Spacer size={spacing.sm} />
|
<Spacer size={spacing.sm} />
|
||||||
@@ -44,7 +44,7 @@ export default function ForgotPasswordScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
|
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
|
||||||
<Title>{t("auth.forgotTitle")}</Title>
|
<Title>{t("auth.forgotTitle")}</Title>
|
||||||
<Body muted>{t("auth.forgotBody")}</Body>
|
<Body muted>{t("auth.forgotBody")}</Body>
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default function LoginScreen() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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 }}>
|
<View style={{ alignItems: "center", marginBottom: spacing.lg }}>
|
||||||
<Title>{BRAND.name}</Title>
|
<Title>{BRAND.name}</Title>
|
||||||
<Body muted>Hushållets mat-OS</Body>
|
<Body muted>Hushållets mat-OS</Body>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default function RegisterScreen() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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 }}>
|
<View style={{ alignItems: "center", marginBottom: spacing.lg }}>
|
||||||
<Title>{t("auth.register")}</Title>
|
<Title>{t("auth.register")}</Title>
|
||||||
<Small>{t("auth.trialNote")}</Small>
|
<Small>{t("auth.trialNote")}</Small>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function ResetPasswordScreen() {
|
|||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
return (
|
return (
|
||||||
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
|
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
|
||||||
<Title>{t("auth.resetDoneTitle")}</Title>
|
<Title>{t("auth.resetDoneTitle")}</Title>
|
||||||
<Body muted>{t("auth.resetDoneBody")}</Body>
|
<Body muted>{t("auth.resetDoneBody")}</Body>
|
||||||
<Spacer size={spacing.sm} />
|
<Spacer size={spacing.sm} />
|
||||||
@@ -48,7 +48,7 @@ export default function ResetPasswordScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Screen scroll={false} style={{ justifyContent: "center", gap: spacing.md }}>
|
<Screen style={{ flexGrow: 1, justifyContent: "center", gap: spacing.md }}>
|
||||||
<Title>{t("auth.resetTitle")}</Title>
|
<Title>{t("auth.resetTitle")}</Title>
|
||||||
<Body muted>{t("auth.resetBody")}</Body>
|
<Body muted>{t("auth.resetBody")}</Body>
|
||||||
{!params.token && (
|
{!params.token && (
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import type { PropsWithChildren, ReactNode } from "react";
|
import type { PropsWithChildren, ReactNode } from "react";
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
Pressable,
|
Pressable,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
@@ -25,6 +27,7 @@ export function Screen({
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={[styles.screenContent, style]}
|
contentContainerStyle={[styles.screenContent, style]}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
|
keyboardDismissMode="on-drag"
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
@@ -33,7 +36,12 @@ export function Screen({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.screen} edges={["top"]}>
|
<SafeAreaView style={styles.screen} edges={["top"]}>
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||||
|
>
|
||||||
{content}
|
{content}
|
||||||
|
</KeyboardAvoidingView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user