274 lines
17 KiB
TypeScript
274 lines
17 KiB
TypeScript
/* Metro module 13413; source: modules/parent_tools/native/FamilyCenterActivityRow.tsx; dependencies: [31, 27, 1878, 5116, 5117, 661, 33, 4501, 697, 1305, 44, 632, 21, 4573, 3995, 5187, 6819, 8642, 1244, 2224, 13414, 13417, 13418, 2] */
|
|
function _fun102063(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13603:6, offset: 0x0222a338, size: 802 bytes, params: 8, frame: 27
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const familyCenterStore = importDefault(5116) /* metro dependency 5116: FamilyCenterStore */;
|
|
const env0_6 = (require(5117) /* metro dependency 5117: FamilyCenterConstants */).ACTION_TO_TEXT;
|
|
const env0_7 = (require(661) /* metro dependency 661: Constants */).GuildFeatures;
|
|
const value2 = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value2.jsx;
|
|
const env0_9 = value2.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
let createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.container = {'display': 'flex', 'flexDirection': 'row', 'borderBottomColor': null, 'borderBottomWidth': 1,
|
|
'paddingVertical': 12, borderBottomColor: BORDER_SUBTLE};
|
|
const object4 = {};
|
|
const AVATAR_SIZE_MAP = (require(1305) /* metro dependency 1305: native */).AVATAR_SIZE_MAP;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const NORMAL = AvatarSizes.NORMAL;
|
|
object4.borderRadius = AVATAR_SIZE_MAP[NORMAL] / 2;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object2.avatar = object4;
|
|
object2.avatarContainer = {'marginRight': 12, 'alignItems': 'flex-start'};
|
|
object2.textContainer = {'display': 'flex', 'flexDirection': 'column', 'flexShrink': 1};
|
|
object2.text = {'display': 'flex', 'flexDirection': 'row', 'flexShrink': 1};
|
|
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
value.memo(_fun102064).displayName = 'FamilyCenterActivityRowUser';
|
|
const value5 = createStylesModule;
|
|
createStyles = value5.createStyles;
|
|
object2 = {};
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.container = {'display': 'flex', 'alignItems': 'center', 'flexDirection': 'row', 'borderBottomColor': null,
|
|
'borderBottomWidth': 1, 'paddingVertical': 12, borderBottomColor: BORDER_SUBTLE};
|
|
const object6 = {'borderRadius': null, 'borderColor': null, 'height': 40, 'width': 40, 'margin': 0,
|
|
'backgroundColor': null, 'marginRight': 12};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object6.borderColor = BACKGROUND_BASE_LOW;
|
|
const BACKGROUND_SURFACE_HIGHEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGHEST;
|
|
object6.backgroundColor = BACKGROUND_SURFACE_HIGHEST;
|
|
object2.avatar = object6;
|
|
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
|
|
object2.avatarText = {color: TEXT_DEFAULT};
|
|
object2.text = {'display': 'flex', 'flexDirection': 'column', 'flexShrink': 1};
|
|
object2.headerContainer = {'display': 'flex', 'flexDirection': 'row'};
|
|
object2.badge = {marginRight: 4};
|
|
object2.header = {paddingRight: 16};
|
|
object2.headerAndIconContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
const env0_12 = Reflect.apply(createStyles, value5, [object2]);
|
|
value = value.memo(_fun102066);
|
|
value.displayName = 'FamilyCenterActivityRowGuild';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/parent_tools/native/FamilyCenterActivityRow.tsx');
|
|
exports.default = FamilyCenterActivityRow;
|
|
}
|
|
|
|
function _fun102064({action}) { // fn#102064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13603:696, offset: 0x0222a65a, size: 527 bytes, params: 2, frame: 27
|
|
const styles = useStyles();
|
|
const value2 = ACTION_TO_TEXT.get(action.display_type);
|
|
(importDefault(44) /* metro dependency 44 */)(value2, 'No text for action type');
|
|
const user = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
|
|
function() {
|
|
return UserStore.getUser(action.entity_id);
|
|
});
|
|
if (user == null) {
|
|
return null;
|
|
}
|
|
const defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const value3 = defaultImport2.extractTimestamp(action.event_id);
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
const items3 = [<View style={styles.avatarContainer}><Avatar avatarStyle={styles.avatar} user={user} guildId={undefined} disablePlaceholder avatarDecoration={user.avatarDecoration} /></View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
let value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = <Text style={styles.text} variant="text-md/semibold" color="interactive-text-active" ellipsizeMode="tail" lineClamp={1}>{value.getName(user)}</Text>;
|
|
const items2 = [value];
|
|
value = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
const formatUserActivityTimestamp = value.formatUserActivityTimestamp;
|
|
const Date = global.Date;
|
|
const value4 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
const date = new Date(value3);
|
|
items2[1] = <Text variant="text-xs/medium" color="channels-default">{Reflect.apply(formatUserActivityTimestamp,
|
|
value, [(date instanceof Object ? date : value4).getTime(), value2.timestampFormatter])}</Text>;
|
|
items3[1] = <View style={styles.textContainer}>{items2}</View>;
|
|
return (
|
|
<View style={styles.container}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun102066({action}) { // fn#102066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13603:2186, offset: 0x0222a88a, size: 693 bytes, params: 2, frame: 32
|
|
var r7;
|
|
var intl;
|
|
const styles = useStyles();
|
|
const guild = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([FamilyCenterStore],
|
|
function() {
|
|
return FamilyCenterStore.getGuild(action.entity_id);
|
|
});
|
|
const get = ACTION_TO_TEXT.get;
|
|
(importDefault(44) /* metro dependency 44 */)(Reflect.apply(get, ACTION_TO_TEXT, [action.display_type]),
|
|
'No text for action type');
|
|
if (guild === undefined) {
|
|
return null;
|
|
}
|
|
const features = guild.features;
|
|
const has = features.has;
|
|
const VERIFIED = GuildFeatures.VERIFIED;
|
|
const r12 = Reflect.apply(has, features, [VERIFIED]) || guild.features.has(GuildFeatures.PARTNERED);
|
|
const name = guild.name;
|
|
const GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
|
|
const NORMAL = GuildIconSizes.NORMAL;
|
|
const guildIcon = <GuildIcon style={styles.avatar} textStyle={styles.avatarText} guild={guild} size={NORMAL} animate />;
|
|
const r8 = r12 ? ((Component) => <Component style={styles.badge} guild={guild} size={(importDefault(8642) /* metro dependency 8642: GuildBadge */).Sizes.SMALL} disableColor />)(importDefault(8642) /* metro dependency 8642: GuildBadge */) : null;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const view = <View style={styles.headerContainer}><View style={styles.headerAndIconContainer}>{r8}<Text style={styles.header} variant="text-md/semibold" color="interactive-text-active" ellipsizeMode="tail" lineClamp={1}>{name}</Text></View></View>;
|
|
if (guild.approximateMemberCount === undefined) {
|
|
r7 = null;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r7 = <Text variant="text-xs/medium" color="channels-default">{intl.format((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['5JmNgg'],
|
|
|
|
{members: guild.approximateMemberCount})}</Text>;
|
|
}
|
|
return (
|
|
<View style={styles.container}>
|
|
{guildIcon}
|
|
<View style={styles.text}>
|
|
{view}
|
|
{r7}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterActivityRow({action}) { // fn#102068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13603:3268, offset: 0x0222ab60, size: 579 bytes, params: 2, frame: 24
|
|
var r0;
|
|
var moduleValue5;
|
|
var moduleValue6;
|
|
var value2;
|
|
var giftRowDisplayInfo;
|
|
var value4;
|
|
var value5;
|
|
var value;
|
|
const familyCenterUtilsModule = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
if (familyCenterUtilsModule.isUserAction(action)) {
|
|
moduleValue5 = familyCenterUtilsModule;
|
|
if (moduleValue5.isPurchase(action)) {
|
|
value4 = FamilyCenterStore.getPurchaseInfo(action.entity_id);
|
|
value5 = null;
|
|
if (value5 == value4) {
|
|
r0 = value5;
|
|
} else {
|
|
value = importDefault(13414) /* metro dependency 13414: FamilyCenterActivityPurchaseRow */;
|
|
value = ((Component) => <Component skuId={value4.sku_id} subscriptionPlanId={value4.subscription_plan_id} total={value4.total} currency={value4.currency} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
moduleValue6 = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
if (moduleValue6.isGift(action)) {
|
|
value2 = FamilyCenterStore.getGiftInfo(action.entity_id);
|
|
if (value2 == null) {
|
|
return null;
|
|
}
|
|
giftRowDisplayInfo = (require(13417) /* metro dependency 13417: FamilyCenterActivityGiftRowUtils */).getGiftRowDisplayInfo(value2);
|
|
return ((Component) => <Component skuId={giftRowDisplayInfo.skuId} subscriptionPlanId={giftRowDisplayInfo.subscriptionPlanId} price={giftRowDisplayInfo.price} gifterUserId={giftRowDisplayInfo.gifterUserId} claimed={giftRowDisplayInfo.claimed} offeredAt={giftRowDisplayInfo.offeredAt} claimedAt={giftRowDisplayInfo.claimedAt} />)(importDefault(13418) /* metro dependency 13418: FamilyCenterActivityGiftRow */);
|
|
}
|
|
return (
|
|
<View>
|
|
{(require(5187) /* metro dependency 5187: FamilyCenterUtils */).isUserAction(action) ? ((Component) => <Component action={action} />)(env0_11) : ((Component) => <Component action={action} />)(env0_13)}
|
|
</View>
|
|
);
|
|
}
|
|
const moduleValue2 = familyCenterUtilsModule;
|
|
if (moduleValue2.isGuildAction(action)) {
|
|
moduleValue5 = familyCenterUtilsModule;
|
|
if (moduleValue5.isPurchase(action)) {
|
|
value4 = FamilyCenterStore.getPurchaseInfo(action.entity_id);
|
|
value5 = null;
|
|
if (value5 == value4) {
|
|
r0 = value5;
|
|
} else {
|
|
value = importDefault(13414) /* metro dependency 13414: FamilyCenterActivityPurchaseRow */;
|
|
value = ((Component) => <Component skuId={value4.sku_id} subscriptionPlanId={value4.subscription_plan_id} total={value4.total} currency={value4.currency} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
moduleValue6 = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
if (moduleValue6.isGift(action)) {
|
|
value2 = FamilyCenterStore.getGiftInfo(action.entity_id);
|
|
if (value2 == null) {
|
|
return null;
|
|
}
|
|
giftRowDisplayInfo = (require(13417) /* metro dependency 13417: FamilyCenterActivityGiftRowUtils */).getGiftRowDisplayInfo(value2);
|
|
return ((Component) => <Component skuId={giftRowDisplayInfo.skuId} subscriptionPlanId={giftRowDisplayInfo.subscriptionPlanId} price={giftRowDisplayInfo.price} gifterUserId={giftRowDisplayInfo.gifterUserId} claimed={giftRowDisplayInfo.claimed} offeredAt={giftRowDisplayInfo.offeredAt} claimedAt={giftRowDisplayInfo.claimedAt} />)(importDefault(13418) /* metro dependency 13418: FamilyCenterActivityGiftRow */);
|
|
}
|
|
return (
|
|
<View>
|
|
{(require(5187) /* metro dependency 5187: FamilyCenterUtils */).isUserAction(action) ? ((Component) => <Component action={action} />)(env0_11) : ((Component) => <Component action={action} />)(env0_13)}
|
|
</View>
|
|
);
|
|
}
|
|
const moduleValue3 = familyCenterUtilsModule;
|
|
if (moduleValue3.isPurchase(action)) {
|
|
moduleValue5 = familyCenterUtilsModule;
|
|
if (moduleValue5.isPurchase(action)) {
|
|
value4 = FamilyCenterStore.getPurchaseInfo(action.entity_id);
|
|
value5 = null;
|
|
if (value5 == value4) {
|
|
r0 = value5;
|
|
} else {
|
|
value = importDefault(13414) /* metro dependency 13414: FamilyCenterActivityPurchaseRow */;
|
|
value = ((Component) => <Component skuId={value4.sku_id} subscriptionPlanId={value4.subscription_plan_id} total={value4.total} currency={value4.currency} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
moduleValue6 = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
if (moduleValue6.isGift(action)) {
|
|
value2 = FamilyCenterStore.getGiftInfo(action.entity_id);
|
|
if (value2 == null) {
|
|
return null;
|
|
}
|
|
giftRowDisplayInfo = (require(13417) /* metro dependency 13417: FamilyCenterActivityGiftRowUtils */).getGiftRowDisplayInfo(value2);
|
|
return ((Component) => <Component skuId={giftRowDisplayInfo.skuId} subscriptionPlanId={giftRowDisplayInfo.subscriptionPlanId} price={giftRowDisplayInfo.price} gifterUserId={giftRowDisplayInfo.gifterUserId} claimed={giftRowDisplayInfo.claimed} offeredAt={giftRowDisplayInfo.offeredAt} claimedAt={giftRowDisplayInfo.claimedAt} />)(importDefault(13418) /* metro dependency 13418: FamilyCenterActivityGiftRow */);
|
|
}
|
|
return (
|
|
<View>
|
|
{(require(5187) /* metro dependency 5187: FamilyCenterUtils */).isUserAction(action) ? ((Component) => <Component action={action} />)(env0_11) : ((Component) => <Component action={action} />)(env0_13)}
|
|
</View>
|
|
);
|
|
}
|
|
const moduleValue4 = familyCenterUtilsModule;
|
|
if (moduleValue4.isGift(action)) {
|
|
moduleValue5 = familyCenterUtilsModule;
|
|
if (moduleValue5.isPurchase(action)) {
|
|
value4 = FamilyCenterStore.getPurchaseInfo(action.entity_id);
|
|
value5 = null;
|
|
if (value5 == value4) {
|
|
r0 = value5;
|
|
} else {
|
|
value = importDefault(13414) /* metro dependency 13414: FamilyCenterActivityPurchaseRow */;
|
|
value = ((Component) => <Component skuId={value4.sku_id} subscriptionPlanId={value4.subscription_plan_id} total={value4.total} currency={value4.currency} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
moduleValue6 = require(5187) /* metro dependency 5187: FamilyCenterUtils */;
|
|
if (moduleValue6.isGift(action)) {
|
|
value2 = FamilyCenterStore.getGiftInfo(action.entity_id);
|
|
if (value2 == null) {
|
|
return null;
|
|
}
|
|
giftRowDisplayInfo = (require(13417) /* metro dependency 13417: FamilyCenterActivityGiftRowUtils */).getGiftRowDisplayInfo(value2);
|
|
return ((Component) => <Component skuId={giftRowDisplayInfo.skuId} subscriptionPlanId={giftRowDisplayInfo.subscriptionPlanId} price={giftRowDisplayInfo.price} gifterUserId={giftRowDisplayInfo.gifterUserId} claimed={giftRowDisplayInfo.claimed} offeredAt={giftRowDisplayInfo.offeredAt} claimedAt={giftRowDisplayInfo.claimedAt} />)(importDefault(13418) /* metro dependency 13418: FamilyCenterActivityGiftRow */);
|
|
}
|
|
return (
|
|
<View>
|
|
{(require(5187) /* metro dependency 5187: FamilyCenterUtils */).isUserAction(action) ? ((Component) => <Component action={action} />)(env0_11) : ((Component) => <Component action={action} />)(env0_13)}
|
|
</View>
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|