Files
native-app/apps/mobile/components/layout/screenLayout.tsx
2024-01-22 22:43:19 +01:00

25 lines
693 B
TypeScript

import { View } from 'react-native';
import { BoldText, RegularText } from '../ui/Text';
type Props = {
title?: React.ReactNode | string;
subtitle?: string;
children?: React.ReactNode;
};
export default function ScreenLayout({ title, subtitle, children }: Props) {
return (
<View className="bg-shade-900 flex-1 py-12">
{typeof title === 'string' && (
<BoldText className="text-2xl font-bold text-white">{title}</BoldText>
)}
{typeof title !== 'string' && title}
<RegularText className="text-shade-200 mt-1 text-sm">
{subtitle}
</RegularText>
<View className="py-3">{children}</View>
</View>
);
}