Files
notesnook/apps/mobile/src/components/header/index.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

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-11-30 19:56:40 +05:00
height: 40,
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>
);
};