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

131 lines
7.9 KiB
TypeScript

/* Metro module 10294; source: modules/channel/native/ChannelPickerActionSheet.tsx; dependencies: [31, 3793, 1878, 33, 1585, 6806, 4080, 6758, 7987, 6242, 10295, 6805, 6277, 7988, 6647, 4805, 2] */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 UseChannelNameModule from '../useChannelName.tsx'; /* Metro dependency 4805 */
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import * as ChannelUtilsModule from '../../../utils/native/ChannelUtils.tsx'; /* Metro dependency 6647 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as TableRadioRowNativeModule from '../../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */
import * as TableRadioGroupNativeModule from '../../../design/components/TableRow/native/TableRadioGroup.native.tsx'; /* Metro dependency 7988 */
function _fun79837(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:6, offset: 0x01e6442f, size: 179 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
(FileImportTrackerModule).fileFinishedImporting('modules/channel/native/ChannelPickerActionSheet.tsx');
exports.default = ChannelPickerActionSheet;
function ChannelPickerActionSheet(a0) { // fn#79838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:247, offset: 0x01e644e2, size: 563 bytes, params: 2, frame: 27
var r4;
var r11;
const env0_0 = a0;
const value2 = undefined;
const bottom = (UseSafeAreaInsetsNative)().bottom;
const header = a0.header;
const env0_1 = a0.guild;
const channels = a0.channels;
const env0_3 = a0.onSelect;
const selectedChannel = a0.selectedChannel;
if (header != null) {
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
r4 = (
<BottomSheetTitleHeader
title={header.title}
trailing={header.onClose != null
? ((ActionSheetCloseButton) => <ActionSheetCloseButton onPress={onPress_79839} />)((require(6806) /* metro dependency 6806: ActionSheetCloseButtonNative */).ActionSheetCloseButton)
: value2}
/>
);
} else {
r4 = value2;
}
if (a0.noChannelOptionLabel != null) {
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
r11 = (
<TableRadioRow
value=""
label={a0.noChannelOptionLabel}
icon={((TableRowIcon) => <TableRowIcon source={importDefault(10295) /* metro dependency 10295 */} />)((require(6242) /* metro dependency 6242: TableRowIconNative */).TableRowIcon)}
/>
);
} else {
r11 = value2;
}
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
const BottomSheetScrollView = (Module06277Module).BottomSheetScrollView;
const object2 = {paddingBottom: bottom};
const TableRadioGroup = (TableRadioGroupNativeModule).TableRadioGroup;
return (
<ActionSheet scrollable header={r4}>
<BottomSheetScrollView contentContainerStyle={object2}>
<TableRadioGroup
defaultValue={(selectedChannel == null ? value2 : selectedChannel.id) ?? ''}
accessibilityLabel={header == null ? value2 : header.title}
onChange={onChange_79840}
hasIcons
>
{[r11, channels.map(_fun79842)]}
</TableRadioGroup>
</BottomSheetScrollView>
</ActionSheet>
);
function ChannelPickerActionSheetOnPress() { // fn#79839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:474, owner: ChannelPickerActionSheet.onPress, offset: 0x01e64715, size: 48 bytes, params: 1, frame: 11
const value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
onClose();
}
function ChannelPickerActionSheetOnChange(a0) { // fn#79840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:989, owner: ChannelPickerActionSheet.onChange, offset: 0x01e64745, size: 169 bytes, params: 2, frame: 15
var environment;
var value3;
var value4;
const env0_0 = a0;
if (a0 === '') {
if (env0_0.noChannelOptionLabel != null) {
value4 = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
env0_0.onSelect(null);
return undefined;
}
}
const value2 = channels.find(_fun79841);
if (value2 != null) {
value3 = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
onSelect(value2);
}
function _fun79841({id}) { // fn#79841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:1102, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
return id === env0_0;
}
}
function _fun79842(a0) { // fn#79842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10480:1190, offset: 0x01e647ee, size: 186 bytes, params: 2, frame: 21
const value = environment.__proto__;
const channelIconWithGuild = (ChannelUtilsModule).getChannelIconWithGuild(a0,
guild);
const TableRadioRow = (TableRadioRowNativeModule).TableRadioRow;
const tableRadioRowProps = {value: a0.id};
tableRadioRowProps.label = UseChannelNameModule.computeChannelName(a0, UserStore, RelationshipStore);
const value4 = null;
tableRadioRowProps.icon = (
value4 != channelIconWithGuild
? ((TableRowIcon) => <TableRowIcon source={channelIconWithGuild} />)((require(6242) /* metro dependency 6242: TableRowIconNative */).TableRowIcon)
: value4
);
return <TableRadioRow {...tableRadioRowProps} key={a0.id} />;
}
}
}
global.__d(_fun79837, 10294, [31, 3793, 1878, 33, 1585, 6806, 4080, 6758, 7987, 6242, 10295, 6805, 6277, 7988, 6647,
4805,
2]) /* metro module 10294, dependencies: [31, 3793, 1878, 33, 1585, 6806, 4080, 6758, 7987, 6242, 10295, 6805, 6277, 7988, 6647, 4805, 2] */;