130 lines
7.4 KiB
TypeScript
130 lines
7.4 KiB
TypeScript
/* Metro module 14673; source: modules/premium/powerups/native/GuildPowerupsRecentActivitySection.tsx; dependencies: [27, 4502, 33, 4501, 697, 14674, 3826, 4788, 566, 8206, 7958, 14677, 12320, 1305, 4573, 14679, 14675, 1244, 2] */
|
|
function _fun110761(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14870:6, offset: 0x02386227, size: 399 bytes, params: 8, frame: 23
|
|
var object4;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value.jsx;
|
|
const env0_6 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object4 = {};
|
|
const object5 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.marginTop = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.paddingHorizontal = PX_16;
|
|
object4.sectionContainer = object5;
|
|
const object6 = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object6.gap = PX_12;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.marginTop = PX_16;
|
|
object4.boostContainer = object6;
|
|
object4.boostRowContainer = {'flexDirection': 'row', 'alignItems': 'center', 'gap': 8};
|
|
object4.boostMessage = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center'};
|
|
object4.username = {'maxWidth': 170, 'flexShrink': 1};
|
|
object4.messageText = {flexShrink: 0};
|
|
object4.timestamp = {flexShrink: 0};
|
|
const env0_7 = Reflect.apply(createStyles, value, [object4]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/native/GuildPowerupsRecentActivitySection.tsx');
|
|
exports.default = GuildPowerupsRecentActivitySection;
|
|
}
|
|
|
|
function GuildPowerupsRecentActivityRow({row, isExpiringBoostsEnabled}) { // fn#110762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14870:549, offset: 0x023863b6, size: 939 bytes, params: 2, frame: 34
|
|
var r8;
|
|
var r4;
|
|
var moduleValue3;
|
|
var calendarFormat;
|
|
var Date;
|
|
var value5;
|
|
var date;
|
|
var object;
|
|
const boost = row.boost;
|
|
const phase = row.phase;
|
|
const sortKey = row.sortKey;
|
|
const styles = useStyles();
|
|
const {username, roleColor,
|
|
roleColorStrings} = (require(14674) /* metro dependency 14674: useMaybeGetSortedBoosts */).useGetBoostUserConfig(boost);
|
|
if (isExpiringBoostsEnabled) {
|
|
moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
calendarFormat = moduleValue3.calendarFormat;
|
|
Date = global.Date;
|
|
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(sortKey);
|
|
r8 = Reflect.apply(calendarFormat, moduleValue3, [date instanceof Object ? date : value5]);
|
|
} else {
|
|
r8 = (require(4788) /* metro dependency 4788: NotificationCenterUtils */).getRelativeTimestamp(sortKey, true);
|
|
}
|
|
const roleStyle = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.roleStyle;
|
|
});
|
|
const r21 = roleStyle !== 'username' ? {} : roleColor != null ? {color: roleColor} : {};
|
|
const value8 = (require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */).useProcessColorStringsArray(roleColorStrings);
|
|
const enhancedRoleColorUtilsModule = require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */;
|
|
const useIsRoleStyleAndRoleColorsEligibleForERC = enhancedRoleColorUtilsModule.useIsRoleStyleAndRoleColorsEligibleForERC;
|
|
const guildId = boost.guildId;
|
|
const userId = boost.userId;
|
|
const value9 = Reflect.apply(useIsRoleStyleAndRoleColorsEligibleForERC, enhancedRoleColorUtilsModule, [guildId,
|
|
userId, roleStyle, value8]);
|
|
const value10 = phase === 'gave';
|
|
const r10 = value10 ? (require(7958) /* metro dependency 7958: BoostGemIcon */).BoostGemIcon : phase === 'expiring' ? (require(14677) /* metro dependency 14677: BoostTier1Icon */).BoostTier1Icon : (require(12320) /* metro dependency 12320: BoostGemSlashIcon */).BoostGemSlashIcon;
|
|
if (value10) {
|
|
object = {};
|
|
object.color = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GUILD_BOOSTING_PINK;
|
|
object.size = 'sm';
|
|
r4 = object;
|
|
} else {
|
|
r4 = {size: 'sm'};
|
|
}
|
|
const items3 = [((Component) => <Component {...r4} />)(r10)];
|
|
const items2 = [roleStyle === 'dot' && roleColor != null && ((RoleDot) => <RoleDot size="small" color={roleColor} colors={roleColorStrings} />)((require(1305) /* metro dependency 1305: native */).RoleDot)];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const username2 = styles.username;
|
|
items2[1] = <Text variant="text-md/medium" color="interactive-text-active" lineClamp={1} style={[username2,
|
|
r21]} gradientColors={value9 ? value8 : undefined}>{username}</Text>;
|
|
items2[2] = <Text variant="text-md/medium" color="interactive-text-active">{' '}</Text>;
|
|
items2[3] = <Text variant="text-md/medium" lineClamp={1} style={styles.messageText}>{(importDefault(14679) /* metro dependency 14679: getBoostRowMessageText */)(row)}</Text>;
|
|
items3[1] = <View style={styles.boostMessage}>{items2}</View>;
|
|
items3[2] = <Text variant="text-xs/semibold" style={styles.timestamp}>{r8}</Text>;
|
|
return (
|
|
<View style={styles.boostRowContainer}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function GuildPowerupsRecentActivitySection({guildId}) { // fn#110764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14870:1908, offset: 0x02386761, size: 296 bytes, params: 2, frame: 26
|
|
var r0;
|
|
var Text;
|
|
var intl;
|
|
const styles = useStyles();
|
|
const value2 = (importDefault(14674) /* metro dependency 14674: useMaybeGetSortedBoosts */)(guildId, 10);
|
|
const env0_0 = (require(14675) /* metro dependency 14675: ExpiringBoostsExperiment */).useExpiringBoostsEnabled('GuildPowerupsRecentActivity');
|
|
if (value2.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
var viewBindingProps = {style: styles.sectionContainer};
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r0 = <View {...viewBindingProps}><Text variant="heading-lg/semibold" color="text-subtle">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.yM9Krm)}</Text><View style={styles.boostContainer}>{value2.map(_fun110765)}</View></View>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun110765(a0) { // fn#110765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14870:2285, offset: 0x02386889, size: 79 bytes, params: 2, frame: 16
|
|
const value = environment.__proto__;
|
|
return (
|
|
<GuildPowerupsRecentActivityRow
|
|
row={a0}
|
|
isExpiringBoostsEnabled={env0_0}
|
|
key={'boost-' + a0.boost.id}
|
|
/>
|
|
);
|
|
}
|
|
|