236 lines
14 KiB
TypeScript
236 lines
14 KiB
TypeScript
/* Metro module 14879; source: modules/icymi/native/ICYMIGuildEventRow.tsx; dependencies: [31, 27, 4117, 1379, 1867, 33, 14815, 697, 9045, 1244, 9039, 4805, 9042, 9121, 9580, 9032, 6947, 9035, 14856, 21, 4573, 9123, 6699, 1305, 566, 2] */
|
|
import SnowflakeUtils from '../../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import GuildScheduledEventStore from '../../guild_scheduled_events/GuildScheduledEventStore.tsx'; /* Metro dependency 4117 */
|
|
import UseEventSchedule from '../../guild_scheduled_events/useEventSchedule.tsx'; /* Metro dependency 9045 */
|
|
import ICYMIActionCreators from '../ICYMIActionCreators.tsx'; /* Metro dependency 9580 */
|
|
import ICYMICardInCard from './ICYMICardInCard.tsx'; /* Metro dependency 14856 */
|
|
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 TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as GroupIconModule from '../../../design/components/Icon/native/redesign/generated/GroupIcon.tsx'; /* Metro dependency 6699 */
|
|
import * as GuildScheduledEventModalActionCreatorsNativeModule from '../../guild_scheduled_events/GuildScheduledEventModalActionCreators.native.tsx'; /* Metro dependency 9032 */
|
|
import * as ScheduleUtilsModule from '../../guild_scheduled_events/utils/ScheduleUtils.tsx'; /* Metro dependency 9039 */
|
|
import * as GuildEventUtilsModule from '../../guild_scheduled_events/native/components/GuildEventUtils.tsx'; /* Metro dependency 9121 */
|
|
import * as CreateICYMIStylesModule from './createICYMIStyles.tsx'; /* Metro dependency 14815 */
|
|
|
|
function _fun112559(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:6, offset: 0x023d1cef, size: 304 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.Pressable;
|
|
const env0_5 = value.View;
|
|
value = require(4117) /* metro dependency 4117: GuildScheduledEventStore */;
|
|
const env0_6 = value.isGuildEventEnded;
|
|
const env0_7 = value.isGuildScheduledEventActive;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
const env0_13 = (CreateICYMIStylesModule).createICYMIStyles(_fun112564);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/icymi/native/ICYMIGuildEventRow.tsx');
|
|
exports.default = ICYMIGuildEventRowWrapper;
|
|
function ICYMIGuildEventRow({event, channel, guild}) { // fn#112560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:899, offset: 0x023d1e1f, size: 1503 bytes, params: 2, frame: 43
|
|
var moduleValue5;
|
|
const value3 = env0_13();
|
|
const value5 = (UseEventSchedule)(event, null);
|
|
const isGuildScheduledEventActive2 = isGuildScheduledEventActive(event);
|
|
const r1 = value5 == null ? undefined : value5.startTime.toISOString();
|
|
const env0_3 = r1;
|
|
const binding = env0_3;
|
|
const useMemo = binding.useMemo;
|
|
const startDateTimeString = Reflect.apply(useMemo, binding, [_fun112561, [r1,
|
|
isGuildScheduledEventActive2]]).startDateTimeString;
|
|
const r23 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel) ?? (require(9042) /* metro dependency 9042: EntityUtils */).getLocationFromEvent(event);
|
|
const eventLocationIconSource = (GuildEventUtilsModule).getEventLocationIconSource(event,
|
|
channel, true);
|
|
const eventLocationIconComponent = (GuildEventUtilsModule).getEventLocationIconComponent(event,
|
|
channel, true);
|
|
const nextRecurrenceIdInEvent = (ScheduleUtilsModule).getNextRecurrenceIdInEvent(event);
|
|
const value12 = env0_3.useCallback(_fun112562, [event]);
|
|
const value13 = env0_3.useCallback(_fun112563, [guild.id, event.id]);
|
|
let r11 = event.description != null && event.description.length > 0;
|
|
const value16 = (importDefault(9035) /* metro dependency 9035: useGuildScheduledEventUserCount */)(event?.guild_id,
|
|
event?.id, nextRecurrenceIdInEvent);
|
|
object = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.actionLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['6pFsLQ']);
|
|
object.id = event.id;
|
|
object.interactionType = 'guild_event';
|
|
object.channelId = channel?.id;
|
|
object.guildId = guild.id;
|
|
const defaultImport4 = SnowflakeUtils;
|
|
object.timestamp = defaultImport4.extractTimestamp(event.id);
|
|
object.onHeaderPress = value13;
|
|
object.onHeaderLongPress = value13;
|
|
const container = value3.container;
|
|
const timeAndUserPillContainer = value3.timeAndUserPillContainer;
|
|
const Text = (TextModule).Text;
|
|
const items2 = [
|
|
<View style={timeAndUserPillContainer}>
|
|
<Text variant="text-sm/semibold" color={isGuildScheduledEventActive2 ? 'status-positive' : 'text-brand'}>
|
|
{startDateTimeString}
|
|
</Text>
|
|
</View>,
|
|
];
|
|
r11 = r11 && value3.title;
|
|
items2[1] = (
|
|
<Text style={r11} variant="text-lg/semibold">
|
|
{event.name}
|
|
</Text>
|
|
);
|
|
let r8 = event.description != null && event.description.length > 0;
|
|
if (r8) {
|
|
moduleValue5 = require(9123) /* metro dependency 9123: guildEventDetailsParserNative */;
|
|
r8 = (
|
|
<Text
|
|
variant="text-md/normal"
|
|
color="text-subtle"
|
|
lineClamp={5}
|
|
>
|
|
{moduleValue5.guildEventDetailsParser(event.description, true, {guildId: guild.id})}
|
|
</Text>
|
|
);
|
|
}
|
|
items2[2] = r8;
|
|
items2[3] = <View style={value3.separator} />;
|
|
const infoContainer = value3.infoContainer;
|
|
const locationContainer = value3.locationContainer;
|
|
const GroupIcon = (GroupIconModule).GroupIcon;
|
|
items2[4] = (
|
|
<View style={infoContainer}>
|
|
<View style={locationContainer}>
|
|
<GroupIcon size="xs" style={value3.eventsChannelIcon} />
|
|
<Text
|
|
lineClamp={1}
|
|
variant="text-xs/normal"
|
|
color="text-muted"
|
|
>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t['+DLsD8'],
|
|
{count: value16})}
|
|
</Text>
|
|
</View>
|
|
<View style={value3.locationContainer}>
|
|
{
|
|
eventLocationIconComponent != null
|
|
? ((Component) => <Component size="xs" style={value3.eventsChannelIcon} />)(eventLocationIconComponent)
|
|
: eventLocationIconSource != null && ((Icon) => <Icon source={eventLocationIconSource} size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.EXTRA_SMALL} style={value3.eventsChannelIcon} disableColor />)((require(1305) /* metro dependency 1305: native */).Icon)
|
|
}
|
|
<Text
|
|
lineClamp={2}
|
|
variant="text-xs/normal"
|
|
color="text-muted"
|
|
>
|
|
{r23 != null ? (require(9123) /* metro dependency 9123: guildEventDetailsParserNative */).guildEventDetailsParser(r23,
|
|
true) : null}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
return (
|
|
<ICYMICardInCard {...object}>
|
|
<Pressable onPress={value12} style={container}>
|
|
{items2}
|
|
</Pressable>
|
|
</ICYMICardInCard>
|
|
);
|
|
function _fun112561() { // fn#112561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:1047, offset: 0x023d23fe, size: 113 bytes, params: 1, frame: 16
|
|
var r0;
|
|
var object;
|
|
var intl;
|
|
if (env0_2) {
|
|
object = {};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.startDateTimeString = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TxqPQR);
|
|
r0 = object;
|
|
} else {
|
|
r0 = (require(9039) /* metro dependency 9039: ScheduleUtils */).getEventTimeData(env0_3);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun112562() { // fn#112562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:1386, offset: 0x023d246f, size: 164 bytes, params: 1, frame: 21
|
|
const value = environment.__proto__;
|
|
const defaultImport = ICYMIActionCreators;
|
|
const itemInteracted = defaultImport.itemInteracted;
|
|
const eventBinding = event;
|
|
Reflect.apply(itemInteracted, defaultImport, [eventBinding.id, 'guild_event', 'press_event']);
|
|
defaultImport.feedItemActioned({itemId: eventBinding.id, itemType: 'guild_event',
|
|
actionParameters: {'actionGestureType': 'press', 'actionTargetElement': 'item_body',
|
|
'actionIntentType': 'navigate', 'actionDestinationType': 'event'}});
|
|
(GuildScheduledEventModalActionCreatorsNativeModule).openGuildEventDetails({eventId: eventBinding.id,
|
|
event: eventBinding});
|
|
}
|
|
|
|
function _fun112563() { // fn#112563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:1727, offset: 0x023d2513, size: 156 bytes, params: 1, frame: 22
|
|
let value = environment.__proto__;
|
|
const defaultImport = ICYMIActionCreators;
|
|
const itemInteracted = defaultImport.itemInteracted;
|
|
const eventBinding = event;
|
|
Reflect.apply(itemInteracted, defaultImport, [eventBinding.id, 'guild_event', 'press_event']);
|
|
defaultImport.feedItemActioned({itemId: eventBinding.id, itemType: 'guild_event',
|
|
actionParameters: {'actionGestureType': 'press', 'actionTargetElement': 'item_header',
|
|
'actionIntentType': 'navigate', 'actionDestinationType': 'guild'}});
|
|
value = require(6947) /* metro dependency 6947: transitionToGuildNative */;
|
|
value.transitionToGuild(guild.id);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112564(a0) { // fn#112564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:289, offset: 0x023d25af, size: 349 bytes, params: 2, frame: 15
|
|
const object = {};
|
|
object.container = {marginHorizontal: a0.margin, marginBottom: a0.margin, marginLeft: a0.margin + a0.inset};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.card = {marginTop: PX_12};
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.title = {marginBottom: PX_4};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.timeAndUserPillContainer = {'flexDirection': 'row', 'alignItems': 'center', 'marginBottom': null,
|
|
'justifyContent': 'space-between', marginBottom: PX_8};
|
|
const object4 = {'height': 1, 'width': '100%'};
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object4.backgroundColor = BORDER_SUBTLE;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object4.marginVertical = PX_12;
|
|
object.separator = object4;
|
|
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
object.eventsChannelIcon = {tintColor: INTERACTIVE_TEXT_DEFAULT};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.infoContainer = {gap: PX_4};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.locationContainer = {'alignItems': 'center', 'flexDirection': 'row', gap: PX_8};
|
|
return object;
|
|
}
|
|
|
|
function ICYMIGuildEventRowWrapper({eventId}) { // fn#112565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15076:3592, offset: 0x023d270c, size: 217 bytes, params: 2, frame: 20
|
|
const guildScheduledEvent = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildScheduledEventStore],
|
|
function() {
|
|
return GuildScheduledEventStore.getGuildScheduledEvent(eventId);
|
|
});
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildScheduledEvent?.guild_id);
|
|
});
|
|
return (
|
|
guildScheduledEvent == null || guild == null || isGuildEventEnded(guildScheduledEvent)
|
|
? null
|
|
: (
|
|
<ICYMIGuildEventRow
|
|
event={guildScheduledEvent}
|
|
channel={(require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore],
|
|
function() {
|
|
return ChannelStore.getChannel(guildScheduledEvent?.channel_id);
|
|
})}
|
|
guild={guild}
|
|
/>
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun112559, 14879, [31, 27, 4117, 1379, 1867, 33, 14815, 697, 9045, 1244, 9039, 4805, 9042, 9121, 9580,
|
|
9032, 6947, 9035, 14856, 21, 4573, 9123, 6699, 1305, 566,
|
|
2]) /* metro module 14879, dependencies: [31, 27, 4117, 1379, 1867, 33, 14815, 697, 9045, 1244, 9039, 4805, 9042, 9121, 9580, 9032, 6947, 9035, 14856, 21, 4573, 9123, 6699, 1305, 566, 2] */;
|