UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

33 lines (30 loc) • 1.44 kB
import { NAVIGATOR_CONFIG } from "../../headless/children.mjs"; import { PLATFORM } from "../../utils/platform.mjs"; import { convertFontWeightToStringFontWeight, flattenStyle } from "../../utils/style.mjs"; function StackHeaderTitle(_props) { return null; } Object.assign(StackHeaderTitle, { [NAVIGATOR_CONFIG]: true }); function appendStackHeaderTitlePropsToOptions(options, props) { const flattenedStyle = flattenStyle(props.style); const flattenedLargeStyle = flattenStyle(props.largeStyle); const titleStyle = flattenedStyle ? { ...flattenedStyle, ...flattenedStyle?.fontWeight ? { fontWeight: convertFontWeightToStringFontWeight(flattenedStyle.fontWeight) } : {} } : void 0; const largeTitleStyle = flattenedLargeStyle ? { ...flattenedLargeStyle, ...flattenedLargeStyle?.fontWeight ? { fontWeight: convertFontWeightToStringFontWeight(flattenedLargeStyle.fontWeight) } : {} } : void 0; return { ...options, title: props.children, headerLargeTitleEnabled: props.large, ...props.large && PLATFORM === "ios" && { headerTransparent: true }, headerTitleAlign: flattenedStyle?.textAlign, ...titleStyle && Object.keys(titleStyle).length > 0 && { headerTitleStyle: titleStyle }, ...largeTitleStyle && Object.keys(largeTitleStyle).length > 0 && { headerLargeTitleStyle: largeTitleStyle } }; } export { StackHeaderTitle, appendStackHeaderTitlePropsToOptions }; //# sourceMappingURL=StackHeaderTitle.mjs.map