202 lines
11 KiB
TypeScript
202 lines
11 KiB
TypeScript
/* Metro module 13416; source: modules/parent_tools/native/FamilyCenterActivityItemPreview.tsx; dependencies: [31, 27, 33, 4501, 13415, 697, 8484, 8498, 10031, 10358, 7958, 7954, 1904, 1901, 2] */
|
|
import UseMaybeFetchProfileFrame from '../../collectibles/profile_frames/useMaybeFetchProfileFrame.tsx'; /* Metro dependency 8498 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as NameplateUtilsModule from '../../collectibles/nameplates/native/NameplateUtils.tsx'; /* Metro dependency 8484 */
|
|
import * as ShopIconModule from '../../../design/components/Icon/native/redesign/generated/ShopIcon.tsx'; /* Metro dependency 10358 */
|
|
import * as FamilyCenterActivityPurchaseRowUtilsModule from '../FamilyCenterActivityPurchaseRowUtils.tsx'; /* Metro dependency 13415 */
|
|
|
|
function _fun102077(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:6, offset: 0x0222b4cb, size: 665 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
const env0_3 = value.View;
|
|
const env0_4 = value.Image;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {};
|
|
const PREVIEW_SIZE = (FamilyCenterActivityPurchaseRowUtilsModule).PREVIEW_SIZE;
|
|
object2.width = PREVIEW_SIZE;
|
|
object2.height = PREVIEW_SIZE;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object2.display = 'flex';
|
|
object2.alignItems = 'center';
|
|
object2.justifyContent = 'center';
|
|
object2.marginRight = 12;
|
|
object.purchasePlaceholder = object2;
|
|
object.avatarDecorationPreview = {width: PREVIEW_SIZE, height: PREVIEW_SIZE, marginRight: 12};
|
|
const object4 = {'width': null, 'height': null, 'marginRight': 12, 'borderRadius': null, 'overflow': 'hidden',
|
|
'position': 'relative'};
|
|
object4.width = PREVIEW_SIZE;
|
|
object4.height = PREVIEW_SIZE;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.nameplateContainer = object4;
|
|
const NAMEPLATE_ASPECT_RATIO = (FamilyCenterActivityPurchaseRowUtilsModule).NAMEPLATE_ASPECT_RATIO;
|
|
object.nameplatePreview = {'position': 'absolute', 'right': 0, width: PREVIEW_SIZE * NAMEPLATE_ASPECT_RATIO,
|
|
height: PREVIEW_SIZE};
|
|
object.profileFrameContainer = {'width': null, 'height': null, 'marginRight': 12, 'alignItems': 'center',
|
|
'justifyContent': 'center', width: PREVIEW_SIZE, height: PREVIEW_SIZE};
|
|
const env0_6 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/FamilyCenterActivityItemPreview.tsx');
|
|
exports.default = FamilyCenterActivityItemPreview;
|
|
function AvatarDecorationPreviewImage({product, styles}) { // fn#102078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:964, offset: 0x0222b764, size: 105 bytes, params: 2, frame: 17
|
|
const avatarDecorationPreviewUrl = (FamilyCenterActivityPurchaseRowUtilsModule).getAvatarDecorationPreviewUrl(product);
|
|
return (
|
|
avatarDecorationPreviewUrl == null
|
|
? null
|
|
: (
|
|
<Image
|
|
source={{uri: avatarDecorationPreviewUrl}}
|
|
style={styles.avatarDecorationPreview}
|
|
fadeDuration={0}
|
|
/>
|
|
)
|
|
);
|
|
}
|
|
|
|
function NameplatePreviewImage({nameplateData, styles}) { // fn#102079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:1148, offset: 0x0222b7cd, size: 145 bytes, params: 2, frame: 19
|
|
const getNameplateAssets = NameplateUtilsModule.getNameplateAssets;
|
|
const staticImageUrl = Reflect.apply(getNameplateAssets, NameplateUtilsModule, [nameplateData]).staticImageUrl;
|
|
return (
|
|
staticImageUrl == null
|
|
? null
|
|
: (
|
|
<View style={styles.nameplateContainer}>
|
|
<Image
|
|
source={{uri: staticImageUrl}}
|
|
style={styles.nameplatePreview}
|
|
resizeMode="cover"
|
|
fadeDuration={0}
|
|
/>
|
|
</View>
|
|
)
|
|
);
|
|
}
|
|
|
|
function ProfileEffectPreviewImage({product, styles}) { // fn#102080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:1401, offset: 0x0222b85e, size: 105 bytes, params: 2, frame: 17
|
|
const profileEffectPreviewUrl = (FamilyCenterActivityPurchaseRowUtilsModule).getProfileEffectPreviewUrl(product);
|
|
return (
|
|
profileEffectPreviewUrl == null
|
|
? null
|
|
: (
|
|
<Image
|
|
source={{uri: profileEffectPreviewUrl}}
|
|
style={styles.avatarDecorationPreview}
|
|
fadeDuration={0}
|
|
/>
|
|
)
|
|
);
|
|
}
|
|
|
|
function ProfileFramePreviewImage({product, styles}) { // fn#102081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:1585, offset: 0x0222b8c7, size: 228 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var ProfileFrameSamplePreview;
|
|
var object;
|
|
const PREVIEW_SIZE = (require(13415) /* metro dependency 13415: FamilyCenterActivityPurchaseRowUtils */).PREVIEW_SIZE;
|
|
const value2 = (UseMaybeFetchProfileFrame)(product.skuId,
|
|
'FamilyCenterActivityItemPreview');
|
|
if (value2 == null) {
|
|
r0 = null;
|
|
} else {
|
|
var viewBindingProps = {style: styles.profileFrameContainer};
|
|
ProfileFrameSamplePreview = importDefault(10031) /* metro dependency 10031: ProfileFrameSamplePreview */;
|
|
r0 = (
|
|
<View {...viewBindingProps}>
|
|
<ProfileFrameSamplePreview
|
|
profileFrame={value2}
|
|
previewWidth={PREVIEW_SIZE * (require(13415) /* metro dependency 13415: FamilyCenterActivityPurchaseRowUtils */).PROFILE_FRAME_ASPECT_RATIO}
|
|
previewHeight={PREVIEW_SIZE}
|
|
profileBackgroundColor={(importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function SubscriptionPreview({subscriptionPlanId, styles}) { // fn#102082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:1944, offset: 0x0222b9ab, size: 264 bytes, params: 2, frame: 18
|
|
if (subscriptionPlanId == null) {
|
|
return (
|
|
<View style={styles.purchasePlaceholder}>
|
|
{((ShopIcon) => <ShopIcon size="custom" style={{'width': 20,
|
|
'height': 20}} />)((require(10358) /* metro dependency 10358: ShopIcon */).ShopIcon)}
|
|
</View>
|
|
);
|
|
}
|
|
return (
|
|
<View style={styles.purchasePlaceholder}>
|
|
{((Component) => <Component size="custom" style={{'width': 20,
|
|
'height': 20}} />)((require(13415) /* metro dependency 13415: FamilyCenterActivityPurchaseRowUtils */).isGuildBoostSubscription(subscriptionPlanId) ? (require(7958) /* metro dependency 7958: BoostGemIcon */).BoostGemIcon : (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function CollectiblePreview({product, styles}) { // fn#102083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:2312, offset: 0x0222bab3, size: 511 bytes, params: 2, frame: 20
|
|
const ShopIcon = (ShopIconModule).ShopIcon;
|
|
var nameplateDataFromProductRecord;
|
|
let value = null;
|
|
if (value == product) {
|
|
value = environment;
|
|
} else {
|
|
var type = product.type;
|
|
var CollectiblesItemType = (require(1904) /* metro dependency 1904: CollectiblesItemType */).CollectiblesItemType;
|
|
var AVATAR_DECORATION = CollectiblesItemType.AVATAR_DECORATION;
|
|
if (AVATAR_DECORATION === type) {
|
|
return <AvatarDecorationPreviewImage product={product} styles={styles} />;
|
|
}
|
|
var NAMEPLATE = CollectiblesItemType.NAMEPLATE;
|
|
if (NAMEPLATE === type) {
|
|
nameplateDataFromProductRecord = (require(1901) /* metro dependency 1901: utils */).getNameplateDataFromProductRecord(product);
|
|
return (
|
|
value != nameplateDataFromProductRecord
|
|
? (
|
|
<NameplatePreviewImage nameplateData={nameplateDataFromProductRecord} styles={styles} />
|
|
)
|
|
: value
|
|
);
|
|
}
|
|
var PROFILE_EFFECT = CollectiblesItemType.PROFILE_EFFECT;
|
|
if (PROFILE_EFFECT === type) {
|
|
return <ProfileEffectPreviewImage product={product} styles={styles} />;
|
|
}
|
|
var PROFILE_FRAME = CollectiblesItemType.PROFILE_FRAME;
|
|
if (PROFILE_FRAME === type) {
|
|
return <ProfileFramePreviewImage product={product} styles={styles} />;
|
|
}
|
|
}
|
|
return (
|
|
<View style={styles.purchasePlaceholder}>
|
|
<ShopIcon size="custom" style={{'width': 20, 'height': 20}} />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterActivityItemPreview({displayName, product, isSubscription, subscriptionPlanId}) { // fn#102084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13606:3203, offset: 0x0222bcb2, size: 124 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
return (
|
|
<View accessible accessibilityLabel={displayName}>
|
|
{
|
|
isSubscription
|
|
? (
|
|
<SubscriptionPreview subscriptionPlanId={subscriptionPlanId} styles={styles} />
|
|
)
|
|
: (
|
|
<CollectiblePreview product={product} styles={styles} />
|
|
)
|
|
}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102077, 13416, [31, 27, 33, 4501, 13415, 697, 8484, 8498, 10031, 10358, 7958, 7954, 1904, 1901,
|
|
2]) /* metro module 13416, dependencies: [31, 27, 33, 4501, 13415, 697, 8484, 8498, 10031, 10358, 7958, 7954, 1904, 1901, 2] */;
|