mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 12:23:24 +00:00
21 lines
602 B
TypeScript
21 lines
602 B
TypeScript
import { Text, View } from 'react-native';
|
|
|
|
type Props = {
|
|
title?: React.ReactNode | string;
|
|
subtitle?: string;
|
|
children?: React.ReactNode;
|
|
};
|
|
|
|
export default function ScreenLayout({ title, subtitle, children }: Props) {
|
|
return (
|
|
<View tw="bg-shade-900 flex-1 p-12">
|
|
{typeof title === 'string' && (
|
|
<Text className="text-2xl font-bold text-white">{title}</Text>
|
|
)}
|
|
{typeof title !== 'string' && title}
|
|
<Text className="mt-1 text-sm font-bold text-white">{subtitle}</Text>
|
|
<View className="py-3">{children}</View>
|
|
</View>
|
|
);
|
|
}
|