decord/source/design/void/TouchableHitBox/native/TouchableHitBox.tsx

117 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8947
// Function ID: 8948
2026-07-29 08:29:29 +00:00
// Name: render
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 21, 4668, 712, 4107, 1297, 5438, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 8947 (render)
import ThemesDefault from "Themes" /* 712 */;
import Button from "Button" /* 1297 */;
import PressableBase from "PressableBase" /* 5438 */;
import { ActivityIndicator } from "get ActivityIndicator" /* 17 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
createCacheKey = { button: null, buttonText: null, buttonIcon: null, buttonSpinner: null, buttonDisabled: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { flexGrow: 0, flexShrink: 1, justifyContent: "center", alignItems: "center", backgroundColor: "transparent", alignSelf: "flex-start", borderRadius: ThemesDefault.radii.sm };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { lineHeight: 24, margin: 10, maxWidth: 60, fontSize: 16 };
createCacheKey[2] = { margin: 10 };
createCacheKey[3] = { margin: 12 };
createCacheKey[4] = { opacity: 0.6 };
2026-08-24 06:08:38 +00:00
let closure_4 = createCacheKey.createLegacyClassComponentStyles(createCacheKey);
const PureComponent = importAllResult.PureComponent;
2026-07-29 08:29:29 +00:00
class TouchableHitBox extends PureComponent {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
TouchableHitBox.prototype["render"] = function render() {
2026-08-24 06:08:38 +00:00
const tmp = callback(this.context);
2026-07-29 08:29:29 +00:00
const props = this.props;
({ disabled, source, text, loading, IconComponent, iconStyle, color, disableColor } = props);
let tmp2 = undefined !== disableColor;
({ activeOpacity, onPress, onLongPress, style, iconSize } = props);
if (tmp2) {
tmp2 = disableColor;
}
const children = props.children;
let tmp8Result;
({ accessibilityLabel, accessibilityRole, accessibilityState } = props);
if (null != source) {
const items = [tmp.buttonIcon, , ];
let buttonDisabled = disabled;
if (disabled) {
buttonDisabled = tmp.buttonDisabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { style: null, source: null, color: null, size: null, disableColor: null };
items[1] = buttonDisabled;
items[2] = iconStyle;
obj[0] = items;
obj[1] = source;
obj[2] = color;
obj[3] = iconSize;
obj[4] = tmp2;
2026-08-24 06:08:38 +00:00
tmp8Result = jsx(Button.Icon, { style: null, source: null, color: null, size: null, disableColor: null });
2026-07-29 08:29:29 +00:00
const tmp4 = jsx;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (loading) {
obj = { style: null, animating: true, color: null };
obj[0] = tmp.buttonSpinner;
obj[2] = color;
tmp8Result = <ActivityIndicator style={null} animating color={null} />;
} else if (null != text) {
const items1 = [tmp.buttonText, , ];
let buttonDisabled3 = disabled;
if (disabled) {
buttonDisabled3 = tmp.buttonDisabled;
}
obj = { numberOfLines: 1, style: null, children: null };
items1[1] = buttonDisabled3;
2026-08-24 06:08:38 +00:00
obj1 = { color: null };
2026-07-29 08:29:29 +00:00
obj1[0] = color;
items1[2] = obj1;
obj[1] = items1;
obj[2] = text;
2026-08-24 06:08:38 +00:00
tmp8Result = jsx(Button.LegacyText, { numberOfLines: 1, style: null, children: null });
2026-07-29 08:29:29 +00:00
const tmp8 = jsx;
} else {
if (null != IconComponent) {
if (null != source) {
const obj2 = { size: "sm", color: null, style: null };
obj2[1] = color;
const items2 = [tmp.buttonIcon, , ];
let buttonDisabled2 = disabled;
if (disabled) {
buttonDisabled2 = tmp.buttonDisabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[1] = buttonDisabled2;
items2[2] = iconStyle;
obj2[2] = items2;
tmp8Result = <IconComponent size="sm" color={null} style={null} />;
const tmp7 = jsx;
}
}
if (null == source) {
if (null != children) {
tmp8Result = children;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
const obj3 = { accessibilityRole, accessibilityLabel, accessibilityState, onPress, onLongPress, activeOpacity, style: items3, disabled: null, children: null };
items3 = [tmp.button, style];
if (!disabled) {
disabled = loading;
}
obj3[7] = disabled;
obj3[8] = tmp8Result;
2026-08-24 06:08:38 +00:00
return jsx(PressableBase.PressableOpacity, { accessibilityRole, accessibilityLabel, accessibilityState, onPress, onLongPress, activeOpacity, style: items3, disabled: null, children: null });
2026-07-29 08:29:29 +00:00
};
TouchableHitBox.contextType = require("ManaContext").ThemeContext;
TouchableHitBox.defaultProps = {
2026-07-20 16:05:17 +00:00
onPress() {
}
};
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/void/TouchableHitBox/native/TouchableHitBox.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default TouchableHitBox;