126 lines
8.3 KiB
TypeScript
126 lines
8.3 KiB
TypeScript
/* Metro module 14600; source: modules/premium/powerups/native/GuildPowerupsModal.tsx; dependencies: [31, 27, 8259, 33, 4501, 697, 6857, 14601, 14607, 1585, 6771, 14619, 5080, 8254, 5287, 1244, 2256, 9603, 5282, 14620, 14622, 14629, 14661, 14673, 14680, 2] */
|
|
function _fun110380(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14797:6, offset: 0x023775a5, size: 519 bytes, params: 8, frame: 22
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.ScrollView;
|
|
const env0_5 = value.View;
|
|
value = require(8259) /* metro dependency 8259: GuildPowerupsConstants */;
|
|
const env0_6 = value.BoostInfoType;
|
|
const env0_7 = value.GuildPowerupType;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object5 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.paddingHorizontal = PX_16;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.paddingTop = PX_8;
|
|
object2.headerContainer = object5;
|
|
const object6 = {'flexDirection': 'row', 'justifyContent': 'space-between', 'borderWidth': 1,
|
|
'borderStyle': 'solid'};
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.borderColor = BORDER_SUBTLE;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.marginBottom = PX_16;
|
|
object2.boostInfoContainer = object6;
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.boostInfoSeparator = {'width': 1, 'height': '100%', backgroundColor: BORDER_SUBTLE};
|
|
const PX_96 = (importDefault(697) /* metro dependency 697: native */).space.PX_96;
|
|
object2.scrollView = {paddingBottom: PX_96};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.boostButtonContainer = {'paddingHorizontal': null, 'position': 'absolute', 'bottom': 0, 'left': 0,
|
|
'right': 0, paddingHorizontal: PX_16};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/native/GuildPowerupsModal.tsx');
|
|
exports.default = GuildPowerupsModal;
|
|
}
|
|
|
|
function GuildPowerupsModal({guildId, analyticsLocation}) { // fn#110381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14797:917, offset: 0x023777ac, size: 895 bytes, params: 2, frame: 36
|
|
const value2 = (require(6857) /* metro dependency 6857: GameServerExperiment */).useGameServerEnabled(guildId,
|
|
'GuildPowerupsModal');
|
|
(importDefault(14601) /* metro dependency 14601: useLoadGuildPowerups */)(guildId);
|
|
(require(14607) /* metro dependency 14607: useGuildPowerupsNotifications */).useAutoDismissGuildPowerupsNotifications(guildId);
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const styles = useStyles();
|
|
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const r6 = analyticsLocation != null ? [analyticsLocation] : [];
|
|
const items5 = [];
|
|
arraySpread(items5, r6, 0, undefined);
|
|
const analyticsLocations = apply(defaultImport, items5, undefined, undefined).analyticsLocations;
|
|
const value3 = (require(14619) /* metro dependency 14619: powerupListing */).useBuildGuildPowerupsSections(guildId,
|
|
value2);
|
|
const value4 = env0_3.useCallback(_fun110382, []);
|
|
const {available, spent,
|
|
total} = (importDefault(8254) /* metro dependency 8254: useGuildPowerupsBoostCount */)(guildId);
|
|
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
|
|
const Header = (require(5287) /* metro dependency 5287 */).Header;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const items6 = [<View style={styles.headerContainer}><Header title={intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).hjvcLO)} headerTitle={headerTitle_110383} headerTitleAlign="center" headerLeft={(require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(value4)} /></View>];
|
|
const GuildPowerupsBoostInfo = importDefault(14620) /* metro dependency 14620: GuildPowerupsBoostInfo */;
|
|
const AVAILABLE = BoostInfoType.AVAILABLE;
|
|
const items2 = [<GuildPowerupsBoostInfo count={available} type={AVAILABLE} />];
|
|
items2[1] = <View style={styles.boostInfoSeparator} />;
|
|
let value = GuildPowerupsBoostInfo;
|
|
const SPENT = BoostInfoType.SPENT;
|
|
items2[2] = ((Component) => <Component count={spent} type={SPENT} />)(value);
|
|
items2[3] = <View style={styles.boostInfoSeparator} />;
|
|
value = GuildPowerupsBoostInfo;
|
|
const TOTAL = BoostInfoType.TOTAL;
|
|
items2[4] = ((Component) => <Component count={total} type={TOTAL} />)(value);
|
|
const items3 = [<View style={styles.boostInfoContainer}>{items2}</View>];
|
|
items3[1] = ((Component) => <Component guildId={guildId} />)(importDefault(14622) /* metro dependency 14622: GuildPowerupsNotificationContainer */);
|
|
items3[2] = value3.map(_fun110384);
|
|
items3[3] = ((Component) => <Component guildId={guildId} />)(importDefault(14673) /* metro dependency 14673: GuildPowerupsRecentActivitySection */);
|
|
items6[1] = <ScrollView contentContainerStyle={styles.scrollView}>{items3}</ScrollView>;
|
|
const items4 = [styles.boostButtonContainer];
|
|
items4[1] = {paddingBottom: bottom};
|
|
const GuildPowerupsBoostButton = (require(14680) /* metro dependency 14680: GuildPowerupsBoostButton */).GuildPowerupsBoostButton;
|
|
items6[2] = <View style={items4}><GuildPowerupsBoostButton guildId={guildId} /></View>;
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<View style={styles.container}>
|
|
{items6}
|
|
</View>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
}
|
|
|
|
function _fun110382() { // fn#110382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14797:1241, offset: 0x02377b2b, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
|
|
function GuildPowerupsModalHeaderTitle() { // fn#110383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14797:1523, owner: GuildPowerupsModal.headerTitle, offset: 0x02377b50, size: 98 bytes, params: 1, frame: 18
|
|
const GenericHeaderTitle = (require(9603) /* metro dependency 9603: HeaderShared */).GenericHeaderTitle;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<GenericHeaderTitle
|
|
title={intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).hjvcLO)}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun110384(a0) { // fn#110384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14797:1981, offset: 0x02377bb2, size: 171 bytes, params: 2, frame: 17
|
|
const type = a0.type;
|
|
const value = environment.__proto__;
|
|
const LEVEL = GuildPowerupType.LEVEL;
|
|
if (LEVEL === type) {
|
|
return ((Component) => <Component guildId={guildId} listings={a0.listings} key={a0.type} />)(importDefault(14629) /* metro dependency 14629: GuildPowerupsLevelsSection */);
|
|
}
|
|
const PERK = GuildPowerupType.PERK;
|
|
if (PERK === type) {
|
|
return ((Component) => <Component guildId={guildId} listings={a0.listings} key={a0.type} />)(importDefault(14661) /* metro dependency 14661: GuildPowerupsPerksSection */);
|
|
}
|
|
return null;
|
|
}
|
|
|