147 lines
6.1 KiB
React
147 lines
6.1 KiB
React
// Metro module 4551 (f4552).
|
|
import _objectWithoutProperties from "./_objectWithoutProperties";
|
|
import Module19 from "react";
|
|
import { Image as Image2, StyleSheet, Platform } from "react-native";
|
|
import { useEdgeInsetApplication } from "./Module4552";
|
|
import { isHeaderBarButtonsAvailableForCurrentPlatform } from "./Module4548";
|
|
import { prepareHeaderBarButtonItems } from "./prepareMenu";
|
|
import Module4554 from "./Module4554";
|
|
import Module4549 from "./Module4549";
|
|
import Module4555 from "./Module4555";
|
|
import { HermesBuiltin } from "../_hermes/prelude";
|
|
let styles;
|
|
const _excluded = ["style"];
|
|
const _excluded2 = ["style"];
|
|
const _excluded3 = ["style"];
|
|
Platform;
|
|
const r29 = Module19.forwardRef((a0, a1) => {
|
|
let disableLeftInsetApplication = a0.disableLeftInsetApplication;
|
|
if (disableLeftInsetApplication == null) {
|
|
disableLeftInsetApplication = false;
|
|
}
|
|
let disableRightInsetApplication = a0.disableRightInsetApplication;
|
|
if (disableRightInsetApplication == null) {
|
|
disableRightInsetApplication = false;
|
|
}
|
|
let disableBottomInsetApplication = a0.disableBottomInsetApplication;
|
|
if (disableBottomInsetApplication == null) {
|
|
disableBottomInsetApplication = false;
|
|
}
|
|
const edgeInsetApplication = useEdgeInsetApplication(disableLeftInsetApplication, disableRightInsetApplication, disableBottomInsetApplication);
|
|
const { consumeLeftInset, consumeRightInset, consumeBottomInset } = edgeInsetApplication;
|
|
const { headerLeftBarButtonItems, headerRightBarButtonItems } = a0;
|
|
const headerLeftBarButtonItems2 = headerLeftBarButtonItems ? isHeaderBarButtonsAvailableForCurrentPlatform ? prepareHeaderBarButtonItems(headerLeftBarButtonItems, "left") : void 0 : void 0;
|
|
let c14324_0 = headerLeftBarButtonItems2;
|
|
const headerRightBarButtonItems2 = headerRightBarButtonItems ? isHeaderBarButtonsAvailableForCurrentPlatform ? prepareHeaderBarButtonItems(headerRightBarButtonItems, "right") : void 0 : void 0;
|
|
let c14324_1 = headerRightBarButtonItems2;
|
|
const r43 = isHeaderBarButtonsAvailableForCurrentPlatform && (headerLeftBarButtonItems2?.length || headerRightBarButtonItems2?.length);
|
|
return <Module4554 {...a0} userInterfaceStyle={a0.experimental_userInterfaceStyle} consumeLeftInset={consumeLeftInset} consumeRightInset={consumeRightInset} consumeBottomInset={consumeBottomInset} headerLeftBarButtonItems={headerLeftBarButtonItems2} headerRightBarButtonItems={headerRightBarButtonItems2} onPressHeaderBarButtonItem={r43 ? (c25246_0) => {
|
|
let r5 = c14324_0;
|
|
if (r5 == null) {
|
|
r5 = [];
|
|
}
|
|
const r9 = [];
|
|
const r0 = HermesBuiltin.arraySpread(r9, r5, 0);
|
|
let r10 = c14324_1;
|
|
if (r10 == null) {
|
|
r10 = [];
|
|
}
|
|
HermesBuiltin.arraySpread(r9, r10, r0);
|
|
const r17 = r9.find((item) => (item ? "buttonId" in item : item) && item.buttonId === c25246_0.nativeEvent.buttonId);
|
|
if (r17 && r17.type === "button" && r17.onPress) {
|
|
r17.onPress();
|
|
}
|
|
} : void 0} onPressHeaderBarButtonMenuItem={r43 ? (a0) => {
|
|
const findInMenu2 = (a0, a1) => {
|
|
let r39;
|
|
for (const item of a0.items) {
|
|
L9: {
|
|
if ("items" in item) {
|
|
const r38 = findInMenu2(item, a1);
|
|
r39 = r38;
|
|
if (r38) {
|
|
break L9;
|
|
}
|
|
continue;
|
|
}
|
|
if (!("menuId" in item)) {
|
|
continue;
|
|
}
|
|
if (item.menuId !== a1) {
|
|
continue;
|
|
}
|
|
return item;
|
|
}
|
|
return r39;
|
|
}
|
|
};
|
|
let r4 = c14324_0;
|
|
if (r4 == null) {
|
|
r4 = [];
|
|
}
|
|
const r24 = [];
|
|
const r25 = HermesBuiltin.arraySpread(r24, r4, 0);
|
|
let r26 = c14324_1;
|
|
if (r26 == null) {
|
|
r26 = [];
|
|
}
|
|
HermesBuiltin.arraySpread(r24, r26, r25);
|
|
for (const item of r24) {
|
|
if (!item) {
|
|
continue;
|
|
}
|
|
if (item.type !== "menu") {
|
|
continue;
|
|
}
|
|
if (!item.menu) {
|
|
continue;
|
|
}
|
|
const r46 = findInMenu2(item.menu, a0.nativeEvent.menuId);
|
|
if (!r46) {
|
|
continue;
|
|
}
|
|
r46.onPress();
|
|
return void 0;
|
|
}
|
|
} : void 0} ref={a1} style={styles.headerConfig} pointerEvents="box-none" synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderConfigUpdatesEnabled} />;
|
|
});
|
|
r29.displayName = "ScreenStackHeaderConfig";
|
|
styles = StyleSheet.create({
|
|
headerSubview: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
justifyContent: "center"
|
|
},
|
|
headerSubviewCenter: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
flexShrink: 1
|
|
},
|
|
headerConfig: {
|
|
position: "absolute",
|
|
width: "100%",
|
|
flexDirection: "row",
|
|
justifyContent: "space-between",
|
|
alignItems: void 0
|
|
}
|
|
});
|
|
export { Module4555 as ScreenStackHeaderSubview };
|
|
export { r29 as ScreenStackHeaderConfig };
|
|
export const ScreenStackHeaderBackButtonImage = (a0) => <Module4555 type="back" style={styles.headerSubview} synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderSubviewUpdatesEnabled}>
|
|
<Image2 resizeMode="center" fadeDuration={0} {...a0} />
|
|
</Module4555>;
|
|
export const ScreenStackHeaderRightView = (a0) => {
|
|
const style = a0.style;
|
|
return <Module4555 {..._objectWithoutProperties(a0, _excluded)} type="right" synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderSubviewUpdatesEnabled} style={[styles.headerSubview, style]} />;
|
|
};
|
|
export const ScreenStackHeaderLeftView = (a0) => {
|
|
const style = a0.style;
|
|
return <Module4555 {..._objectWithoutProperties(a0, _excluded2)} type="left" synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderSubviewUpdatesEnabled} style={[styles.headerSubview, style]} />;
|
|
};
|
|
export const ScreenStackHeaderCenterView = (a0) => {
|
|
const style = a0.style;
|
|
return <Module4555 {..._objectWithoutProperties(a0, _excluded3)} type="center" synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderSubviewUpdatesEnabled} style={[styles.headerSubviewCenter, style]} />;
|
|
};
|
|
export const ScreenStackHeaderSearchBarView = (a0) => <Module4555 {...a0} type="searchBar" synchronousShadowStateUpdatesEnabled={Module4549.experiment.synchronousHeaderSubviewUpdatesEnabled} style={styles.headerSubview} />;
|