148 lines
8.1 KiB
TypeScript
148 lines
8.1 KiB
TypeScript
/* Metro module 14434; source: modules/guilds_bar/native/GuildsBarDirectMessage.tsx; dependencies: [31, 1226, 4258, 1379, 5214, 3793, 1878, 661, 33, 4501, 697, 14395, 566, 9122, 1244, 14397, 4601, 12129, 14435, 9719, 1305, 5475, 2] */
|
|
function _fun109238(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:6, offset: 0x02342934, size: 370 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const callStore = importDefault(4258) /* metro dependency 4258: CallStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildReadStateStore = importDefault(5214) /* metro dependency 5214: GuildReadStateStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_10 = (require(661) /* metro dependency 661: Constants */).ChannelTypes;
|
|
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
const object = {};
|
|
let GUILD_BAR_ITEM_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_BAR_ITEM_SIZE;
|
|
object.width = GUILD_BAR_ITEM_SIZE;
|
|
GUILD_BAR_ITEM_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_BAR_ITEM_SIZE;
|
|
object.height = GUILD_BAR_ITEM_SIZE;
|
|
const env0_12 = Reflect.apply(createStyles, createStylesModule, [{dm: object}]);
|
|
value = value.memo(GuildsBarDirectMessage);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guilds_bar/native/GuildsBarDirectMessage.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function GuildsBarDirectMessage({channelId}) { // fn#109239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:349, offset: 0x02342aa6, size: 635 bytes, params: 2, frame: 27
|
|
var r4;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
var value;
|
|
const styles = useStyles();
|
|
const value2 = (require(14395) /* metro dependency 14395: GuildsBarAnimatedItemWrapper */).useGuildsBarAnimatedWrapperStyles({'disableSelectedColor': true,
|
|
'disableBGColor': true});
|
|
const count = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildReadStateStore], function() {
|
|
return GuildReadStateStore.getMentionCountForPrivateChannel(channelId).count;
|
|
});
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore, UserStore,
|
|
RelationshipStore, CallStore, AuthenticationStore], _fun109241);
|
|
const channel = value3.channel;
|
|
const dmRecipient = value3.dmRecipient;
|
|
const env0_3 = dmRecipient;
|
|
const label = value3.label;
|
|
const {badge,
|
|
cutouts} = (importDefault(14397) /* metro dependency 14397: useGuildsBarBottomRightBadge */)({mentionCount: count});
|
|
const binding = env0_3;
|
|
const value5 = binding.useMemo(_fun109242, [channel, dmRecipient]);
|
|
const value6 = binding.useMemo(function() {
|
|
return {onPress: _fun109244, onLongPress: _fun109245};
|
|
}, [channel]);
|
|
const GuildsBarAnimatedItemWrapper = importDefault(14395) /* metro dependency 14395: GuildsBarAnimatedItemWrapper */;
|
|
const r15 = channel != null && channel.isMultiUserDM();
|
|
const r5 = channel != null ? ((Component) => <Component channel={channel} />)(importDefault(14435) /* metro dependency 14435: HomeDrawerDM */) : null;
|
|
if (channel == null) {
|
|
if (value5 != null) {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component style={styles.dm} source={value5} />)(value);
|
|
r4 = value;
|
|
} else {
|
|
r4 = null;
|
|
}
|
|
} else if (channel.isMultiUserDM()) {
|
|
r4 = ((Component) => <Component channel={channel} size={AvatarSizes.LARGE_48} pileSizeOverride={AvatarSizes.REFRESH_MEDIUM_32} animate />)(importDefault(9719) /* metro dependency 9719: GroupDMAvatar */);
|
|
} else if (value5 != null) {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component style={styles.dm} source={value5} />)(value);
|
|
r4 = value;
|
|
} else {
|
|
r4 = null;
|
|
}
|
|
return (
|
|
<GuildsBarAnimatedItemWrapper
|
|
selected={false}
|
|
circle={!r15}
|
|
unread
|
|
styles={value2}
|
|
label={label}
|
|
overState={undefined}
|
|
config={value6}
|
|
cutouts={cutouts}
|
|
externalChildren={badge}
|
|
expandedChildren={r5}
|
|
>
|
|
{r4}
|
|
</GuildsBarAnimatedItemWrapper>
|
|
);
|
|
}
|
|
|
|
function _fun109241() { // fn#109241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:630, offset: 0x02342d43, size: 310 bytes, params: 1, frame: 20
|
|
var r1;
|
|
var intl;
|
|
var countBinding;
|
|
let value = environment.__proto__;
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
const value4 = undefined;
|
|
const type = channel == null ? value4 : channel.type;
|
|
const DM = ChannelTypes.DM;
|
|
const r3 = type !== DM ? value4 : UserStore.getUser(channel.getRecipientId());
|
|
const call = CallStore.getCall(channelId);
|
|
const id = AuthenticationStore.getId();
|
|
const r6 = call != null && id != null && call.ringing.includes(id);
|
|
const r5 = CallStore.isCallActive(channelId) && !r6;
|
|
const object2 = {channel: channel, dmRecipient: r3};
|
|
if (channel != null) {
|
|
value = importDefault(9122) /* metro dependency 9122: getChannelA11yLabel */;
|
|
countBinding = count;
|
|
value = value({channel: channel, unread: countBinding > 0, mentionCount: countBinding, isIncomingCall: r6,
|
|
isOngoingCall: r5});
|
|
r1 = value;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r1 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zLZPmk);
|
|
}
|
|
object2.label = r1;
|
|
return object2;
|
|
}
|
|
|
|
function _fun109242() { // fn#109242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1092, offset: 0x02342e79, size: 72 bytes, params: 1, frame: 14
|
|
const channelBinding = channel;
|
|
const value2 = undefined;
|
|
return channelBinding != null && channel.isDM() ? dmRecipient == null ? value2 : dmRecipient.getAvatarSource(value2) : value2;
|
|
}
|
|
|
|
function _fun109243() { // fn#109243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1183, offset: 0x02342ec1, size: 29 bytes, params: 1, frame: 3
|
|
return {onPress: onPress_109244, onLongPress: onLongPress_109245};
|
|
}
|
|
|
|
function onPress_109244() { // fn#109244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1189, offset: 0x02342ede, size: 62 bytes, params: 1, frame: 12
|
|
var value2;
|
|
var moduleValue;
|
|
if (channel != null) {
|
|
value2 = environment.__proto__.__proto__;
|
|
moduleValue = require(4601) /* metro dependency 4601: transitionToChannel */;
|
|
moduleValue.transitionToChannel(channel.id);
|
|
}
|
|
}
|
|
|
|
function onLongPress_109245() { // fn#109245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1244, offset: 0x02342f1c, size: 62 bytes, params: 1, frame: 12
|
|
var value2;
|
|
var moduleValue;
|
|
if (channel != null) {
|
|
value2 = environment.__proto__.__proto__;
|
|
moduleValue = require(12129) /* metro dependency 12129: openChannelLongPressActionSheet */;
|
|
moduleValue.openChannelLongPressActionSheet(channel.id);
|
|
}
|
|
}
|
|
|