Open History to see the last commit
1import type { ReactNode } from "react";
2import { Platform, View } from "react-native";
3
4export function ScreenContent({
5 children,
6 insetHorizontal = false,
7 fitToContents = false,
8}: {
9 readonly children: ReactNode;
10 readonly insetHorizontal?: boolean;
11 readonly fitToContents?: boolean;
12}) {
13 if (Platform.OS !== "android") return children;
14
15 return (
16 <View className={fitToContents ? "shrink bg-header" : "flex-1 bg-header"}>
17 <View
18 className="overflow-hidden rounded-t-[28px] bg-sheet-solid"
19 style={{
20 flexShrink: 1,
21 flexGrow: fitToContents ? 0 : 1,
22 flexBasis: fitToContents ? "auto" : 0,
23 marginHorizontal: insetHorizontal ? 4 : 0,
24 }}
25 >
26 {children}
27 </View>
28 </View>
29 );
30}