Files
discord-decomp/sources/modules/applications/native/AppInteractionInfoActionSheet.tsx
T
2026-07-28 01:06:53 +03:00

226 lines
12 KiB
TypeScript

/* Metro module 11204; source: modules/applications/native/AppInteractionInfoActionSheet.tsx; dependencies: [31, 27, 1885, 1867, 1878, 33, 4501, 1585, 11205, 8042, 566, 8061, 6819, 4573, 1244, 5278, 8743, 1305, 6275, 2] */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import UserRecord from '../../../records/UserRecord.tsx'; /* Metro dependency 1885 */
import ShowUserProfileActionSheet from '../../user_profile/native/showUserProfileActionSheet.tsx'; /* Metro dependency 8743 */
import ContextMenuSubmenuActionSheetHeader from '../../action_sheet/native/components/ContextMenuSubmenuActionSheetHeader.tsx'; /* Metro dependency 11205 */
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 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
function _fun85612(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:6, offset: 0x01f7570e, size: 286 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_10 = (CreateStylesModule).createStyles({itemContainer: {'flexDirection': 'row',
'paddingVertical': 12, 'paddingHorizontal': 16, 'alignItems': 'center'}, itemLabel: {'flexDirection': 'column',
'alignItems': 'flex-start', 'paddingLeft': 12}});
(FileImportTrackerModule).fileFinishedImporting('modules/applications/native/AppInteractionInfoActionSheet.tsx');
exports.default = AppInteractionInfoActionSheet;
function AppInteractionInfoActionSheet({message, guildId, onBack}) { // fn#85613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:480, offset: 0x01f7582c, size: 1537 bytes, params: 2, frame: 37
var r17;
var r6;
var r5;
var userRecord2;
const PressableOpacity = (PressablesModule).PressableOpacity;
var items5;
const Text = (TextModule).Text;
var username;
var items2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var format;
var ShLXXB;
var items3;
var items4;
var object4;
var items6;
var items7;
let env0_3 = undefined;
const styles = useStyles();
const bottom = (UseSafeAreaInsetsNative)().bottom;
const binding = env0_3;
const useMemo = binding.useMemo;
let object = [onBack];
const value3 = Reflect.apply(useMemo, binding, [_fun85614, object]);
let interactionMetadata = message.interactionMetadata;
const r1 = interactionMetadata == null ? undefined : interactionMetadata.authorizing_integration_owners[(require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.USER_INSTALL];
interactionMetadata = message.interactionMetadata;
env0_3 = interactionMetadata == null ? undefined : interactionMetadata.authorizing_integration_owners[(require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.GUILD_INSTALL];
interactionMetadata = message.interactionMetadata;
const env0_4 = interactionMetadata == null ? undefined : interactionMetadata.user.id;
const useStateFromStores = FluxModule.useStateFromStores;
const userStoreBinding = UserStore;
const user2 = Reflect.apply(useStateFromStores, FluxModule, [[userStoreBinding], _fun85615]);
const guild = FluxModule.useStateFromStores([GuildStore], _fun85616);
const user = FluxModule.useStateFromStores([userStoreBinding], function() {
return UserStore.getUser(id);
});
env0_3.useEffect(_fun85618, [user2, r1]);
if (user != null) {
r17 = user;
} else {
userRecord2 = new UserRecord(message.interactionMetadata?.user);
}
if (guild != null) {
var viewBindingProps = {style: styles.itemContainer};
items3 = [
((Component) => <Component guild={guild} size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.SMALL_32} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */),
];
var viewBindingProps2 = {style: styles.itemLabel};
items4 = [
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{guild.name}
</Text>,
];
items4[1] = (
<Text variant="text-xs/medium" color="text-subtle">
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.ShLXXB,
{application: message.author.username})}
</Text>
);
items3[1] = (
<View {...viewBindingProps2}>
{items4}
</View>
);
r6 = (
<View {...viewBindingProps}>
{items3}
</View>
);
} else if (user2 != null) {
object = {onPress: onPress_85619};
var viewBindingProps = {style: styles.itemContainer};
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
items5 = [
<Avatar
user={user2}
size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.REFRESH_MEDIUM_32}
guildId={guildId}
/>,
];
var viewBindingProps2 = {style: styles.itemLabel};
username = user2.username;
items2 = [
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{username}
</Text>,
];
format = intl.format;
ShLXXB = (require(1244) /* metro dependency 1244: indexNative */).t.ShLXXB;
username = message.author.username;
items2[1] = (
<Text variant="text-xs/medium" color="text-subtle">
{Reflect.apply(format, intl, [ShLXXB, {application: username}])}
</Text>
);
items5[1] = (
<View {...viewBindingProps2}>
{items2}
</View>
);
r6 = (
<PressableOpacity {...object}>
<View {...viewBindingProps}>
{items5}
</View>
</PressableOpacity>
);
} else {
r6 = null;
}
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const object5 = {paddingBottom: bottom};
if (r17 != null) {
object4 = {onPress: onPress_85620};
var viewBindingProps = {style: styles.itemContainer};
const Avatar2 = (require(1305) /* metro dependency 1305: native */).Avatar;
items6 = [
<Avatar2
user={r17}
size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.REFRESH_MEDIUM_32}
guildId={guildId}
/>,
];
var viewBindingProps2 = {style: styles.itemLabel};
items7 = [
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{r17.username}
</Text>,
];
items7[1] = (
<Text variant="text-xs/medium" color="text-subtle">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['04gxNg'])}
</Text>
);
items6[1] = (
<View {...viewBindingProps2}>
{items7}
</View>
);
r5 = (
<PressableOpacity {...object4}>
<View {...viewBindingProps}>
{items6}
</View>
</PressableOpacity>
);
} else {
r5 = null;
}
return (
<BottomSheet header={value3} bodyStyles={object5}>
{r6}
{r5}
</BottomSheet>
);
function _fun85614() { // fn#85614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:601, offset: 0x01f75e2d, size: 51 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component onBack={onBack} />)(ContextMenuSubmenuActionSheetHeader);
}
function _fun85615() { // fn#85615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:966, offset: 0x01f75e60, size: 27 bytes, params: 1, frame: 11
return UserStore.getUser(env0_2);
}
function _fun85616() { // fn#85616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:1020, offset: 0x010ee62e, size: 27 bytes, params: 1, frame: 11
return GuildStore.getGuild(env0_3);
}
function _fun85618() { // fn#85618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:1107, offset: 0x01f75e96, size: 71 bytes, params: 1, frame: 12
var value4;
if (user == null && env0_2 != null) {
value4 = environment.__proto__;
(require(8061) /* metro dependency 8061: UserActionCreators */).getUser(env0_2);
}
}
function AppInteractionInfoActionSheetOnPress() { // fn#85619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:1681, owner: AppInteractionInfoActionSheet.onPress, offset: 0x01f75edd, size: 63 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (ShowUserProfileActionSheet)({userId: user.id,
channelId: message.channel_id});
}
function AppInteractionInfoActionSheetOnPress_85620() { // fn#85620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11390:2268, owner: AppInteractionInfoActionSheet.onPress, offset: 0x01f75f1c, size: 63 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (ShowUserProfileActionSheet)({userId: user.id,
channelId: message.channel_id});
}
}
}
global.__d(_fun85612, 11204, [31, 27, 1885, 1867, 1878, 33, 4501, 1585, 11205, 8042, 566, 8061, 6819, 4573, 1244,
5278, 8743, 1305, 6275,
2]) /* metro module 11204, dependencies: [31, 27, 1885, 1867, 1878, 33, 4501, 1585, 11205, 8042, 566, 8061, 6819, 4573, 1244, 5278, 8743, 1305, 6275, 2] */;