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:
parent
d1b344df42
commit
f8b2efa728
29
components/Header.tsx
Normal file
29
components/Header.tsx
Normal 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,
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user