decord/source/modules/guild_onboarding/native/DropdownOptionsActionSheet.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

142 lines
5.9 KiB
TypeScript

// Module ID: 7238
// Function ID: 7239
// Name: DropdownOptionsActionSheet
// Dependencies: [19, 17, 5540, 7203, 1374, 21, 4636, 563, 7233, 1396, 1178, 1114, 4632, 7239, 1611, 4603, 7252, 7253, 6728, 5056, 2]
// Exports: default
// Module 7238 (DropdownOptionsActionSheet)
import useStateFromStores from "useStateFromStores" /* 563 */;
import useSafeAreaInsetsDefault from "useSafeAreaInsets" /* 1611 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4603 */;
import noop from "module_19" /* 19 */;
import EmojiStore from "EmojiStore" /* 5540 */;
import GuildOnboardingPromptsStore from "GuildOnboardingPromptsStore" /* 7203 */;
require = fn;
function DropdownOptionRow(option) {
option = option.option;
({ responses, onSelect } = option);
let selected;
const tmp = closure_10();
const items = [EmojiStore];
const stateFromStores = option(selected[7]).useStateFromStores(items, () => {
const emoji = option.emoji;
let id;
if (emoji != null) {
id = emoji.id;
}
let usableCustomEmojiById = null;
if (null != id) {
const emoji2 = option.emoji;
let id1;
if (emoji2 != null) {
id1 = emoji2.id;
}
usableCustomEmojiById = EmojiStore.getUsableCustomEmojiById(id1);
}
return usableCustomEmojiById;
});
selected = responses.includes(option.id);
const items1 = [onSelect, option, selected];
let emoji = option.emoji;
let id;
const onPress = noop.useCallback(() => {
onSelect(option, !selected);
}, items1);
if (emoji != null) {
id = emoji.id;
}
if (null != id) {
const obj2 = { style: { display: "flex", alignItems: "center" }, children: null };
const obj4 = { textEmojiStyle: null, fastImageStyle: null, src: null, name: null };
({ optionTextEmoji: obj3.textEmojiStyle, optionImageEmoji: obj3.fastImageStyle } = tmp);
let emojiURL;
if (null != stateFromStores) {
const obj6 = { id: null, animated: null, size: null };
({ id: obj5.id, animated: obj5.animated } = stateFromStores);
obj6.size = EMOJI_URL_BASE_SIZE;
emojiURL = tmp12(tmp3[9]).getEmojiURL(obj6);
const tmp12Result = tmp12(tmp3[9]);
}
obj4.src = emojiURL;
const emoji3 = option.emoji;
let str;
if (emoji3 != null) {
str = emoji3.name;
}
if (str == null) {
str = "";
}
obj4.name = str;
obj2.children = closure_8(onSelect(tmp3[8]), obj4);
let leading = tmp10(View, obj2);
tmp12 = onSelect;
const tmp13 = onSelect(tmp3[8]);
} else {
let emoji2 = option.emoji;
let name;
if (emoji2 != null) {
name = emoji2.name;
}
leading = null;
}
let trailing = null;
if (option.canBeNew) {
trailing = null;
if (option.isUnseen) {
const obj7 = { color: tmp2(tmp3[10]).BadgeColors.BRAND, text: null, textStyle: null };
const intl = tmp2(tmp3[11]).intl;
obj7.text = intl.string(tmp2(tmp3[11]).t.y2b7CA);
obj7.textStyle = tmp.newBadge;
trailing = closure_8(tmp2(tmp3[10]).TextBadge, obj7);
}
}
const obj8 = { style: tmp.labelRow, children: null };
const items2 = [closure_8(option(selected[12]).Text, { variant: "text-md/normal", children: option.title }), trailing];
obj8.children = items2;
const label = closure_9(View, obj8);
return closure_8(onSelect(selected[13]), { label, selected, leading, trailing, onPress });
}
const View = fn(17).View;
const EMOJI_URL_BASE_SIZE = fn(1374).EMOJI_URL_BASE_SIZE;
const jsxProd = fn(21);
({ jsx: closure_8, jsxs: closure_9 } = jsxProd);
const createStyles = fn(4636);
let closure_10 = createStyles.createStyles({ optionTextEmoji: { fontSize: 24, lineHeight: 24, paddingTop: 5 }, optionImageEmoji: { height: 24, width: 24 }, newBadge: { fontWeight: "bold" }, labelRow: { display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center" }, closeButtonWrapper: { marginTop: 16, marginHorizontal: 16 } });
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild_onboarding/native/DropdownOptionsActionSheet.tsx");
export default function DropdownOptionsActionSheet(arg0) {
({ guildId: require, promptId: importDefault, canBeNew: dependencyMap, onSelect: noop } = arg0);
const tmp = closure_10();
const items = [GuildOnboardingPromptsStore];
const stateFromStores = useStateFromStores.useStateFromStores(items, () => GuildOnboardingPromptsStore.getOnboardingPrompt(importDefault));
const items1 = [GuildOnboardingPromptsStore];
const responses = useStateFromStores.useStateFromStoresArray(items1, () => GuildOnboardingPromptsStore.getOnboardingResponsesForPrompt(require, importDefault));
if (null == stateFromStores) {
return null;
} else {
const obj3 = { title: null };
const intl = tmp3(1114).intl;
obj3.title = intl.string(tmp3(1114).t.E2ICbC);
const obj4 = { scrollable: true, header: closure_8(tmp3(7252).BottomSheetTitleHeader, obj3), children: null };
const obj5 = { contentContainerStyle: null, children: null };
const obj6 = { paddingBottom: useSafeAreaInsetsDefault().bottom };
obj5.contentContainerStyle = obj6;
const obj7 = { accessibilityRole: "radiogroup", accessibilityLabel: null, children: null };
const intl2 = tmp3(1114).intl;
obj7.accessibilityLabel = intl2.string(tmp3(1114).t.E2ICbC);
const options = stateFromStores.options;
obj7.children = options.map((option) => React6(DropdownOptionRow, { option, responses, onSelect, canBeNew: Boolean(dependencyMap) }, option.id));
const items2 = [closure_8(tmp3(1178).CardSection, obj7), ];
const obj8 = { style: tmp.closeButtonWrapper, children: null };
const obj9 = { onPress: tmp5, text: null, grow: true };
const intl3 = tmp3(1114).intl;
obj9.text = intl3.string(tmp3(1114).t.cpT0Cq);
obj8.children = closure_8(tmp3(5056).Button, obj9);
items2[1] = closure_8(responses, obj8);
obj5.children = items2;
obj4.children = closure_9(tmp3(6728).BottomSheetScrollView, obj5);
return closure_8(tmp3(7253).BottomSheet, obj4);
}
};