2019-11-29 11:31:43 +05:00
|
|
|
import React from 'react';
|
|
|
|
|
import {View, TouchableOpacity, Platform, Text} from 'react-native';
|
2019-11-30 19:56:40 +05:00
|
|
|
import Icon from 'react-native-vector-icons/Feather';
|
2019-11-29 11:31:43 +05:00
|
|
|
import {SIZE, WEIGHT} from '../../common/common';
|
|
|
|
|
import {h} from '../../utils/utils';
|
|
|
|
|
|
|
|
|
|
export const Header = ({heading, colors, canGoBack = true}) => {
|
|
|
|
|
return (
|
|
|
|
|
<View
|
|
|
|
|
style={{
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
justifyContent: 'flex-start',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
paddingHorizontal: Platform.isPad ? '2.5%' : '5%',
|
|
|
|
|
marginTop: Platform.OS == 'ios' ? h * 0.02 : h * 0.04,
|
|
|
|
|
marginBottom: h * 0.04,
|
|
|
|
|
}}>
|
|
|
|
|
{canGoBack ? (
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
style={{
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
alignItems: 'center',
|
2019-12-05 17:40:09 +05:00
|
|
|
|
2019-11-30 19:56:40 +05:00
|
|
|
paddingRight: 15,
|
2019-11-29 11:31:43 +05:00
|
|
|
}}>
|
2019-11-30 19:56:40 +05:00
|
|
|
<Icon name={'chevron-left'} size={SIZE.xl} />
|
2019-11-29 11:31:43 +05:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
) : (
|
|
|
|
|
undefined
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<Text
|
|
|
|
|
style={{
|
|
|
|
|
fontSize: SIZE.xxl,
|
|
|
|
|
color: colors.pri,
|
|
|
|
|
fontFamily: WEIGHT.bold,
|
|
|
|
|
}}>
|
|
|
|
|
{heading}
|
|
|
|
|
</Text>
|
|
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
};
|