UNPKG

@nexara/nativeflow

Version:

Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.

78 lines (75 loc) 2.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _ResponsiveCalculations = require("../../helpers/ResponsiveCalculations.js"); var _index = require("../StyledComponents/index.js"); var _theme = require("../../constants/theme.js"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } const Header = ({ title = 'Header', titleSize = 13, titleColor = _theme.DefaultTheme.TEXT_TARTARY_COLOR, titleAlignment = 'center', bg = '#000', renderRightIcon, renderLeftIcon }) => { const Styles = _reactNative.StyleSheet.create({ MAIN_CONT: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', paddingVertical: (0, _ResponsiveCalculations.moderateVerticalScale)(13), paddingHorizontal: (0, _ResponsiveCalculations.moderateScale)(10), backgroundColor: bg, gap: (0, _ResponsiveCalculations.moderateScale)(10) }, TEXT: { fontSize: titleSize && (0, _ResponsiveCalculations.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__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: Styles.MAIN_CONT, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: Styles.RIGHT_ICON, children: renderLeftIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity // onPress={() => navigation.goBack()} , { children: renderLeftIcon() }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: { flex: 1 }, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StyledText, { primary: true, style: Styles.TEXT, tas: true, children: title }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: Styles.LEFT_ICON, children: renderRightIcon && renderRightIcon() })] }) }); }; var _default = exports.default = Header; //# sourceMappingURL=Header.js.map