2023-12-22 22:40:24 -03:00
|
|
|
import {
|
|
|
|
View,
|
|
|
|
Text,
|
|
|
|
StyleSheet,
|
|
|
|
StyleProp,
|
|
|
|
ViewStyle,
|
|
|
|
Image,
|
|
|
|
} from 'react-native';
|
2023-12-06 00:39:45 -03:00
|
|
|
import Container from './Container';
|
|
|
|
|
|
|
|
interface HeaderProps {
|
|
|
|
title?: string;
|
|
|
|
subTitle?: string;
|
|
|
|
style?: StyleProp<ViewStyle>;
|
2023-12-22 22:40:24 -03:00
|
|
|
image?: string;
|
2023-12-06 00:39:45 -03:00
|
|
|
}
|
2023-12-22 22:40:24 -03:00
|
|
|
const Header = ({title, subTitle, style, image}: HeaderProps) => {
|
2023-12-06 00:39:45 -03:00
|
|
|
return (
|
|
|
|
<Container style={style}>
|
|
|
|
<View style={styles.contentContainer}>
|
|
|
|
<View style={styles.iconContainer}>
|
2023-12-22 22:40:24 -03:00
|
|
|
<Image
|
|
|
|
source={{
|
|
|
|
uri: 'https://cdn-icons-png.flaticon.com/512/8371/8371047.png',
|
|
|
|
}}
|
|
|
|
style={styles.icon}
|
|
|
|
/>
|
2023-12-06 00:39:45 -03:00
|
|
|
</View>
|
|
|
|
<View style={styles.titleContainer}>
|
|
|
|
<Text style={styles.title}>{title}</Text>
|
|
|
|
{subTitle && <Text style={styles.subTitle}>{subTitle}</Text>}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const defaultProps = {
|
|
|
|
title: 'Sin información',
|
|
|
|
subTitle: 'Sin información',
|
|
|
|
};
|
|
|
|
|
|
|
|
Header.defaultProps = defaultProps;
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
backgroundColor: 'orange',
|
|
|
|
},
|
|
|
|
contentContainer: {
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'stretch',
|
|
|
|
},
|
2023-12-22 22:40:24 -03:00
|
|
|
icon: {
|
|
|
|
width: 100,
|
|
|
|
height: 100,
|
|
|
|
resizeMode: 'contain',
|
|
|
|
},
|
2023-12-06 00:39:45 -03:00
|
|
|
iconContainer: {
|
|
|
|
justifyContent: 'center',
|
2023-12-22 22:40:24 -03:00
|
|
|
alignItems: 'center',
|
|
|
|
marginHorizontal: 8,
|
2023-12-06 00:39:45 -03:00
|
|
|
},
|
|
|
|
titleContainer: {
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'column',
|
|
|
|
justifyContent: 'center',
|
2023-12-22 22:40:24 -03:00
|
|
|
marginHorizontal: 16,
|
2023-12-06 00:39:45 -03:00
|
|
|
},
|
|
|
|
title: {
|
|
|
|
fontSize: 24,
|
|
|
|
fontWeight: 'bold',
|
|
|
|
color: 'white',
|
|
|
|
},
|
|
|
|
subTitle: {
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: 'normal',
|
|
|
|
color: 'white',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Header;
|