feat: create Header component

- Add Header component with title prop
- Style with primary color background
- Learn: React.FC, interface props, StyleSheet
This commit is contained in:
Dita Aji Pratama 2026-04-18 12:20:41 +07:00
parent d1b344df42
commit f8b2efa728

29
components/Header.tsx Normal file
View File

@ -0,0 +1,29 @@
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { COLORS, FONTS } from '../constants/theme';
interface HeaderProps {
title: string;
}
export const Header: React.FC<HeaderProps> = ({ title }) => {
return (
<View style={styles.container}>
<Text style={styles.title}>{title}</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
backgroundColor: COLORS.primary,
padding: 20,
paddingTop: 50,
alignItems: 'center',
},
title: {
fontSize: FONTS.large,
fontWeight: 'bold',
color: COLORS.card,
},
});