decord/stable/source/modules/channel/native/ChannelPickerActionSheet.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

104 lines
3.9 KiB
TypeScript

// Module ID: 11467
// Function ID: 11468
// Name: ChannelPickerActionSheet
// Dependencies: [19, 4285, 1371, 21, 1611, 7301, 4603, 7252, 5769, 5692, 11468, 7300, 6728, 5766, 5109, 4789, 2]
// Exports: default
// Module 11467 (ChannelPickerActionSheet)
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4603 */;
import useChannelName from "useChannelName" /* 4789 */;
import utils_ChannelUtils from "utils/ChannelUtils" /* 5109 */;
import TableRadioRow from "TableRadioRow" /* 5769 */;
import noop from "module_19" /* 19 */;
import RelationshipStore from "RelationshipStore" /* 4285 */;
import UserStore from "UserStore" /* 1371 */;
const require = globalThis.__r;
const TableRowIcon = tmp(5692);
require = fn;
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/native/ChannelPickerActionSheet.tsx");
export default function ChannelPickerActionSheet(noChannelOptionLabel) {
_require = noChannelOptionLabel;
({ header, guild: importDefault, channels } = noChannelOptionLabel);
({ onSelect: RelationshipStore, selectedChannel } = noChannelOptionLabel);
let tmp3;
if (null != header) {
const onClose = header.onClose;
let tmp4;
if (null != onClose) {
let obj = {
onPress() {
ActionSheetActionCreatorsDefault.hideActionSheet();
onClose();
}
};
tmp4 = closure_5(require("ActionSheetCloseButton").ActionSheetCloseButton, obj);
}
let obj2 = { title: header.title, trailing: tmp4 };
tmp3 = closure_5(require("BottomSheetTitleHeader").BottomSheetTitleHeader, obj2);
}
let items;
if (null != noChannelOptionLabel.noChannelOptionLabel) {
const obj3 = { value: "", label: noChannelOptionLabel.noChannelOptionLabel, icon: null };
let obj4 = { source: require("module_11468") };
obj3.icon = closure_5(require("TableRowIcon").TableRowIcon, obj4);
items = closure_5(require("TableRadioRow").TableRadioRow, obj3);
}
const obj5 = { scrollable: true, header: tmp3, children: null };
const obj6 = { contentContainerStyle: { paddingBottom: require("useSafeAreaInsets")().bottom }, children: null };
let str;
if (selectedChannel != null) {
str = selectedChannel.id;
}
if (str == null) {
str = "";
}
const obj7 = { defaultValue: str, accessibilityLabel: null, onChange: null, hasIcons: true, children: null };
let title;
if (header != null) {
title = header.title;
}
obj7.accessibilityLabel = title;
obj7.onChange = function onChange(arg0) {
noChannelOptionLabel = arg0;
if ("" === arg0) {
if (null != noChannelOptionLabel.noChannelOptionLabel) {
ActionSheetActionCreatorsDefault.hideActionSheet();
obj.onSelect(null);
}
obj = noChannelOptionLabel;
}
const found = channels.find((id) => id.id === closure_0);
if (null != found) {
ActionSheetActionCreatorsDefault.hideActionSheet();
RelationshipStore(found);
}
};
if (items == null) {
items = [];
}
const items1 = [
items,
channels.map((id) => {
const channelIconWithGuild = utils_ChannelUtils.getChannelIconWithGuild(id, importDefault);
const obj2 = { value: id.id, label: null, icon: null };
obj2.label = useChannelName.computeChannelName(id, UserStore, RelationshipStore);
let tmp4Result = null;
if (null != channelIconWithGuild) {
const obj4 = { source: channelIconWithGuild };
tmp4Result = tmp4(TableRowIcon.TableRowIcon, obj4);
}
obj2.icon = tmp4Result;
return hasOwnProperty(TableRadioRow.TableRadioRow, obj2, id.id);
})
];
obj7.children = items1;
obj6.children = closure_6(require("TableRadioGroup").TableRadioGroup, obj7);
obj5.children = closure_5(require("BottomSheetModal").BottomSheetScrollView, obj6);
return closure_5(require("ActionSheet").ActionSheet, obj5);
};