|
@@ -1,12 +1,15 @@
|
|
|
-import { StyleSheet, Text, View } from 'react-native'
|
|
|
+import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'
|
|
|
import React from 'react'
|
|
|
import fonts from '../../theme/fonts'
|
|
|
import colors from '../../theme/colors'
|
|
|
+import FeatherIcon from 'react-native-vector-icons/dist/Feather'
|
|
|
|
|
|
-
|
|
|
-const Header = ({style,children}) => {
|
|
|
+const Header = ({ style, children, backButtonShown, onBackClick }) => {
|
|
|
return (
|
|
|
- <View style={[styles.headerContainer,style]}>
|
|
|
+ <View style={[styles.headerContainer, style]}>
|
|
|
+ {backButtonShown === true && backButtonShown !== undefined ? <TouchableOpacity onPress={onBackClick}>
|
|
|
+ <FeatherIcon name={'chevron-left'} size={24} color={colors.black} />
|
|
|
+ </TouchableOpacity> : <></>}
|
|
|
{children}
|
|
|
</View>
|
|
|
)
|
|
@@ -15,13 +18,13 @@ const Header = ({style,children}) => {
|
|
|
export default Header
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
- headerContainer:{
|
|
|
- paddingHorizontal: fonts.getSize(20),
|
|
|
- flexDirection: 'row',
|
|
|
- alignItems:'center',
|
|
|
- justifyContent:'space-between',
|
|
|
- height: 60,
|
|
|
- maxHeight: 60,
|
|
|
- backgroundColor: colors.white
|
|
|
- }
|
|
|
+ headerContainer: {
|
|
|
+ paddingHorizontal: fonts.getSize(20),
|
|
|
+ flexDirection: 'row',
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'space-between',
|
|
|
+ height: 60,
|
|
|
+ maxHeight: 60,
|
|
|
+ backgroundColor: colors.white
|
|
|
+ }
|
|
|
})
|