34 lines
771 B
TypeScript
34 lines
771 B
TypeScript
import React from "react";
|
|
import {
|
|
View,
|
|
ViewProps,
|
|
SafeAreaView,
|
|
Platform,
|
|
StatusBar,
|
|
} from "react-native";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface ScreenWrapperProps extends ViewProps {
|
|
children: React.ReactNode;
|
|
withSafeArea?: boolean;
|
|
fixedHeader?: boolean;
|
|
}
|
|
|
|
export function ScreenWrapper({
|
|
children,
|
|
className,
|
|
containerClassName,
|
|
withSafeArea = true,
|
|
fixedHeader = false,
|
|
...props
|
|
}: ScreenWrapperProps & { containerClassName?: string }) {
|
|
const Container = withSafeArea ? SafeAreaView : View;
|
|
|
|
return (
|
|
<View className={cn("flex-1 bg-background", containerClassName)} {...props}>
|
|
<StatusBar barStyle="dark-content" />
|
|
<Container className={cn("flex-1", className)}>{children}</Container>
|
|
</View>
|
|
);
|
|
}
|