UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

53 lines (52 loc) 2.59 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 }); }, __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var StackHeaderTitle_exports = {}; __export(StackHeaderTitle_exports, { StackHeaderTitle: () => StackHeaderTitle, appendStackHeaderTitlePropsToOptions: () => appendStackHeaderTitlePropsToOptions }); module.exports = __toCommonJS(StackHeaderTitle_exports); var import_react_native = require("react-native-web"), import_style = require("../../utils/style"); function StackHeaderTitle(_props) { return null; } function appendStackHeaderTitlePropsToOptions(options, props) { const flattenedStyle = import_react_native.StyleSheet.flatten(props.style), flattenedLargeStyle = import_react_native.StyleSheet.flatten(props.largeStyle), titleStyle = flattenedStyle ? { ...flattenedStyle, ...flattenedStyle?.fontWeight ? { fontWeight: (0, import_style.convertFontWeightToStringFontWeight)(flattenedStyle.fontWeight) } : {} } : void 0, largeTitleStyle = flattenedLargeStyle ? { ...flattenedLargeStyle, ...flattenedLargeStyle?.fontWeight ? { fontWeight: (0, import_style.convertFontWeightToStringFontWeight)( flattenedLargeStyle.fontWeight ) } : {} } : void 0; return { ...options, title: props.children, headerLargeTitle: props.large, // Large titles on iOS require headerTransparent for proper scroll behavior // Only set on iOS since headerLargeTitle is iOS-only ...props.large && import_react_native.Platform.OS === "ios" && { headerTransparent: !0 }, headerTitleAlign: flattenedStyle?.textAlign, // Only set styles when explicitly configured to avoid interfering with native defaults ...titleStyle && Object.keys(titleStyle).length > 0 && { headerTitleStyle: titleStyle }, ...largeTitleStyle && Object.keys(largeTitleStyle).length > 0 && { headerLargeTitleStyle: largeTitleStyle } }; } //# sourceMappingURL=StackHeaderTitle.js.map