Yaltopia-Tickets-App/components/ScreenWrapper.tsx
2026-03-01 14:43:12 +03:00

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>
);
}