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,57 @@
// Metro module 11362 (f11363).
import { useCallback } from "react";
import { DEFAULT_CONTENT_PADDING } from "../../AppLauncherNativeConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { isSnowflake } from "../../../../application_commands/ApplicationCommandUtils";
import { EmptyState } from "../../../../../design/void/native";
import Module11345 from "../../../../../_bundle/Module11345";
import { intl, t } from "../../../../../intl/index.native";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import PrivateChannelUserList from "../../../../main_tabs_v2/native/shared_components/user_list/PrivateChannelUserList";
import GuildChannelUserList from "../../../../main_tabs_v2/native/shared_components/user_list/GuildChannelUserList";
import { AppLauncherList } from "../../base_components/AppLauncherList";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
let c7719_5, useStyles;
const EmptyStateWithSnowflakeQuery = function EmptyStateWithSnowflakeQuery(props) {
const { query, onPressRow: onPressRow2 } = props;
return <AppLauncherList contentContainerStyle={useStyles().emptyState} data={[query]} renderItem={(info) => <TableRow label={info.item} start end onPress={onPressRow2} />} keyboardShouldPersistTaps="always" keyboardDismissMode="on-drag" />;
};
c7719_5 = "AppLauncherUserListActionSheet";
useStyles = createStyles({
emptyState: {
paddingHorizontal: DEFAULT_CONTENT_PADDING,
paddingTop: DEFAULT_CONTENT_PADDING,
flex: 1
}
});
export default function AppLauncherUserListActionSheet(props) {
let callback2;
const { onUserPress, onActionSheetDismiss, channel, option } = props;
callback2 = void 0;
const { guild_id, id } = channel;
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet(c7719_5);
onActionSheetDismiss();
}, [onActionSheetDismiss]);
callback2 = useCallback((a0) => {
onUserPress({
user: a0.user
});
callback();
}, [callback, onUserPress]);
const callback3 = useCallback((a0) => {
const user = a0;
return isSnowflake(a0) ? <EmptyStateWithSnowflakeQuery query={a0} onPressRow={() => callback2({
user
})} /> : <EmptyState style={{
paddingTop: 80
}} lightSource={Module11345} darkSource={Module11345} title={intl.string(t.vYocDz)} body={intl.string(t.V6nAfF)} />;
}, [callback2]);
return <AppLauncherCommandOptionActionSheet onDismiss={onActionSheetDismiss} option={option} contentContainerStyles={{
paddingHorizontal: 0
}}>
{channel.isPrivate() ? <PrivateChannelUserList channelId={id} disableStickySections hideTitle headerShown={false} inActionSheet onUserPress={callback2} opensUserProfileOnUserPress={false} /> : <GuildChannelUserList channelId={id} guildId={guild_id} searchable searchableEmptyState={callback3} headerShown={false} opensUserProfileOnUserPress={false} onUserPress={callback2} inActionSheet disableThemedGradient />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY = "AppLauncherUserListActionSheet";
@@ -0,0 +1,55 @@
// Metro module 11361 (f11362).
import { useState } from "react";
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import { dismissGlobalKeyboard } from "../../../../../utils/native/KeyboardManagerUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY } from "./AppLauncherUserListActionSheet";
import { Avatar, AvatarSizes } from "../../../../../design/void/native";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import { UserCircleIcon } from "../../../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import UsernameText from "../../base_components/UsernameText";
import { Text } from "../../../../../design/components/Text/native/Text";
const useStyles = createStyles({
iconWrapper: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
}
});
export default function AppLauncherUserOption(props) {
let setState, setState2;
const { style, option, initialValue, onUserPress: onUserPress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
setState = void 0;
setState2 = void 0;
const styles = useStyles();
const guild_id = channel.guild_id;
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
let state;
[state, setState] = useState(() => initialValue != null ? initialValue.type === "userMention" ? initialValue.userId : null : null);
let user;
[user, setState2] = useState(null);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={user != null || state != null} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
dismissGlobalKeyboard();
ActionSheetActionCreators.openLazy(import("./AppLauncherUserListActionSheet"), APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY, {
option,
channel,
onUserPress: ({ user }) => {
if (typeof user === "string") {
setState(user);
} else {
setState(user.id);
setState2(user);
}
onUserPress2({
user
});
},
onActionSheetDismiss
});
}} leading={user != null ? <Avatar user={user} guildId={guild_id} animate={!stateFromStores} size={AvatarSizes.REFRESH_MEDIUM_32} /> : <AppLauncherOptionIcon icon={<UserCircleIcon size="sm" color="interactive-text-default" />} wrapperStyle={styles.iconWrapper} />} selectedItemName={user != null ? <UsernameText guildId={guild_id} user={user} /> : state != null ? <Text variant="text-md/medium" color="text-default">{state}</Text> : null} autoFocus={autoFocus} />;
};