decord/source/components_native/common/SafeAreaView.tsx

85 lines
2.1 KiB
TypeScript
Raw Normal View History

// Module ID: 7226
// Function ID: 7227
// Name: common/SafeAreaView
// Dependencies: [19, 17, 21, 1611, 5667, 1332, 2]
2026-07-20 16:05:17 +00:00
// Exports: SafeAreaPaddingView
// Module 7226 (common/SafeAreaView)
import _modDef1332 from "module_1332" /* 1332 */;
import useSafeAreaInsetsDefault from "useSafeAreaInsets" /* 1611 */;
import useRefValueDefault from "useRefValue" /* 5667 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const View = fn(17).View;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("components_native/common/SafeAreaView.tsx");
2026-07-20 16:05:17 +00:00
export const SafeAreaPaddingView = function SafeAreaPaddingView(top) {
let flag = top.top;
if (flag === undefined) {
flag = false;
}
let flag2 = top.bottom;
if (flag2 === undefined) {
flag2 = false;
}
let flag3 = top.left;
if (flag3 === undefined) {
flag3 = false;
}
let flag4 = top.right;
if (flag4 === undefined) {
flag4 = false;
}
let style = top.style;
const merged = Object.assign(top, Object.assign({ top: 0, bottom: 0, left: 0, right: 0, style: 0 }));
let current;
closure_2 = undefined;
const rect = useSafeAreaInsetsDefault();
const ref = noop.useRef(null);
2026-07-29 08:29:29 +00:00
if (style == null) {
2026-07-20 16:05:17 +00:00
style = {};
}
2026-08-24 06:08:38 +00:00
let items = [style, , , , ];
2026-07-29 08:29:29 +00:00
let tmp9;
2026-07-20 16:05:17 +00:00
if (flag) {
const obj = { paddingTop: rect.top + tmp5 };
2026-07-29 08:29:29 +00:00
tmp9 = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[1] = tmp9;
let tmp10;
2026-07-20 16:05:17 +00:00
if (flag2) {
const obj3 = { paddingBottom: rect.bottom + tmp6 };
tmp10 = obj3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[2] = tmp10;
let tmp11;
2026-07-20 16:05:17 +00:00
if (flag3) {
const obj4 = { paddingLeft: rect.left + tmp7 };
tmp11 = obj4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[3] = tmp11;
let tmp12;
2026-07-20 16:05:17 +00:00
if (flag4) {
const obj5 = { paddingRight: rect.right + tmp8 };
tmp12 = obj5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[4] = tmp12;
current = items;
const tmp13 = useRefValueDefault(ref);
const tmp14 = _modDef1332(items, tmp13);
closure_2 = tmp14;
2026-07-29 08:29:29 +00:00
if (tmp14) {
current = tmp13;
2026-07-29 08:29:29 +00:00
items = tmp13;
2026-07-20 16:05:17 +00:00
}
const insertionEffect = noop.useInsertionEffect(() => {
2026-08-24 06:08:38 +00:00
if (!closure_2) {
ref.current = current;
2026-07-20 16:05:17 +00:00
}
});
const merged1 = Object.assign(merged);
2026-07-23 10:11:24 +00:00
return <View style={items} />;
2026-07-20 16:05:17 +00:00
};