Files
discord-decomp/sources/modules/premium/native/gifting/PremiumGiftPlanSelectPromotionalBanner.tsx
T
2026-07-28 01:06:53 +03:00

102 lines
6.7 KiB
TypeScript

/* Metro module 10393; source: modules/premium/native/gifting/PremiumGiftPlanSelectPromotionalBanner.tsx; dependencies: [31, 27, 33, 4501, 697, 7277, 10390, 4589, 5475, 4573, 1244, 10394, 2] */
import LinearGradient from '../../../../by-id/module-04589-LinearGradient.js'; /* Metro dependency 4589 */
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 CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as Gift_plan_selection_card_bannerModule from '../../../../external/discord_common/js/packages/protos/discord_protos/premium_marketing/v1/gift_plan_selection_card_banner.tsx'; /* Metro dependency 7277 */
import * as MarketingComponentHooksModule from '../../promotions/MarketingComponentHooks.tsx'; /* Metro dependency 10390 */
function _fun80489(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:6, offset: 0x01e7d9f1, size: 211 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const env0_6 = (CreateStylesModule).createStyles(_fun80490);
value = value.memo(PremiumGiftPlanSelectPromotionalBanner);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPlanSelectPromotionalBanner.tsx');
exports.default = value;
function _fun80490() { // fn#80490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:172, offset: 0x01e7dac4, size: 272 bytes, params: 1, frame: 15
const object2 = {'minHeight': 60, 'justifyContent': 'center', 'gap': 2};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.paddingTop = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.paddingBottom = PX_12;
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.paddingStart = PX_24;
object2.paddingEnd = 120;
return {gradient: {minHeight: 60}, bannerImage: {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0,
'width': '100%', 'aspectRatio': 5}, content: object2, heading: {}, subheading: {},
logoContainer: {'position': 'absolute', 'top': 0, 'bottom': 0, 'right': 10, 'justifyContent': 'center',
'alignItems': 'center'}, logoContainerLargeTilted: {transform: [{rotate: '-7deg'}, {translateY: 8}]},
logo: {'width': 95, 'height': 95}, logoLargeTilted: {'width': 120, 'height': 120}};
}
function PremiumGiftPlanSelectPromotionalBanner({giftPlanSelectionCardBannerComponent, claimableRewards, isSelected, onLayout}) { // fn#80491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10579:733, offset: 0x01e7dbd4, size: 763 bytes, params: 2, frame: 34
var r5;
var object;
var value;
const styles = useStyles();
const gradient = giftPlanSelectionCardBannerComponent.gradient;
const assetVariant = giftPlanSelectionCardBannerComponent.assetVariant;
const GiftPlanSelectionCardBanner_AssetVariant = (Gift_plan_selection_card_bannerModule).GiftPlanSelectionCardBanner_AssetVariant;
const LARGE_TILTED = GiftPlanSelectionCardBanner_AssetVariant.LARGE_TILTED;
const value3 = assetVariant === LARGE_TILTED;
const value4 = (MarketingComponentHooksModule).useThemeAndReducedMotionAwareAssetUrl(giftPlanSelectionCardBannerComponent.mobileBannerAsset);
const value5 = (MarketingComponentHooksModule).useThemeAndReducedMotionAwareAssetUrl(giftPlanSelectionCardBannerComponent.avatarAsset,
true);
const defaultImport = LinearGradient;
const defaultImportProps2 = {style: styles.gradient, useAngle: true, angle: gradient?.angle ?? 90,
angleCenter: {'x': 0.5, 'y': 0.5}, colors: gradient?.colors ?? [], onLayout: onLayout};
const items2 = [
value4 != null && ((Component) => <Component style={styles.bannerImage} resizeMode="cover" source={{uri: value4}} />)(importDefault(5475) /* metro dependency 5475: FastImage */),
];
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const OEtqpm = (require(1244) /* metro dependency 1244: indexNative */).t.OEtqpm;
items2[1] = (
<View style={styles.content}>
<Text
style={styles.heading}
variant="text-md/bold"
color="white"
>
{Reflect.apply(string, intl, [OEtqpm])}
</Text>
<Text
style={styles.subheading}
variant="text-md/medium"
color="white"
>
{intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['2h5M+X'],
{availableCount: claimableRewards.length})}
</Text>
</View>
);
const value10 = value5 != null;
if (value10) {
var viewProps = {style: [styles.logoContainer, value3 && styles.logoContainerLargeTilted]};
value = importDefault(10394) /* metro dependency 10394: PremiumFeaturesPromotionalLogo */;
value = (
<View {...viewProps}>
{((Component) => <Component shouldAnimate={isSelected} promoRotatingStyle={[styles.logo,
value3 && styles.logoLargeTilted]} rotatingAvatarImageUrl={value5} />)(value)}
</View>
);
r5 = value;
} else {
r5 = value10;
}
items2[2] = r5;
return ((Component) => <Component {...defaultImportProps2}>{items2}</Component>)(defaultImport);
}
}
global.__d(_fun80489, 10393, [31, 27, 33, 4501, 697, 7277, 10390, 4589, 5475, 4573, 1244, 10394,
2]) /* metro module 10393, dependencies: [31, 27, 33, 4501, 697, 7277, 10390, 4589, 5475, 4573, 1244, 10394, 2] */;