decord/alpha/source/modules/channel/native/ChannelPickerActionSheet.tsx
github-actions e160b228c5 chore: update source for alpha 348.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4942.js (118.4 MB)
2026-09-22 07:41:18 +00:00

104 lines
3.9 KiB
TypeScript

// Module ID: 11597
// Function ID: 11598
// Name: ChannelPickerActionSheet
// Dependencies: [19, 4406, 1372, 21, 1612, 7445, 4724, 7396, 5907, 5830, 11598, 7444, 6871, 5904, 5241, 4910, 2]
// Exports: default
// Module 11597 (ChannelPickerActionSheet)
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4724 */;
import useChannelName from "useChannelName" /* 4910 */;
import utils_ChannelUtils from "utils/ChannelUtils" /* 5241 */;
import TableRadioRow from "TableRadioRow" /* 5907 */;
import noop from "module_19" /* 19 */;
import RelationshipStore from "RelationshipStore" /* 4406 */;
import UserStore from "UserStore" /* 1372 */;
const require = globalThis.__r;
const TableRowIcon = tmp(5830);
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_11598") };
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);
};