nexara-nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
73 lines (70 loc) • 2.14 kB
JavaScript
"use strict";
import React from 'react';
import { View, StyleSheet, TouchableOpacity } from 'react-native';
import { moderateScale, moderateVerticalScale, responsiveFontSize } from "../../helpers/ResponsiveCalculations.js";
import { StyledText } from "../StyledComponents/index.js";
import { DefaultTheme } from "../../constants/theme.js";
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
const Header = ({
title = 'Header',
titleSize = 13,
titleColor = DefaultTheme.TEXT_TARTARY_COLOR,
titleAlignment = 'center',
bg = '#000',
renderRightIcon,
renderLeftIcon
}) => {
const Styles = StyleSheet.create({
MAIN_CONT: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingVertical: moderateVerticalScale(13),
paddingHorizontal: moderateScale(10),
backgroundColor: bg,
gap: moderateScale(10)
},
TEXT: {
fontSize: titleSize && responsiveFontSize(titleSize),
textAlign: titleAlignment,
color: titleColor
// fontFamily: FONTS_STYLES.POPPINS_SEMI_BOLD
},
RIGHT_ICON: {
flexGrow: renderRightIcon && 0.1
},
LEFT_ICON: {
flexGrow: renderLeftIcon && 0.1,
alignItems: 'flex-end'
}
});
// const navigation = useNavigation();
return /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsxs(View, {
style: Styles.MAIN_CONT,
children: [/*#__PURE__*/_jsx(View, {
style: Styles.RIGHT_ICON,
children: renderLeftIcon && /*#__PURE__*/_jsx(TouchableOpacity
// onPress={() => navigation.goBack()}
, {
children: renderLeftIcon()
})
}), /*#__PURE__*/_jsx(View, {
style: {
flex: 1
},
children: /*#__PURE__*/_jsx(StyledText, {
primary: true,
style: Styles.TEXT,
tas: true,
children: title
})
}), /*#__PURE__*/_jsx(View, {
style: Styles.LEFT_ICON,
children: renderRightIcon && renderRightIcon()
})]
})
});
};
export default Header;
//# sourceMappingURL=Header.js.map