decord/source/modules/toast/native/Toast.tsx

114 lines
4 KiB
TypeScript
Raw Normal View History

2026-08-06 08:05:19 +00:00
// Module ID: 15921
// Function ID: 15922
2026-07-20 16:05:17 +00:00
// Name: ToastIcon
2026-08-06 08:05:19 +00:00
// Dependencies: [32, 19, 17, 21, 4285, 712, 3988, 1297, 4281, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-06 08:05:19 +00:00
// Module 15921 (ToastIcon)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function ToastIcon(recolorLegacyIcon) {
let IconComponent;
let icon;
let iconColor;
({ icon, IconComponent, iconColor } = recolorLegacyIcon);
2026-08-06 08:05:19 +00:00
let obj = require(3988) /* map */;
2026-07-29 08:29:29 +00:00
if (iconColor == null) {
iconColor = "mobile-text-heading-primary";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const token = obj.useToken(iconColor);
2026-07-20 16:05:17 +00:00
if (recolorLegacyIcon.recolorLegacyIcon) {
2026-07-29 08:29:29 +00:00
obj = { color: null };
obj[0] = token;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { disableColor: true };
2026-07-20 16:05:17 +00:00
}
if (null != IconComponent) {
2026-07-29 08:29:29 +00:00
const obj1 = { size: "sm", color: null };
obj1[1] = token;
let tmp8 = callback2(IconComponent, obj1);
2026-08-04 21:03:28 +00:00
} else if (typeof icon === "function") {
2026-07-29 08:29:29 +00:00
const obj2 = { children: null };
obj2[0] = icon();
tmp8 = callback2(closure_6, obj2);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp8 = null;
2026-07-20 16:05:17 +00:00
if (null != icon) {
2026-07-29 08:29:29 +00:00
const obj3 = { resizeMode: "contain", source: null };
obj3[1] = icon;
const merged = Object.assign(obj);
tmp8 = callback2(require(1297) /* Button */.Icon, obj3);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
}
function ToastContent(content) {
content = content.content;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
2026-08-04 21:03:28 +00:00
if (typeof content === "function") {
2026-07-29 08:29:29 +00:00
let obj = { style: null, children: null };
obj[0] = tmp.contentContainer;
obj[1] = content();
let tmp4 = callback2(View, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { onTextLayout: null, style: null, lineClamp: 3, variant: "text-sm/semibold", color: "mobile-text-heading-primary", children: null };
obj[0] = content.onTextLayout;
obj[1] = tmp.contentContainer;
obj[5] = content;
2026-08-06 08:05:19 +00:00
tmp4 = callback2(require(4281) /* Text */.Text, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ jsx: c5, Fragment: closure_6, jsxs: error } = jsxProd);
createCacheKey = { container: null, multilineContainer: null, contentContainer: null };
createCacheKey = { flexDirection: "row", alignItems: "center", borderRadius: require("Themes").radii.xxl, padding: require("Themes").space.PX_8, paddingRight: require("Themes").space.PX_12, backgroundColor: require("Themes").colors.MOBILE_TOAST_BACKGROUND_DEFAULT, borderColor: require("Themes").colors.BORDER_SUBTLE, borderWidth: 1 };
let merged = Object.assign(require("Themes").shadows.SHADOW_HIGH);
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { paddingLeft: require("Themes").space.PX_12 };
createCacheKey[2] = { marginLeft: 8, flexShrink: 1 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj1 = { paddingLeft: require("Themes").space.PX_12 };
2026-07-23 10:11:24 +00:00
const result = require("get ActivityIndicator").fileFinishedImporting("modules/toast/native/Toast.tsx");
2026-07-20 16:05:17 +00:00
export default function Toast(arg0) {
let IconComponent;
2026-07-29 08:29:29 +00:00
let c0;
2026-07-20 16:05:17 +00:00
let containerStyle;
let content;
let icon;
let iconColor;
let recolorLegacyIcon;
let tmp3;
2026-07-29 08:29:29 +00:00
c0 = undefined;
let closure_1;
2026-07-20 16:05:17 +00:00
({ icon, iconColor, IconComponent, content, containerStyle, recolorLegacyIcon } = arg0);
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
[tmp3, c0] = callback(React.useState(false), 2);
closure_1 = React.useRef(false);
2026-07-20 16:05:17 +00:00
const items = [tmp.container, , ];
let multilineContainer = null;
2026-07-23 10:11:24 +00:00
callback = React.useCallback((nativeEvent) => {
2026-07-20 16:05:17 +00:00
if (!ref.current) {
2026-07-29 08:29:29 +00:00
tmp.current = true;
_undefined(nativeEvent.nativeEvent.lines.length > 1);
2026-07-20 16:05:17 +00:00
}
}, []);
if (tmp3) {
multilineContainer = tmp.multilineContainer;
}
2026-07-29 08:29:29 +00:00
const obj = { style: items, accessibilityElementsHidden: true, children: null };
2026-07-20 16:05:17 +00:00
items[1] = multilineContainer;
items[2] = containerStyle;
const items1 = [callback2(ToastIcon, { icon, iconColor, IconComponent, recolorLegacyIcon }), callback2(ToastContent, { content, onTextLayout: callback })];
2026-07-29 08:29:29 +00:00
obj[2] = items1;
2026-07-20 16:05:17 +00:00
return closure_7(View, obj);
};