241 lines
14 KiB
TypeScript
241 lines
14 KiB
TypeScript
/* Metro module 14070; source: modules/collectibles/native/FeedBlock.tsx; dependencies: [31, 27, 4502, 1310, 5078, 663, 661, 33, 4501, 697, 566, 4002, 14058, 14071, 14049, 5120, 6789, 6771, 1244, 4573, 5278, 4080, 14072, 1962, 4068, 4578, 14062, 14073, 477, 7601, 14074, 5475, 14075, 14076, 2] */
|
|
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import ConsentStore from '../../../stores/ConsentStore.tsx'; /* Metro dependency 5078 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as CollectiblesShopConstantsModule from '../CollectiblesShopConstants.tsx'; /* Metro dependency 663 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import * as UseFilteredAndSortedProductsModule from './hooks/useFilteredAndSortedProducts.tsx'; /* Metro dependency 14049 */
|
|
import * as ShopHomeSortTypeModule from '../../../external/discord_common/js/shared/shared-constants/ShopHomeSortType.tsx'; /* Metro dependency 14071 */
|
|
|
|
function _fun106662(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#106662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14267:6, offset: 0x022e53d2, size: 537 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.Image;
|
|
const env0_5 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.feedContainer = {'display': 'flex', 'flexDirection': 'column', 'height': '100%', gap: PX_16};
|
|
const object3 = {'display': 'flex', 'flexDirection': 'row', 'flexWrap': 'wrap', 'justifyContent': 'space-between',
|
|
'alignItems': 'center'};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.gap = PX_12;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.paddingHorizontal = PX_16;
|
|
object.feedHeader = object3;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.feedTitle = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'flexShrink': 1, gap: PX_8};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.feedFooter = {'display': 'flex', 'gap': null, 'flexDirection': 'column', 'justifyContent': 'center',
|
|
'alignItems': 'center', gap: PX_16};
|
|
object.feedFooterImage = {'width': '100%', 'resizeMode': 'cover'};
|
|
object.feedFooterOrbImage = {'width': '100%', 'alignSelf': 'center', 'resizeMode': 'contain', 'height': 130};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/native/FeedBlock.tsx');
|
|
exports.default = _default_106663;
|
|
function _default_106663({feedBlock, screen, preferVCPrice, disableBundleStaticBackground}) { // fn#106663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14267:911, offset: 0x022e55eb, size: 1576 bytes, params: 2, frame: 41
|
|
var r18;
|
|
var r9;
|
|
var r13;
|
|
var r12;
|
|
var PressableOpacity;
|
|
var object5;
|
|
const Button = (ButtonNativeModule).Button;
|
|
var object2;
|
|
var object6;
|
|
var object7;
|
|
var value;
|
|
const styles = useStyles();
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ThemeStore], function() {
|
|
return require(dependencyMap[11]).isThemeDark(ThemeStore.theme);
|
|
});
|
|
const {feedProducts, isPersonalized} = ReactModule.useMemo(_fun106666, [feedBlock.sortedSkuIds,
|
|
(importDefault(14058) /* metro dependency 14058: useGetProductsFromSkus */)(),
|
|
(require(566) /* metro dependency 566: flux */).useStateFromStores([ConsentStore], function() {
|
|
return ConsentStore.hasConsented(Consents.PERSONALIZATION);
|
|
})]);
|
|
const value6 = (UseFilteredAndSortedProductsModule).useFilteredAndSortedProducts({products: feedProducts,
|
|
maxProducts: 36, screen: screen});
|
|
const closure = function() {
|
|
var moduleValue = require(dependencyMap[15]);
|
|
var object = {};
|
|
var COLLECTIBLES_MOBILE_SHOP_ALL_BUTTON = importDefault(dependencyMap[16]).COLLECTIBLES_MOBILE_SHOP_ALL_BUTTON;
|
|
object.analyticsLocations = [COLLECTIBLES_MOBILE_SHOP_ALL_BUTTON];
|
|
object.analyticsSource = importDefault(dependencyMap[16]).COLLECTIBLES_MOBILE_SHOP_ALL_BUTTON;
|
|
object.screen = CollectiblesMobileShopScreen.SHOP_ALL;
|
|
moduleValue.openCollectiblesShopMobile(object);
|
|
};
|
|
const ORBS = CollectiblesMobileShopScreen.ORBS;
|
|
const value7 = screen === ORBS;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const defaultImport = UseAnalyticsLocations;
|
|
const COLLECTIBLES_SHOP_POPULAR_PICKS = (AnalyticsLocation).COLLECTIBLES_SHOP_POPULAR_PICKS;
|
|
const analyticsLocations = defaultImport(COLLECTIBLES_SHOP_POPULAR_PICKS).analyticsLocations;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r15 = isPersonalized ? Reflect.apply(string, intl, [t.NSv5KV]) : Reflect.apply(string, intl, [t.ivaAA7]);
|
|
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
|
|
const Heading = (TextModule).Heading;
|
|
const heading = (
|
|
<Heading variant="heading-lg/semibold">
|
|
{r15}
|
|
</Heading>
|
|
);
|
|
if (isPersonalized) {
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
object5 = {onPress: onPress_106669, hitSlop: 14};
|
|
object5['aria-label'] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hvVgAZ);
|
|
r18 = (
|
|
<PressableOpacity {...object5}>
|
|
{((CircleInformationIcon) => <CircleInformationIcon size="xs" />)((require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon)}
|
|
</PressableOpacity>
|
|
);
|
|
} else {
|
|
r18 = isPersonalized;
|
|
}
|
|
const view = (
|
|
<View style={styles.feedTitle}>
|
|
{heading}
|
|
{r18}
|
|
</View>
|
|
);
|
|
if (value7) {
|
|
r9 = !value7;
|
|
} else {
|
|
r9 = (
|
|
<Button
|
|
onPress={closure}
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xFcotU)}
|
|
variant="primary"
|
|
size="sm"
|
|
/>
|
|
);
|
|
}
|
|
const items3 = [
|
|
<View style={styles.feedHeader}>
|
|
{view}
|
|
{r9}
|
|
</View>,
|
|
];
|
|
items3[1] = ((Component) => <Component products={value6} loadingCardsNum={36} preferVCPrice={preferVCPrice} accessibilityLabel={r15} disableBundleStaticBackground={disableBundleStaticBackground} />)(importDefault(14062) /* metro dependency 14062: FeedProductList */);
|
|
const Text = (TextModule).Text;
|
|
string = intl.string;
|
|
const Yr70c4 = (require(1244) /* metro dependency 1244: indexNative */).t.Yr70c4;
|
|
const items4 = [
|
|
<Text variant="heading-lg/bold" accessibilityRole="header">
|
|
{Reflect.apply(string, intl, [Yr70c4])}
|
|
</Text>,
|
|
];
|
|
string = intl.string;
|
|
const AfrvRD = (require(1244) /* metro dependency 1244: indexNative */).t.AfrvRD;
|
|
items4[1] = (
|
|
<Button
|
|
onPress={closure}
|
|
text={Reflect.apply(string, intl, [AfrvRD])}
|
|
variant="primary"
|
|
size="md"
|
|
/>
|
|
);
|
|
if (value7) {
|
|
if (useReducedMotion) {
|
|
object7 = {};
|
|
object7.uri = importDefault(14073) /* metro dependency 14073: orb_coachmark_asset_2xPng */;
|
|
r13 = (
|
|
<Image
|
|
source={object7}
|
|
style={styles.feedFooterOrbImage}
|
|
accessibilityElementsHidden
|
|
importantForAccessibility="no-hide-descendants"
|
|
/>
|
|
);
|
|
} else if ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid()) {
|
|
value = importDefault(7601) /* metro dependency 7601: APNGDecorationNativeComponent */;
|
|
value = ((Component) => <Component url={importDefault(14074) /* metro dependency 14074: orb_coachmark_asset_2x_animatedPng */} autoplay style={styles.feedFooterOrbImage} accessibilityElementsHidden importantForAccessibility="no-hide-descendants" />)(value);
|
|
r13 = value;
|
|
} else {
|
|
value = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = ((Component) => <Component source={{uri: importDefault(14074) /* metro dependency 14074: orb_coachmark_asset_2x_animatedPng */}} enableAnimation resizeMode="contain" style={styles.feedFooterOrbImage} accessibilityElementsHidden importantForAccessibility="no-hide-descendants" />)(value);
|
|
r13 = value;
|
|
}
|
|
r12 = r13;
|
|
} else {
|
|
object6 = {};
|
|
if (value2) {
|
|
object6.source = require(14075) /* metro dependency 14075 */;
|
|
object6.style = styles.feedFooterImage;
|
|
object6.accessibilityElementsHidden = true;
|
|
object6.importantForAccessibility = 'no-hide-descendants';
|
|
} else {
|
|
object6.source = require(14076) /* metro dependency 14076 */;
|
|
object6.style = styles.feedFooterImage;
|
|
object6.accessibilityElementsHidden = true;
|
|
object6.importantForAccessibility = 'no-hide-descendants';
|
|
}
|
|
r12 = <Image {...object6} />;
|
|
}
|
|
items4[2] = r12;
|
|
items3[2] = (
|
|
<View style={styles.feedFooter}>
|
|
{items4}
|
|
</View>
|
|
);
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<View style={styles.feedContainer}>
|
|
{items3}
|
|
</View>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
function _fun106666() { // fn#106666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14267:1168, offset: 0x022e5c61, size: 186 bytes, params: 1, frame: 17
|
|
const ShopHomeSortType = (ShopHomeSortTypeModule).ShopHomeSortType;
|
|
let sortedSkuIds = feedBlock.sortedSkuIds;
|
|
const value2 = undefined;
|
|
let r5 = sortedSkuIds == null ? value2 : sortedSkuIds[ShopHomeSortType.RECOMMENDED];
|
|
r5 = r5 ?? [];
|
|
sortedSkuIds = feedBlock.sortedSkuIds;
|
|
let r3 = sortedSkuIds == null ? value2 : sortedSkuIds[ShopHomeSortType.POPULAR];
|
|
r3 = r3 ?? [];
|
|
const r1 = env0_1 && r5.length > 0;
|
|
const object = {};
|
|
r3 = r1 ? r5 : r3;
|
|
object.feedProducts = env0_2(r3);
|
|
object.isPersonalized = r1;
|
|
return object;
|
|
}
|
|
|
|
function _default_106663OnPress_106669() { // fn#106669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14267:2262, owner: _default_106663.onPress, offset: 0x022e5d89, size: 82 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[21]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[23]);
|
|
value = value(dependencyMap[22], dependencyMap.paths);
|
|
return Reflect.apply(openLazy, defaultImport, [value, 'PersonalizationDisclaimerActionSheet', {}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun106662, 14070, [31, 27, 4502, 1310, 5078, 663, 661, 33, 4501, 697, 566, 4002, 14058, 14071, 14049,
|
|
5120, 6789, 6771, 1244, 4573, 5278, 4080, 14072, 1962, 4068, 4578, 14062, 14073, 477, 7601, 14074, 5475, 14075,
|
|
14076,
|
|
2]) /* metro module 14070, dependencies: [31, 27, 4502, 1310, 5078, 663, 661, 33, 4501, 697, 566, 4002, 14058, 14071, 14049, 5120, 6789, 6771, 1244, 4573, 5278, 4080, 14072, 1962, 4068, 4578, 14062, 14073, 477, 7601, 14074, 5475, 14075, 14076, 2] */;
|