179 lines
10 KiB
TypeScript
179 lines
10 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] */
|
|
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
|
|
var object4;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const presenceStore = importDefault(4396) /* metro dependency 4396: PresenceStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_9 = (require(482) /* metro dependency 482: Constants */).StatusTypes;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
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;
|
|
object4 = {};
|
|
const object5 = {borderWidth: 1};
|
|
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
|
|
object5.borderColor = BORDER_STRONG;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.paddingVertical = PX_8;
|
|
object4.container = object5;
|
|
const object6 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': null, 'height': 40};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object6.gap = PX_12;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.marginHorizontal = PX_16;
|
|
object4.row = object6;
|
|
object4.label = {flexShrink: 1};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object4]);
|
|
(require(2) /* metro dependency 2 */).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 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
|
|
const GroupDMAvatar = importDefault(9719) /* metro dependency 9719: GroupDMAvatar */;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const REFRESH_MEDIUM_32 = AvatarSizes.REFRESH_MEDIUM_32;
|
|
const groupDMAvatar = <GroupDMAvatar size={REFRESH_MEDIUM_32} channel={channel} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).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 userBinding = user;
|
|
object.isMobileOnline = PresenceStore.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};
|
|
items2 = [((Avatar) => <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 />)((require(1305) /* metro dependency 1305: native */).Avatar)];
|
|
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 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
|
|
const GuildIconWithChannelType = (require(9793) /* metro dependency 9793: GuildIconWithChannelType */).GuildIconWithChannelType;
|
|
const object = {};
|
|
object['aria-label'] = '';
|
|
object.guild = guild;
|
|
object.channel = channel;
|
|
const GuildIconWithChannelTypeSizes = (require(9793) /* metro dependency 9793: GuildIconWithChannelType */).GuildIconWithChannelTypeSizes;
|
|
const SMALL_32 = GuildIconWithChannelTypeSizes.SMALL_32;
|
|
object.size = SMALL_32;
|
|
const guildIconWithChannelType = <GuildIconWithChannelType {...object} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).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} = (require(566) /* metro dependency 566: flux */).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 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 = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var jsxRuntimeEnv0_12Binding;
|
|
var object6;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
|
|
const alertModalProps = {title: title, content: content,
|
|
extraContent: <View style={styles.container}>{failedDestinations.map(_fun76752)}</View>};
|
|
const AlertActions = (require(4500) /* metro dependency 4500: AlertModalNative */).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 _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 _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} />;
|
|
}
|
|
|