import React from 'react'; import { StyleSheet, View, Text, Linking, StyleProp, TextStyle, ViewStyle, } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { DrawerNavigationProp } from '@react-navigation/drawer'; import { Header as HeaderRNE, HeaderProps, Icon } from 'react-native-elements'; import { TouchableOpacity } from 'react-native-gesture-handler'; type HeaderComponentProps = { title: string; view?: string; }; type ParamList = { Detail: { openDrawer: void; }; }; const Header: React.FunctionComponent = (props) => { const navigation = useNavigation>(); const docsNavigate = () => { Linking.openURL(`https://reactnativeelements.com/docs/${props.view}`); }; const playgroundNavigate = () => { Linking.openURL(`https://react-native-elements.js.org/#/${props.view}`); }; return ( ) } centerComponent={{ text: props.title, style: styles.heading }} /> ); }; type SubHeaderProps = { title: string; textStyle?: StyleProp; containerStyle?: StyleProp; }; const SubHeader = ({ title, containerStyle, textStyle }: SubHeaderProps) => { return ( {title} ); }; const styles = StyleSheet.create({ headerContainer: { justifyContent: 'center', alignItems: 'center', backgroundColor: '#397af8', marginBottom: 20, width: '100%', paddingVertical: 15, }, heading: { color: 'white', fontSize: 22, fontWeight: 'bold', }, headerRight: { display: 'flex', flexDirection: 'row', marginTop: 5, }, subheaderText: { color: 'white', fontSize: 16, fontWeight: 'bold', }, }); export { Header, SubHeader };