124 lines
7.2 KiB
TypeScript
124 lines
7.2 KiB
TypeScript
/* Metro module 10467; source: modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx; dependencies: [31, 27, 5126, 1902, 1878, 33, 4501, 697, 566, 7669, 1484, 7633, 8461, 10382, 7589, 8483, 1901, 1305, 10462, 4578, 1244, 2] */
|
|
function _fun80998(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:6, offset: 0x01e943ac, size: 413 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 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const env0_5 = (require(5126) /* metro dependency 5126: AvatarDecorationRecord */).isAvatarDecorationRecord;
|
|
const env0_6 = (require(1902) /* metro dependency 1902: NameplateRecord */).isNameplateRecord;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let 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 PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.container = {'flexDirection': 'column', 'alignItems': 'center', gap: PX_16};
|
|
const object5 = {'width': 234, 'height': 40, 'flexDirection': 'row', 'alignItems': 'center', 'position': 'relative',
|
|
'borderRadius': null, 'overflow': 'hidden'};
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object2.nameplateContainer = object5;
|
|
const object6 = {'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'borderRadius': null,
|
|
'overflow': 'hidden'};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object2.nameplateWrapper = object6;
|
|
object2.singleAvatarContainer = {'flexDirection': 'row', 'paddingRight': 15, 'justifyContent': 'center',
|
|
'alignItems': 'center', 'marginLeft': 5};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftingPromotionSuccessActions.tsx');
|
|
exports.default = PremiumGiftingPromotionSuccessActions;
|
|
}
|
|
|
|
function PremiumGiftingPromotionSuccessActions({purchase}) { // fn#80999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:826, offset: 0x01e94549, size: 820 bytes, params: 2, frame: 31
|
|
var r6;
|
|
var items2;
|
|
var Avatar;
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const {onClose,
|
|
prePurchaseGiftingBadgeProgress} = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
|
|
const value4 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
|
|
const useConfig = GiftingBadgeExperiment.useConfig;
|
|
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment,
|
|
[{location: 'PremiumGiftingPromotionSuccessActions'}]).enabled;
|
|
const env0_3 = enabled;
|
|
const {product,
|
|
isFetching} = (require(8461) /* metro dependency 8461: useFetchCollectiblesProduct */).useFetchCollectiblesProduct(purchase.skuId);
|
|
const binding = env0_3;
|
|
const value7 = binding.useCallback(_fun81002, [product, onClose, binding.useCallback(_fun81001, [enabled,
|
|
prePurchaseGiftingBadgeProgress, value4]), enabled, prePurchaseGiftingBadgeProgress, value4]);
|
|
const property = purchase.items[0];
|
|
if (isNameplateRecord(property)) {
|
|
var viewBinding2Props = {style: styles.nameplateContainer};
|
|
items2 = [<View style={styles.nameplateWrapper}>{((Component) => <Component nameplate={(require(1901) /* metro dependency 1901: utils */).getNameplateData(property)} fullOpacity animate />)(importDefault(8483) /* metro dependency 8483: Nameplate */)}</View>];
|
|
var viewBinding2Props3 = {style: styles.singleAvatarContainer};
|
|
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
var avatarProps = {user: currentUser, guildId: undefined,
|
|
size: (require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL};
|
|
avatarProps['aria-hidden'] = true;
|
|
items2[1] = <View {...viewBinding2Props3}><Avatar {...avatarProps} /></View>;
|
|
r6 = <View {...viewBinding2Props}>{items2}</View>;
|
|
} else {
|
|
r6 = isAvatarDecorationRecord(property) ? ((Component) => <Component size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.LARGE} asset={property.asset} />)(importDefault(10462) /* metro dependency 10462: GiftingRewardPreviewAvatar */) : undefined;
|
|
}
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<View style={styles.container}>
|
|
{r6}
|
|
<Button
|
|
grow
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kMYVwv)}
|
|
loading={isFetching}
|
|
onPress={value7}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun81001() { // fn#81001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:1260, offset: 0x01e9487d, size: 91 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var navigate;
|
|
var value3;
|
|
if (enabled && prePurchaseGiftingBadgeProgress != null) {
|
|
binding = env0_2;
|
|
navigate = binding.navigate;
|
|
value3 = environment.__proto__;
|
|
Reflect.apply(navigate, binding,
|
|
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
|
|
{currentProgress: prePurchaseGiftingBadgeProgress}]);
|
|
}
|
|
}
|
|
|
|
function _fun81002() { // fn#81002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10653:1379, offset: 0x01e948d8, size: 166 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var navigate;
|
|
var value2;
|
|
var value3;
|
|
if (product != null) {
|
|
value3 = environment.__proto__;
|
|
(importDefault(7589) /* metro dependency 7589: ProductPurchaseSuccessActionCreators */).open({product: product,
|
|
onCancel: env0_5});
|
|
} else if (enabled) {
|
|
if (prePurchaseGiftingBadgeProgress != null) {
|
|
binding = env0_2;
|
|
navigate = binding.navigate;
|
|
value2 = environment.__proto__;
|
|
Reflect.apply(navigate, binding,
|
|
[(require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.GIFTING_BADGE,
|
|
{currentProgress: prePurchaseGiftingBadgeProgress}]);
|
|
} else {
|
|
onClose();
|
|
}
|
|
} else {
|
|
onClose();
|
|
}
|
|
}
|
|
|