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

276 lines
16 KiB
TypeScript

/* Metro module 11399; source: modules/summaries/native/SummaryActionSheet.tsx; dependencies: [31, 27, 1379, 4814, 9865, 661, 33, 4080, 11399, 1962, 4501, 697, 6860, 9905, 3856, 1244, 4800, 9212, 7153, 7165, 4007, 21, 1230, 6275, 6618, 10236, 4573, 11400, 9173, 9694, 8194, 2] */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import MessageStore from '../../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import Share from '../../icons/native/Share.tsx'; /* Metro dependency 9173 */
import SummaryStore from '../SummaryStore.tsx'; /* Metro dependency 9865 */
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as TopicsIconModule from '../../../design/components/Icon/native/redesign/generated/TopicsIcon.tsx'; /* Metro dependency 10236 */
import * as SummaryActionSheetButtonModule from './SummaryActionSheetButton.tsx'; /* Metro dependency 11400 */
function _fun87332(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:6, offset: 0x01fb8f99, size: 509 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
const env0_8 = value.AnalyticsSections;
const env0_9 = value.MessageFlags;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {summaryContainer: {'padding': 16, 'margin': 16, 'marginBottom': 24, 'justifyContent': 'center',
'alignItems': 'center'}};
object.summaryContent = {textAlign: 'center'};
const object3 = {'marginBottom': 8, 'borderRadius': null, 'border': 1, 'overflow': 'hidden', 'alignItems': 'center',
'justifyContent': 'center'};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object3.backgroundColor = BACKGROUND_BRAND;
object.summaryIconContainer = object3;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object.summaryIcon = {'margin': 8, 'width': 20, 'height': 20, tintColor: WHITE};
object.summaryTopic = {marginBottom: 4};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object.divider = {height: 1, backgroundColor: BORDER_SUBTLE};
object.actionsContainer = {'flexDirection': 'row', 'justifyContent': 'space-evenly', 'marginBottom': 16};
const env0_12 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/summaries/native/SummaryActionSheet.tsx');
exports.default = SummaryActionSheet;
exports.openSummaryDividerActionSheet = openSummaryDividerActionSheet;
function SummaryActionSheet({summary}) { // fn#87333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:932, offset: 0x01fb9196, size: 1190 bytes, params: 2, frame: 36
const styles = useStyles();
let binding = ReactModule;
const value3 = binding.useRef(null);
const channel = ChannelStore.getChannel(summary.channelId);
const message = MessageStore.getMessage(summary.channelId, summary.startId);
let r12 = message != null && message.hasFlag(MessageFlags.HAS_THREAD);
let r13 = channel != null && message != null && !message.hasFlag(MessageFlags.HAS_THREAD) && (require(6860) /* metro dependency 6860: ThreadHooks */).computeCanStartPublicThread(channel,
message);
const value10 = ReactModule.useCallback(_fun87334, [channel?.guild_id]);
binding = ReactModule;
const value11 = binding.useCallback(_fun87335, [summary, channel]);
const value12 = binding.useCallback(_fun87336, [summary, channel, message]);
const value13 = binding.useCallback(_fun87337, [channel, message]);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const TopicsIcon = (TopicsIconModule).TopicsIcon;
const items2 = [
<View style={styles.summaryIconContainer}>
<TopicsIcon style={styles.summaryIcon} size="custom" />
</View>,
];
const Text = (TextModule).Text;
items2[1] = (
<Text
style={[styles.summaryContent, styles.summaryTopic]}
variant="heading-md/extrabold"
color="mobile-text-heading-primary"
>
{summary.topic}
</Text>
);
items2[2] = (
<Text
style={[styles.summaryContent]}
variant="heading-md/medium"
color="text-default"
>
{summary.summShort}
</Text>
);
const items4 = [
<View style={styles.summaryContainer}>
{items2}
</View>,
];
items4[1] = <View style={styles.divider} />;
const SummaryActionSheetButton = (SummaryActionSheetButtonModule).SummaryActionSheetButton;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const summaryActionSheetButton = (
<SummaryActionSheetButton
label={Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t['NY/nlb']])}
iconSource={Share}
onPress={value11}
/>
);
r13 = r13 && <SummaryActionSheetButton label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rBIGBL)} iconSource={importDefault(9694) /* metro dependency 9694 */} onPress={value12} />;
r12 = r12 && <SummaryActionSheetButton label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['39d0Wj'])} iconSource={importDefault(9694) /* metro dependency 9694 */} onPress={value13} />;
string = intl.string;
const QLkZ39 = (require(1244) /* metro dependency 1244: indexNative */).t.QLkZ39;
items4[2] = (
<View style={styles.actionsContainer}>
{summaryActionSheetButton}
{r13}
{r12}
<SummaryActionSheetButton
label={Reflect.apply(string, intl, [QLkZ39])}
iconSource={importDefault(8194) /* metro dependency 8194 */}
onPress={value10}
/>
</View>
);
return (
<BottomSheet ref={value3}>
<SafeAreaPaddingView bottom>
{items4}
</SafeAreaPaddingView>
</BottomSheet>
);
function _fun87334() { // fn#87334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1206, offset: 0x01fb963c, size: 166 bytes, params: 1, frame: 18
var defaultImport2;
var openLazy;
let value = environment.__proto__;
const value2 = undefined;
importDefault(dependencyMap[7]).hideActionSheet();
if ((env0_1 == null ? value2 : env0_1.guild_id) != null) {
defaultImport2 = importDefault(dependencyMap[7]);
openLazy = defaultImport2.openLazy;
value = require(dependencyMap[9]);
value = value(dependencyMap[13], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport2, [value, 'GuildHighlightsNotifications',
{guildId: env0_1 == null ? value2 : env0_1.guild_id}]);
}
return value2;
}
function _fun87335() { // fn#87335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1428, offset: 0x01fb96e2, size: 315 bytes, params: 1, frame: 26
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var formatToPlainString;
var I3yTDn;
var object;
var summaryBinding;
var topic;
var moduleValue;
var getChannelPermalink;
var binding;
var value3;
var moduleValue2;
var showShareActionSheet;
let value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
if (env0_1 != null) {
formatToPlainString = intl.formatToPlainString;
I3yTDn = t.I3yTDn;
object = {};
summaryBinding = summary;
topic = summaryBinding.topic;
object.topic = topic;
moduleValue = require(4800) /* metro dependency 4800: ChannelUtils */;
getChannelPermalink = moduleValue.getChannelPermalink;
binding = env0_1;
object.url = Reflect.apply(getChannelPermalink, moduleValue, [binding.guild_id, binding.id,
summaryBinding.startId,
summaryBinding.id]);
value3 = Reflect.apply(formatToPlainString, intl, [I3yTDn, object]);
moduleValue2 = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
showShareActionSheet = moduleValue2.showShareActionSheet;
topic = summaryBinding.topic;
Reflect.apply(showShareActionSheet, moduleValue2, [{message: value3, subject: topic},
AnalyticsSections.SUMMARY_ACTION_SHEET]);
} else {
value = require(3856) /* metro dependency 3856: ToastUtils */;
value.presentFailedToast(intl.string(t.gvkcQl));
}
}
function _fun87336() { // fn#87336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1793, offset: 0x01fb981d, size: 383 bytes, params: 1, frame: 21
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var defaultImport2;
var openThreadCreationForMobile;
var binding;
var summaryBinding;
var defaultImport3;
var changeThreadSettings;
var id;
var moduleValue;
var navigateToCreateThread;
var guild_id;
var defaultImport4;
var castMessageIdAsChannelId;
var moduleValue2;
var transitionToGuild;
let value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
if (env0_1 == null) {
value = require(3856) /* metro dependency 3856: ToastUtils */;
value.presentError(intl.string(t['/+DWeQ']));
} else if (env0_2 != null) {
defaultImport2 = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
openThreadCreationForMobile = defaultImport2.openThreadCreationForMobile;
binding = env0_1;
summaryBinding = summary;
Reflect.apply(openThreadCreationForMobile, defaultImport2, [binding, summaryBinding.startId,
AnalyticsSections.SUMMARY_ACTION_SHEET]);
defaultImport3 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
changeThreadSettings = defaultImport3.changeThreadSettings;
id = binding.id;
Reflect.apply(changeThreadSettings, defaultImport3, [id, {name: summaryBinding.topic}]);
moduleValue = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
navigateToCreateThread = moduleValue.navigateToCreateThread;
guild_id = binding.guild_id;
defaultImport4 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
castMessageIdAsChannelId = defaultImport4.castMessageIdAsChannelId;
id = env0_2.id;
if (!Reflect.apply(navigateToCreateThread, moduleValue, [guild_id, Reflect.apply(castMessageIdAsChannelId,
defaultImport4, [id])])) {
moduleValue2 = require(1230) /* metro dependency 1230: router_utils */;
transitionToGuild = moduleValue2.transitionToGuild;
guild_id = env0_1.guild_id;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
Reflect.apply(transitionToGuild, moduleValue2, [guild_id, value.castMessageIdAsChannelId(env0_2.id)]);
}
} else {
value = require(3856) /* metro dependency 3856: ToastUtils */;
value.presentError(intl.string(t['/+DWeQ']));
}
}
function _fun87337() { // fn#87337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:2225, offset: 0x01fb999c, size: 141 bytes, params: 1, frame: 17
var moduleValue;
var transitionToGuild;
var guild_id;
let value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
if (env0_1 != null && env0_2 != null) {
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
transitionToGuild = moduleValue.transitionToGuild;
guild_id = env0_1.guild_id;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
Reflect.apply(transitionToGuild, moduleValue, [guild_id, value.castMessageIdAsChannelId(env0_2.id)]);
}
}
}
function openSummaryDividerActionSheet(a0, a1) { // fn#87338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:3440, offset: 0x01fb9a29, size: 135 bytes, params: 3, frame: 18
var defaultImport;
var openLazy;
var value;
const summary = SummaryStore.findSummary(a0, a1);
if (summary != null) {
defaultImport = importDefault(dependencyMap[7]);
openLazy = defaultImport.openLazy;
value = require(dependencyMap[9]);
value = value(dependencyMap[8], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'SummaryDivider' + a1, {summary: summary}]);
}
}
}
global.__d(_fun87332, 11399, [31, 27, 1379, 4814, 9865, 661, 33, 4080, 11399, 1962, 4501, 697, 6860, 9905, 3856,
1244, 4800, 9212, 7153, 7165, 4007, 21, 1230, 6275, 6618, 10236, 4573, 11400, 9173, 9694, 8194,
2]) /* metro module 11399, dependencies: [31, 27, 1379, 4814, 9865, 661, 33, 4080, 11399, 1962, 4501, 697, 6860, 9905, 3856, 1244, 4800, 9212, 7153, 7165, 4007, 21, 1230, 6275, 6618, 10236, 4573, 11400, 9173, 9694, 8194, 2] */;