one
Version:
One is a new React Framework that makes Vite serve both native and web.
38 lines (37 loc) • 1.57 kB
JavaScript
import { Platform, StyleSheet } from "react-native-web";
import { convertFontWeightToStringFontWeight } from "../../utils/style";
function StackHeaderTitle(_props) {
return null;
}
function appendStackHeaderTitlePropsToOptions(options, props) {
const flattenedStyle = StyleSheet.flatten(props.style), flattenedLargeStyle = StyleSheet.flatten(props.largeStyle), titleStyle = flattenedStyle ? {
...flattenedStyle,
...flattenedStyle?.fontWeight ? { fontWeight: convertFontWeightToStringFontWeight(flattenedStyle.fontWeight) } : {}
} : void 0, largeTitleStyle = flattenedLargeStyle ? {
...flattenedLargeStyle,
...flattenedLargeStyle?.fontWeight ? {
fontWeight: 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 && 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
}
};
}
export {
StackHeaderTitle,
appendStackHeaderTitlePropsToOptions
};
//# sourceMappingURL=StackHeaderTitle.js.map