Files
discord-decomp/sources/components_native/common/TouchableBackground.tsx
T
2026-07-28 01:06:53 +03:00

71 lines
4.0 KiB
TypeScript

/* Metro module 11847; source: components_native/common/TouchableBackground.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
function _fun90774(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12033:6, offset: 0x020451ab, size: 238 bytes, params: 8, frame: 21
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_2 = value.View;
const env0_3 = value.Pressable;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const INTERACTIVE_BACKGROUND_ACTIVE = (Native).colors.INTERACTIVE_BACKGROUND_ACTIVE;
const env0_5 = Reflect.apply(createStyles, value, [{default: {backgroundColor: INTERACTIVE_BACKGROUND_ACTIVE}}]);
(FileImportTrackerModule).fileFinishedImporting('components_native/common/TouchableBackground.tsx');
exports.default = TouchableBackground;
function TouchableBackground(a0) { // fn#90775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12033:355, offset: 0x02045299, size: 320 bytes, params: 2, frame: 27
const activeBackgroundColor = a0.activeBackgroundColor;
const pressableStyle = a0.pressableStyle;
const style = a0.style;
const children = a0.children;
const onPressIn = a0.onPressIn;
const onPressIn2 = onPressIn;
const onPressOut = a0.onPressOut;
const onPressOut2 = onPressOut;
const object = {'activeBackgroundColor': 0, 'pressableStyle': 0, 'style': 0, 'children': 0, 'onPressIn': 0,
'onPressOut': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const styles = useStyles();
const binding = onPressOut2;
const [property, env0_2] = onPressIn2(binding.useState(false), 2);
return (
<Pressable
accessibilityRole="button"
style={pressableStyle}
{...value}
{...{['onPressIn']: binding.useCallback(_fun90776, [onPressIn])}}
{...{['onPressOut']: binding.useCallback(_fun90777, [onPressOut])}}
>
<View style={[style,
property && ({backgroundColor: activeBackgroundColor ?? styles.default.backgroundColor})]}>
{children}
</View>
</Pressable>
);
function _fun90776(a0) { // fn#90776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12033:544, offset: 0x01e390c7, size: 40 bytes, params: 2, frame: 12
env0_2(true);
if (onPressIn != null) {
onPressIn(a0);
}
}
function _fun90777(a0) { // fn#90777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12033:592, offset: 0x020453d9, size: 42 bytes, params: 2, frame: 12
if (onPressOut != null) {
onPressOut(a0);
}
env0_2(false);
}
}
}
global.__d(_fun90774, 11847, [57, 31, 27, 33, 4501, 697,
2]) /* metro module 11847, dependencies: [57, 31, 27, 33, 4501, 697, 2] */;