Files
discord-decomp/sources/modules/activities/native/ActivityShareLinkModal.tsx
T
2026-07-27 16:20:00 +03:00

238 lines
14 KiB
TypeScript

/* Metro module 13034; source: modules/activities/native/ActivityShareLinkModal.tsx; dependencies: [5, 57, 31, 27, 1379, 1878, 1378, 7690, 4503, 33, 4501, 697, 566, 7232, 8809, 13033, 6777, 1360, 13035, 7067, 7076, 3857, 1244, 6797, 3856, 1478, 477, 5287, 9603, 5282, 5277, 4056, 7704, 9761, 9789, 2] */
function _fun99485(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:6, offset: 0x021ca902, size: 465 bytes, params: 8, frame: 22
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const env0_6 = (require(27) /* metro dependency 27 */).View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const env0_10 = (require(7690) /* metro dependency 7690: UserRowConstants */).UserRowModes;
const env0_11 = (require(4503) /* metro dependency 4503: MessageConstants */).MessageSendLocation;
let value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_16;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.paddingVertical = PX_8;
let BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object4.backgroundColor = BACKGROUND_BASE_LOWER;
object3.headerContainer = object4;
object3.header = {'borderBottomWidth': 0, 'shadowColor': 'transparent', 'backgroundColor': 'transparent'};
BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object3.container = {'flex': 1, 'display': 'flex', backgroundColor: BACKGROUND_BASE_LOWER};
const env0_14 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/native/ActivityShareLinkModal.tsx');
exports.default = ActivityShareLinkModal;
}
function ActivityShareLinkModal({applicationId, customId, linkId, message, onShare}) { // fn#99486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:695, offset: 0x021caad3, size: 1220 bytes, params: 2, frame: 36
const env0_3 = message;
const env0_4 = onShare;
const styles = useStyles();
const connectedActivityChannelId = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmbeddedActivitiesStore],
function() {
return EmbeddedActivitiesStore.getConnectedActivityChannelId();
});
const binding = connectedActivityChannelId;
const value3 = binding.useMemo(_fun99488, [connectedActivityChannelId]);
let useState = binding.useState;
const value4 = Reflect.apply(useState, binding, [false]);
const binding2 = env0_4;
const value5 = binding2(value4, 2);
const property = value5[0];
const env0_6 = value5[1];
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value7[0];
const env0_8 = value7[1];
useState = binding.useState;
const value8 = binding2(Reflect.apply(useState, binding, [[]]), 2);
const property3 = value8[0];
const env0_10 = value8[1];
const length = property3.length;
const value9 = binding.useCallback(_fun99489, []);
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, ['']), 2);
const property4 = value10[0];
binding.useEffect(_fun99491, [applicationId, currentUser, customId, linkId, value10[1]]);
const value11 = binding.useCallback(_fun99492, [property2, onShare]);
const value13 = binding.useCallback(env0_3(_fun99494),
[binding2((importDefault(6777) /* metro dependency 6777: useGetOrFetchApplications */)([applicationId]), 1)[0],
property2, property4, message, onShare, property3]);
const env0_15 = binding.useCallback(_fun99499, [property4]);
const value14 = binding.useMemo(_fun99500,
[(importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true}).height]);
const Header = (require(5287) /* metro dependency 5287 */).Header;
const headerProps = {headerStyle: styles.header};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
headerProps.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.r9qKow);
headerProps.headerTitle = headerTitle_99501;
headerProps.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(value11);
headerProps.headerRight = headerRight_99502;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
headerProps.headerStatusBarHeight = platformUtilsModule.isIOS() ? 0 : undefined;
headerProps.headerTitleAlign = 'center';
const view = <View style={styles.headerContainer}><Header {...headerProps} /></View>;
const viewBinding2Props = {style: styles.container};
const items2 = [((Component) => <Component absolute />)(importDefault(7704) /* metro dependency 7704: ThemedGradient */)];
const SearchableDestinationList = importDefault(9761) /* metro dependency 9761: SearchableDestinationList */;
const TOGGLE = UserRowModes.TOGGLE;
items2[1] = <SearchableDestinationList disableGradient disableStickySections initialSelectedDestinations={[]} insetEnd={0} onSelectedDestinationChange={value9} originDestination={value3} rowMode={TOGGLE} />;
const ModalFloatingAction = (require(9789) /* metro dependency 9789: ModalFloatingActionNative */).ModalFloatingAction;
items2[2] = <ModalFloatingAction disabled={property} floatingBackgroundColor={styles.container.backgroundColor} isVisible={length > 0} loading={property} onPress={property ? undefined : value13} text={length === 1 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TXNS7S) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jWtYUm,
{count: length})} />;
return (
<View style={value14}>
{view}
<View {...viewBinding2Props}>
{items2}
</View>
</View>
);
}
function _fun99488() { // fn#99488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:884, offset: 0x021cafaa, size: 60 bytes, params: 1, frame: 14
var r0;
var value3;
var moduleValue;
if (connectedActivityChannelId != null) {
value3 = environment.__proto__;
moduleValue = require(7232) /* metro dependency 7232: formatResults */;
r0 = moduleValue.getDestinationIdFromChannelId(connectedActivityChannelId);
} else {
r0 = undefined;
}
return r0;
}
function _fun99491() { // fn#99491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:1227, offset: 0x021cafe6, size: 107 bytes, params: 1, frame: 16
const binding = env0_13;
const value3 = undefined;
const getApplicationInstallURLModule = require(8809) /* metro dependency 8809: getApplicationInstallURL */;
const getActivityLaunchURL = getApplicationInstallURLModule.getActivityLaunchURL;
binding(Reflect.apply(getActivityLaunchURL, getApplicationInstallURLModule, [{applicationId: applicationId,
referrerId: currentUser == null ? value3 : currentUser.id, customId: customId, linkId: linkId}]));
return value3;
}
function _fun99492() { // fn#99492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:1371, offset: 0x021cb051, size: 56 bytes, params: 1, frame: 13
onShare(false, env0_7);
const value = environment.__proto__;
(require(13033) /* metro dependency 13033: openActivityShareLinkModalNative */).closeActivityShareLinkModal();
}
function* _fun99494() { // fn#99494, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:1479, offset: 0x021cb094, size: 368 bytes, params: 1, frame: 25
var environment;
if (true) {
var env0_0;
value = environment.__proto__;
if (useStyles != null) {
var Promise = global.Promise;
var all = Promise.all;
var map = EmbeddedActivitiesStore.map;
var binding = env2_0;
var getOrResolveChannelIdFromDestinationId = binding(env2_2[13]).getOrResolveChannelIdFromDestinationId;
yield Reflect.apply(all, Promise, [Reflect.apply(map, EmbeddedActivitiesStore,
[getOrResolveChannelIdFromDestinationId])]);
var value4 = undefined;
if (false) {
return value4;
}
var filter = value4.filter;
binding = env2_0;
var binding2 = env2_2;
var value6 = Reflect.apply(filter, value4, [binding(binding2[17]).isNotNullish]);
var value7 = binding(binding2[18]);
env0_0 = value7.resolveActivityShareMessageContent(env1_3, useStyles, env1_12);
View(true);
value6.forEach(_fun99495());
var value8 = env2_1(binding2[21]);
var open = value8.open;
var intl = binding(binding2[22]).intl;
Reflect.apply(open, value8, [{key: 'ACTIVITY_SHARE_LINK_SUCCESS',
content: intl.formatToPlainString(binding(binding2[22]).t.jQULqL, {applicationName: useStyles.name})}]);
env1_4(true, ChannelStore);
binding(binding2[15]).closeActivityShareLinkModal();
}
}
}
function _fun99499() { // fn#99499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:2108, offset: 0x021cb2c6, size: 78 bytes, params: 1, frame: 15
const value = environment.__proto__;
(require(6797) /* metro dependency 6797: ClipboardUtilsNative */).copy(env0_12);
env0_8(true);
(require(3856) /* metro dependency 3856: ToastUtils */).presentLinkCopied();
}
function _fun99500() { // fn#99500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:2224, offset: 0x021cb314, size: 59 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
return {height: value ? height : '100%'};
}
function ActivityShareLinkModalHeaderTitle({children}) { // fn#99501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:2441, owner: ActivityShareLinkModal.headerTitle, offset: 0x021cb34f, size: 79 bytes, params: 2, frame: 14
const GenericHeaderTitle = (require(9603) /* metro dependency 9603: HeaderShared */).GenericHeaderTitle;
return (
<GenericHeaderTitle
title={children}
subtitle={message}
variant="redesign/heading-18/bold"
/>
);
}
function ActivityShareLinkModalHeaderRight(a0) { // fn#99502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:2600, owner: ActivityShareLinkModal.headerRight, offset: 0x021cb39e, size: 154 bytes, params: 2, frame: 18
const value = environment.__proto__;
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
const headerActionButtonProps = {...a0};
headerActionButtonProps['onPress'] = env0_15;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const Xrt5Po = (require(1244) /* metro dependency 1244: indexNative */).t.Xrt5Po;
headerActionButtonProps['accessibilityLabel'] = Reflect.apply(string, intl, [Xrt5Po]);
const LinkIcon = (require(4056) /* metro dependency 4056: LinkIcon */).LinkIcon;
headerActionButtonProps['IconComponent'] = LinkIcon;
return <HeaderActionButton {...headerActionButtonProps} />;
}
function _fun99495() { // fn#99495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:1684, offset: 0x021cb204, size: 36 bytes, params: 1, frame: 12
const env0_0 = env3_3(_fun99497);
return _fun99498;
}
function* _fun99497(a0) { // fn#99497, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13224:1704, offset: 0x021cb233, size: 147 bytes, params: 2, frame: 21
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
var binding = env5_7;
var channel = binding.getChannel(a0);
if (channel != null) {
binding = env5_1;
var binding2 = env5_2;
var value4 = binding(binding2[19]);
var sendMessage = value4.sendMessage;
var value5 = binding(binding2[20]);
var value7 = value5.parse(channel, applicationId);
var ACTIVITY_SHARE = env5_11.ACTIVITY_SHARE;
yield Reflect.apply(sendMessage, value4, [a0, value7, false, {location: ACTIVITY_SHARE}]);
if (false) {
return undefined;
}
}
}
}