managarten/apps/manadeck/apps/mobile/components/ui/PageHeader.tsx
Wuesteon ff80aeec1f refactor: restructure
monorepo with apps/ and services/
  directories
2025-11-26 03:03:24 +01:00

41 lines
1.2 KiB
TypeScript

import React from 'react';
import { View, Platform } from 'react-native';
import { Text } from './Text';
import { useThemeColors } from '~/utils/themeUtils';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { spacing } from '~/utils/spacing';
interface PageHeaderProps {
title: string;
withHorizontalPadding?: boolean;
}
export function PageHeader({ title, withHorizontalPadding = true }: PageHeaderProps) {
const colors = useThemeColors();
const insets = useSafeAreaInsets();
return (
<View
style={{
paddingTop: Platform.OS === 'ios' ? insets.top + spacing.lg : spacing.lg,
paddingHorizontal: withHorizontalPadding ? spacing.container.horizontal : 0,
paddingBottom: spacing.lg,
backgroundColor: colors.background,
borderBottomWidth: 1,
borderBottomColor: colors.border,
}}>
<View style={{ paddingHorizontal: withHorizontalPadding ? 0 : spacing.container.horizontal }}>
<Text
style={{
fontSize: 28,
fontWeight: '700',
color: colors.foreground,
letterSpacing: 0.3,
lineHeight: 34,
}}>
{title}
</Text>
</View>
</View>
);
}