import { ReactNode } from 'react'; import { Keyboard, KeyboardAvoidingView, Platform, ScrollView, StyleProp, TouchableWithoutFeedback, View, ViewStyle, } from 'react-native'; export interface KeyboardAwareScreenProps { children: ReactNode; /** * Extra offset for `keyboardVerticalOffset` on iOS. For screens wrapped in * `` this should be 0 (default) — the SafeAreaView already * absorbs the top inset. For screens that own their header with * `paddingTop: insets.top` baked in (e.g. profile/edit), pass the full * header height so iOS computes the correct push distance. */ headerOffset?: number; /** * When true, wraps children in a `ScrollView`. Use for long forms (sign-up, * profile-edit). When false (default), a plain `View` fills the remaining * space — tap anywhere outside an input dismisses the keyboard. */ scrollable?: boolean; /** Style applied to the outer KeyboardAvoidingView. */ style?: StyleProp; /** Style applied to the inner container (ScrollView or View). */ contentContainerStyle?: StyleProp; } export function KeyboardAwareScreen({ children, headerOffset = 0, scrollable = false, style, contentContainerStyle, }: KeyboardAwareScreenProps) { return ( {scrollable ? ( {children} ) : ( {children} )} ); }