20 lines
432 B
TypeScript
20 lines
432 B
TypeScript
|
|
import { ScrollView } from "react-native";
|
||
|
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||
|
|
|
||
|
|
export function SafeAreaScrollView({ children }: React.PropsWithChildren) {
|
||
|
|
const insets = useSafeAreaInsets();
|
||
|
|
|
||
|
|
return (
|
||
|
|
<ScrollView
|
||
|
|
style={{
|
||
|
|
paddingTop: insets.top,
|
||
|
|
paddingBottom: insets.bottom,
|
||
|
|
paddingLeft: insets.left,
|
||
|
|
paddingRight: insets.right,
|
||
|
|
}}
|
||
|
|
>
|
||
|
|
{children}
|
||
|
|
</ScrollView>
|
||
|
|
);
|
||
|
|
}
|