273 lines
13 KiB
TypeScript
273 lines
13 KiB
TypeScript
/* Metro module 9792; source: modules/share/native/DestinationFailedAlertModal.tsx; dependencies: [31, 27, 1379, 1867, 4396, 3793, 1878, 482, 33, 4501, 697, 4805, 9719, 1305, 4573, 566, 3995, 9793, 4500, 4500, 1244, 2] */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import PresenceStore from '../../../stores/PresenceStore.tsx'; /* Metro dependency 4396 */
|
|
import UseChannelName from '../../channel/useChannelName.tsx'; /* Metro dependency 4805 */
|
|
import GroupDMAvatar from '../../group_dm/native/GroupDMAvatar.tsx'; /* Metro dependency 9719 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as AlertModalNativeModule from '../../../design/components/AlertModal/native/AlertModal.native.tsx'; /* Metro dependency 4500 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as GuildIconWithChannelTypeModule from '../../guild/native/GuildIconWithChannelType.tsx'; /* Metro dependency 9793 */
|
|
|
|
function _fun76742(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:6, offset: 0x01de3419, size: 519 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = JsxRuntimeModule;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const env0_12 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {borderWidth: 1};
|
|
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
|
|
object2.borderColor = BORDER_STRONG;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.paddingVertical = PX_8;
|
|
object.container = object2;
|
|
const object3 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': null, 'height': 40};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.gap = PX_12;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.marginHorizontal = PX_16;
|
|
object.row = object3;
|
|
object.label = {flexShrink: 1};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/share/native/DestinationFailedAlertModal.tsx');
|
|
exports.default = DestinationFailedAlertModal;
|
|
function FailedGroupDMRow({channel}) { // fn#76743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:563, offset: 0x01de3620, size: 202 bytes, params: 2, frame: 23
|
|
const styles = useStyles();
|
|
const value2 = (UseChannelName)(channel);
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const REFRESH_MEDIUM_32 = AvatarSizes.REFRESH_MEDIUM_32;
|
|
const groupDMAvatar = <GroupDMAvatar size={REFRESH_MEDIUM_32} channel={channel} />;
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={styles.row}>
|
|
{groupDMAvatar}
|
|
<Text
|
|
style={styles.label}
|
|
variant="text-md/medium"
|
|
lineClamp={1}
|
|
ellipsizeMode="tail"
|
|
>
|
|
{value2}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FailedUserRow({user}) { // fn#76744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:837, offset: 0x01de36ea, size: 409 bytes, params: 2, frame: 28
|
|
var r9;
|
|
var r0;
|
|
var items2;
|
|
var Text;
|
|
var value;
|
|
const styles = useStyles();
|
|
const nickname = (require(566) /* metro dependency 566: flux */).useStateFromStores([RelationshipStore],
|
|
function() {
|
|
return RelationshipStore.getNickname(user.id);
|
|
});
|
|
const {isMobileOnline, isVROnline,
|
|
status} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PresenceStore], function() {
|
|
var object = {};
|
|
var presenceStoreBinding = PresenceStore;
|
|
var userBinding = user;
|
|
object.isMobileOnline = presenceStoreBinding.isMobileOnline(userBinding.id);
|
|
object.status = PresenceStore.getStatus(userBinding.id);
|
|
object.isVROnline = PresenceStore.isVROnline(userBinding.id);
|
|
return object;
|
|
});
|
|
if (user != null) {
|
|
var viewBindingProps = {style: styles.row};
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
items2 = [
|
|
<Avatar
|
|
user={user}
|
|
guildId={undefined}
|
|
status={StatusTypes.OFFLINE === status ? null : status}
|
|
isMobileOnline={isMobileOnline}
|
|
isVROnline={isVROnline}
|
|
size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.XSMALL}
|
|
avatarDecoration={user.avatarDecoration}
|
|
autoStatusCutout
|
|
/>,
|
|
];
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
var textProps = {'style': null, 'variant': 'text-md/medium', 'lineClamp': 1, 'ellipsizeMode': 'tail',
|
|
style: styles.label};
|
|
if (nickname != null) {
|
|
r9 = nickname;
|
|
} else {
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = value.getName(user);
|
|
r9 = value;
|
|
}
|
|
items2[1] = (
|
|
<Text {...textProps}>
|
|
{r9}
|
|
</Text>
|
|
);
|
|
value = (
|
|
<View {...viewBindingProps}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
r0 = value;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function FailedChannelRow({channel}) { // fn#76747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:1506, offset: 0x01de38fb, size: 266 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(channel?.guild_id);
|
|
});
|
|
const value2 = (UseChannelName)(channel);
|
|
const GuildIconWithChannelType = (GuildIconWithChannelTypeModule).GuildIconWithChannelType;
|
|
const object2 = {};
|
|
object2['aria-label'] = '';
|
|
object2.guild = guild;
|
|
object2.channel = channel;
|
|
const GuildIconWithChannelTypeSizes = (GuildIconWithChannelTypeModule).GuildIconWithChannelTypeSizes;
|
|
const SMALL_32 = GuildIconWithChannelTypeSizes.SMALL_32;
|
|
object2.size = SMALL_32;
|
|
const guildIconWithChannelType = <GuildIconWithChannelType {...object2} />;
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={styles.row}>
|
|
{guildIconWithChannelType}
|
|
<Text
|
|
style={styles.label}
|
|
variant="text-md/medium"
|
|
lineClamp={1}
|
|
ellipsizeMode="tail"
|
|
>
|
|
{value2}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FailedDestinationRow({destination}) { // fn#76749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:1918, offset: 0x01de3a34, size: 187 bytes, params: 2, frame: 18
|
|
const {channel, user} = (FluxModule).useStateFromStoresObject([ChannelStore,
|
|
UserStore], _fun76750);
|
|
return (
|
|
channel == null
|
|
? (
|
|
user != null
|
|
? (
|
|
<FailedUserRow user={user} />
|
|
)
|
|
: (
|
|
channel != null
|
|
? (
|
|
<FailedChannelRow channel={channel} />
|
|
)
|
|
: null
|
|
)
|
|
)
|
|
: (
|
|
channel.isGroupDM()
|
|
? (
|
|
<FailedGroupDMRow channel={channel} />
|
|
)
|
|
: (
|
|
user != null
|
|
? (
|
|
<FailedUserRow user={user} />
|
|
)
|
|
: (
|
|
channel != null
|
|
? (
|
|
<FailedChannelRow channel={channel} />
|
|
)
|
|
: null
|
|
)
|
|
)
|
|
)
|
|
);
|
|
function _fun76750() { // fn#76750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:2013, offset: 0x01de3aef, size: 106 bytes, params: 1, frame: 15
|
|
const type = destination.type;
|
|
const value2 = null;
|
|
return {channel: type !== 'channel' ? value2 : ChannelStore.getChannel(destination.id),
|
|
user: destination.type !== 'user' ? value2 : UserStore.getUser(destination.id)};
|
|
}
|
|
|
|
}
|
|
|
|
function DestinationFailedAlertModal({title, content, failedDestinations, onRetry}) { // fn#76751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:2376, offset: 0x01de3b59, size: 511 bytes, params: 2, frame: 32
|
|
var r7;
|
|
const AlertActionButton = (AlertModalNativeModule).AlertActionButton;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var jsxRuntimeEnv0_12Binding;
|
|
var object;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const AlertModal = (AlertModalNativeModule).AlertModal;
|
|
const alertModalProps = {title: title, content: content,
|
|
extraContent: <View style={styles.container}>{failedDestinations.map(_fun76752)}</View>};
|
|
const AlertActions = (AlertModalNativeModule).AlertActions;
|
|
if (onRetry != null) {
|
|
jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
items2 = [
|
|
<AlertActionButton
|
|
variant="primary"
|
|
onPress={onRetry}
|
|
text={intl.string(t['5911Lb'])}
|
|
key="confirm"
|
|
/>,
|
|
];
|
|
items2[1] = (
|
|
<AlertActionButton
|
|
variant="secondary"
|
|
text={intl.string(t.WAI6xu)}
|
|
key="cancel"
|
|
/>
|
|
);
|
|
r7 = (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
} else {
|
|
r7 = (
|
|
<AlertActionButton
|
|
variant="primary"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.BddRzS)}
|
|
key="confirm"
|
|
/>
|
|
);
|
|
}
|
|
alertModalProps.actions = (
|
|
<AlertActions>
|
|
{r7}
|
|
</AlertActions>
|
|
);
|
|
return <AlertModal {...alertModalProps} />;
|
|
function _fun76752(a0, a1) { // fn#76752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9978:2576, offset: 0x01de3d58, size: 35 bytes, params: 3, frame: 15
|
|
return <FailedDestinationRow destination={a0} key={a1} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun76742, 9792, [31, 27, 1379, 1867, 4396, 3793, 1878, 482, 33, 4501, 697, 4805, 9719, 1305, 4573, 566,
|
|
3995, 9793, 4500, 4500, 1244,
|
|
2]) /* metro module 9792, dependencies: [31, 27, 1379, 1867, 4396, 3793, 1878, 482, 33, 4501, 697, 4805, 9719, 1305, 4573, 566, 3995, 9793, 4500, 4500, 1244, 2] */;
|