decord/source/modules/interaction_components/native/InteractionModal.tsx

142 lines
6.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16697
// Function ID: 16698
2026-07-20 16:05:17 +00:00
// Name: onClose
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 13831, 21, 4668, 712, 5265, 16698, 5446, 1297, 1435, 4739, 5438, 1236, 6399, 8365, 16699, 4750, 2]
2026-07-20 16:05:17 +00:00
// Exports: openInteractionModal
2026-08-24 06:08:38 +00:00
// Module 16697 (onClose)
import noopAll from "noop" /* 19 */;
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import Button from "Button" /* 1297 */;
import getAvatarURLDefault from "getAvatarURL" /* 1435 */;
import Text from "Text" /* 4739 */;
import Button2 from "Button" /* 4750 */;
import _modDef5265 from "module_5265" /* 5265 */;
import PressableBase from "PressableBase" /* 5438 */;
import useSafeAreaInsetsKeyboardAwareDefault from "useSafeAreaInsetsKeyboardAware" /* 5446 */;
import XSmallIcon from "XSmallIcon" /* 6399 */;
import isInteractionComponent from "isInteractionComponent" /* 8365 */;
import getData from "getData" /* 16698 */;
import renderComponents from "renderComponents" /* 16699 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import { InteractionModalState } from "getModalState" /* 13831 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function onClose() {
2026-08-24 06:08:38 +00:00
return _modDef5265.popWithKey(interaction_modal);
2026-07-20 16:05:17 +00:00
}
class InteractionModal {
constructor(arg0) {
2026-08-24 06:08:38 +00:00
tmp = closure_9();
2026-07-29 08:29:29 +00:00
tmp2 = closure_0;
tmp3 = closure_2;
obj = require("getData");
2026-07-20 16:05:17 +00:00
modalState = obj.useModalState(global, onClose);
error = modalState.error;
({ components, applicationIconURL, applicationName, submissionState, validators, validationErrors, setValidationErrors, onSubmit } = modalState);
2026-07-23 10:11:24 +00:00
insets = require("useSafeAreaInsetsKeyboardAware")({ includeKeyboardHeight: true }).insets;
2026-07-29 08:29:29 +00:00
tmp5 = jsxs;
tmp6 = View;
obj = { style: items, children: null };
2026-07-20 16:05:17 +00:00
items = [, ];
items[0] = tmp.modal;
items[1] = { paddingTop: insets.top, paddingBottom: insets.bottom };
2026-07-29 08:29:29 +00:00
obj1 = { style: tmp.header, children: null };
tmp7 = jsx;
obj2 = { style: tmp.icon, source: null, size: null };
2026-07-23 10:11:24 +00:00
obj5 = require("getAvatarURL");
2026-07-29 08:29:29 +00:00
obj2[1] = obj5.makeSource(applicationIconURL);
obj2[2] = require("Button").AvatarSizes.SMALL;
2026-07-20 16:05:17 +00:00
items1 = [, , ];
2026-07-23 10:11:24 +00:00
items1[0] = jsx(require("Button").Avatar, obj2);
2026-07-29 08:29:29 +00:00
obj3 = { style: tmp.titleView, children: jsx(require("Text").Text, { variant: "heading-xl/semibold", color: "mobile-text-heading-primary", children: global.title }) };
2026-07-20 16:05:17 +00:00
items1[1] = jsx(View, obj3);
2026-07-29 08:29:29 +00:00
obj4 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, children: null };
2026-07-23 10:11:24 +00:00
intl = require("getSystemLocale").intl;
2026-07-29 08:29:29 +00:00
obj4[1] = intl.string(require("getSystemLocale").t.cpT0Cq);
obj4[2] = onClose;
obj4[3] = tmp.closeButton;
obj5 = { color: tmp.closeIcon.color };
obj4[4] = jsx(require("XSmallIcon").XSmallIcon, obj5);
items1[2] = jsx(require("PressableBase").PressableOpacity, obj4);
obj1[1] = items1;
2026-07-20 16:05:17 +00:00
items2 = [, ];
items2[0] = jsxs(View, obj1);
2026-07-29 08:29:29 +00:00
obj6 = { style: tmp.scroll, contentContainerStyle: tmp.modalContent, keyboardShouldPersistTaps: "handled", children: null };
tmp7Result = null;
tmp8 = ScrollView;
2026-07-20 16:05:17 +00:00
if (null != error) {
str = "";
2026-07-29 08:29:29 +00:00
tmp7Result = null;
2026-07-20 16:05:17 +00:00
if ("" !== error) {
2026-07-29 08:29:29 +00:00
obj7 = { style: null, children: null };
obj7[0] = tmp.error;
obj8 = { messageType: null, children: null };
obj8[0] = require("Button").HelpMessageTypes.ERROR;
obj8[1] = error;
obj7[1] = tmp7(require("Button").HelpMessage, obj8);
tmp7Result = tmp7(tmp6, obj7);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj9 = { children: null };
2026-07-20 16:05:17 +00:00
items3 = [, ];
2026-07-29 08:29:29 +00:00
items3[0] = tmp7Result;
2026-08-24 06:08:38 +00:00
obj10 = { messageType: require("Button").HelpMessageTypes.WARNING, children: null };
2026-07-23 10:11:24 +00:00
intl2 = require("getSystemLocale").intl;
2026-07-29 08:29:29 +00:00
obj10[1] = intl2.format(require("getSystemLocale").t["dSTy/w"], { applicationName });
items3[1] = tmp7(require("Button").HelpMessage, obj10);
obj9[0] = items3;
2026-07-20 16:05:17 +00:00
items4 = [, , ];
2026-07-29 08:29:29 +00:00
items4[0] = tmp5(tmp6, obj9);
obj11 = { modal: global, validators, validationErrors, setValidationErrors, children: null };
tmp2Result = require("renderComponents");
obj11[4] = tmp2Result.renderComponents(components);
items4[1] = tmp7(require("isInteractionComponent").ComponentStateContextProvider, obj11);
obj12 = { style: tmp.footer, children: null };
obj13 = { text: null, loading: null, size: "lg", onPress: null };
2026-07-23 10:11:24 +00:00
intl3 = require("getSystemLocale").intl;
2026-07-29 08:29:29 +00:00
obj13[0] = intl3.string(require("getSystemLocale").t.geKm7t);
obj13[1] = submissionState === InteractionModalState.IN_FLIGHT;
obj13[3] = onSubmit;
obj12[1] = tmp7(require("Button").Button, obj13);
items4[2] = tmp7(tmp6, obj12);
obj6[3] = items4;
items2[1] = tmp5(tmp8, obj6);
obj[1] = items2;
return tmp5(tmp6, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
noopAll;
2026-07-29 08:29:29 +00:00
({ View: c3, ScrollView: c4 } = get_ActivityIndicator);
({ jsx: closure_6, jsxs: error } = jsxProd);
2026-07-23 10:11:24 +00:00
const interaction_modal = "interaction_modal";
2026-07-29 08:29:29 +00:00
createCacheKey = { modal: null, scroll: null, modalContent: null, header: null, titleView: null, icon: null, footer: null, closeButton: null, closeIcon: null, error: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW, flex: 1 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { flex: 1 };
2026-08-24 06:08:38 +00:00
createCacheKey[2] = { flexGrow: 1, paddingHorizontal: ThemesDefault.space.PX_16, gap: ThemesDefault.space.PX_16 };
let obj1 = { flexGrow: 1, paddingHorizontal: ThemesDefault.space.PX_16, gap: ThemesDefault.space.PX_16 };
createCacheKey[3] = { flexDirection: "row", marginBottom: ThemesDefault.space.PX_16, paddingHorizontal: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
createCacheKey[4] = { flex: 1 };
2026-08-24 06:08:38 +00:00
let obj2 = { flexDirection: "row", marginBottom: ThemesDefault.space.PX_16, paddingHorizontal: ThemesDefault.space.PX_16 };
createCacheKey[5] = { marginRight: ThemesDefault.space.PX_8 };
let obj3 = { marginRight: ThemesDefault.space.PX_8 };
createCacheKey[6] = { marginTop: "auto", marginBottom: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
createCacheKey[7] = { marginLeft: "auto" };
2026-08-24 06:08:38 +00:00
let obj4 = { marginTop: "auto", marginBottom: ThemesDefault.space.PX_16 };
createCacheKey[8] = { color: ThemesDefault.colors.TEXT_MUTED };
let obj5 = { color: ThemesDefault.colors.TEXT_MUTED };
createCacheKey[9] = { marginBottom: ThemesDefault.space.PX_16 };
let closure_9 = createCacheKey.createStyles(createCacheKey);
let obj6 = { marginBottom: ThemesDefault.space.PX_16 };
const result = require("set").fileFinishedImporting("modules/interaction_components/native/InteractionModal.tsx");
2026-07-20 16:05:17 +00:00
export default InteractionModal;
2026-07-29 08:29:29 +00:00
export const openInteractionModal = function openInteractionModal(closure_0) {
2026-08-24 06:08:38 +00:00
let arr = _modDef5265;
2026-07-29 08:29:29 +00:00
arr = arr.push(InteractionModal, closure_0, interaction_modal);
2026-07-20 16:05:17 +00:00
};