This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,81 @@
// Metro module 11365 (f11366).
import { useState, useRef, useEffect } from "react";
import GuildStore from "../../../../../stores/GuildStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { TextIcon } from "../../../../../design/components/Icon/native/redesign/generated/TextIcon";
import { getChannelIconComponentWithGuild } from "../../../../../utils/native/ChannelUtils";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import AutocompleteUtils from "../../../../../utils/AutocompleteUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState, AppLauncherList } from "../../base_components/AppLauncherList";
import useChannelName from "../../../../channel/useChannelName";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
import { Text } from "../../../../../design/components/Text/native/Text";
let c7722_8, useStyles, ChannelListItem;
const ChannelIcon = function ChannelIcon(props) {
const { channel: channel2, size = "sm", wrapperSize = 32 } = props;
const styles = useStyles();
let TextIcon2 = TextIcon;
if (channel2 != null) {
let r23 = getChannelIconComponentWithGuild(channel2, GuildStore.getGuild(channel2.getGuildId()));
if (r23 == null) {
r23 = TextIcon;
}
TextIcon2 = r23;
}
return <AppLauncherOptionIcon icon={<TextIcon2 size={size} color="interactive-text-default" />} wrapperStyle={styles.channelIconWrapper} wrapperSize={wrapperSize} />;
};
ChannelListItem = function ChannelListItem(props) {
const { channel: channel2, index, totalCount } = props;
return <TableRow key={channel2.id} onPress={props.onPress} label={<Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary">
{useChannelName(channel2)}
</Text>} icon={<ChannelIcon channel={channel2} />} start={index === 0} end={index === totalCount - 1} />;
};
c7722_8 = "AppLauncherChannelListActionSheet";
useStyles = createStyles({
channelIconWrapper: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
}
});
export default function AppLauncherChannelListActionSheet(props) {
const { onChannelPress, onActionSheetDismiss, channel, option } = props;
const [state, setState] = useState("");
const ref = useRef(null);
const [state2, setState2] = useState([]);
const length = state2.length;
useEffect(() => {
setState2(AutocompleteUtils.queryApplicationCommandChannelResults({
query: state,
channel,
channelTypes: option.channelTypes,
limit: null,
allowSnowflake: true
}).channels);
}, [state, channel, option]);
return <AppLauncherCommandOptionActionSheet onDismiss={onActionSheetDismiss} option={option}>
<AppLauncherListSearchBar onChange={function onChange(event) {
setState(event.toLowerCase());
const current = ref.current;
if (current != null) {
current.scrollToOffset({
offset: 0,
animated: false
});
}
}} />
{length === 0 ? <AppLauncherListEmptyState /> : <AppLauncherList ref={ref} data={state2} renderItem={function renderItem(info) {
const item = info.item;
return <ChannelListItem channel={item} index={info.index} totalCount={state2.length} onPress={() => {
onChannelPress({
channel: item
});
ActionSheetActionCreators.hideActionSheet(c7722_8);
onActionSheetDismiss();
}} />;
}} />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY = "AppLauncherChannelListActionSheet";
export { ChannelIcon };
@@ -0,0 +1,42 @@
// Metro module 11364 (f11365).
import { useState, useEffect } from "react";
import ChannelStore from "../../../../../stores/ChannelStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import useChannelName from "../../../../channel/useChannelName";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import { ChannelIcon, APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY } from "./AppLauncherChannelListActionSheet";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
export default function AppLauncherChannelOption(props) {
let state, setState, stateFromStores;
const { style, option, initialValue, onChannelPress: onChannelPress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
state = void 0;
setState = void 0;
stateFromStores = void 0;
[state, setState] = useState(() => initialValue != null ? initialValue.type === "channelMention" ? initialValue.channelId : null : null);
stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(state), [state]);
useEffect(() => {
if (state != null && stateFromStores == null) {
setState(null);
onChannelPress2({
channel: null
});
}
}, [onChannelPress2, state, stateFromStores]);
const channelName = useChannelName(stateFromStores);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={stateFromStores != null} selectedItemName={stateFromStores != null ? channelName : void 0} leading={<ChannelIcon channel={stateFromStores} />} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
ActionSheetActionCreators.openLazy(import("./AppLauncherChannelListActionSheet"), APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY, {
option,
channel,
onChannelPress: ({ channel: channel2 }) => {
setState(channel2?.id);
onChannelPress2({
channel: channel2
});
},
onActionSheetDismiss
});
}} autoFocus={autoFocus} />;
};