184 lines
10 KiB
TypeScript
184 lines
10 KiB
TypeScript
/* Metro module 12283; source: components_native/premium/OutboundPromotionClaimAlert.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 12284, 6771, 6789, 7286, 12285, 1305, 1244, 4573, 4578, 6797, 12286, 4596, 3853, 2] */
|
|
function _fun93847(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12469:6, offset: 0x020c6a5f, size: 638 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.View;
|
|
const env0_7 = value.Image;
|
|
const env0_8 = value.ScrollView;
|
|
const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.loading = {marginVertical: 80};
|
|
object2.body = {alignItems: 'center'};
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
|
|
object2.title = {'fontSize': 24, 'lineHeight': 30, 'color': null, 'fontFamily': null, 'marginBottom': 8,
|
|
color: MOBILE_TEXT_HEADING_PRIMARY, fontFamily: PRIMARY_BOLD};
|
|
object2.errorTitle = {'lineHeight': 24, 'marginBottom': 8};
|
|
object2.bodyText = {'textAlign': 'center', 'lineHeight': 20};
|
|
const object3 = {'backgroundColor': null, 'marginTop': 16, 'padding': 12};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object3.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object2.copyInputContainer = object3;
|
|
object2.copyInputLabel = {'lineHeight': 20, 'marginBottom': 8};
|
|
const object4 = {'borderWidth': 1, 'borderColor': null, 'borderRadius': null, 'padding': 8, 'marginBottom': 8,
|
|
'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between'};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object4.borderColor = BACKGROUND_BASE_LOWEST;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object2.copyInput = object4;
|
|
const ICON_FEEDBACK_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_POSITIVE;
|
|
object2.copyInputCopied = {borderColor: ICON_FEEDBACK_POSITIVE};
|
|
object2.copyButton = {'paddingHorizontal': 8, 'marginLeft': 8};
|
|
object2.promotionArt = {'width': 200, 'height': 100, 'marginBottom': 20};
|
|
object2.errorArt = {'width': 141, 'height': 99, 'marginBottom': 20};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/OutboundPromotionClaimAlert.tsx');
|
|
exports.default = OutboundPromotionClaimAlert;
|
|
}
|
|
|
|
function OutboundPromotionClaimAlert({onCancel, onClaim, code, outboundPromotion}) { // fn#93848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12469:1113, offset: 0x020c6cdd, size: 1599 bytes, params: 2, frame: 38
|
|
var r15;
|
|
var r4;
|
|
var items5;
|
|
var LegacyText;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
var items2;
|
|
var object;
|
|
var copyInput;
|
|
var object2;
|
|
var items3;
|
|
var Button;
|
|
const env0_3 = outboundPromotion;
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const value3 = binding.useState(null);
|
|
const binding2 = env0_3;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
var env0_4 = value4[1];
|
|
const value5 = binding2((importDefault(12284) /* metro dependency 12284: useResettingValue */)(false, 2000), 2);
|
|
const property2 = value5[0];
|
|
const env0_5 = value5[1];
|
|
const value6 = code != null;
|
|
const defaultImport2 = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const USER_SETTINGS_GIFT_INVENTORY = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).USER_SETTINGS_GIFT_INVENTORY;
|
|
binding.useEffect(_fun93849, [value6, outboundPromotion.id, outboundPromotion.outboundTitle,
|
|
outboundPromotion.partnerId, onClaim, defaultImport2(USER_SETTINGS_GIFT_INVENTORY).analyticsLocations]);
|
|
if (code != null) {
|
|
var viewBindingProps = {style: styles.body};
|
|
items5 = [<Image source={importDefault(12285) /* metro dependency 12285 */} style={styles.promotionArt} />];
|
|
LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
string = intl.string;
|
|
items5[1] = <LegacyText style={styles.title} accessibilityRole="header">{Reflect.apply(string, intl,
|
|
[t['23BfZh']])}</LegacyText>;
|
|
items5[2] = <Text style={styles.bodyText} variant="text-md/medium">{outboundPromotion.outboundRedemptionModalBody}</Text>;
|
|
var viewBindingProps2 = {style: styles.copyInputContainer};
|
|
string = intl.string;
|
|
items2 = [<Text style={styles.copyInputLabel} variant="text-md/semibold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
|
|
intl, [t.s9LFQh])}</Text>];
|
|
object = {};
|
|
copyInput = styles.copyInput;
|
|
if (property2) {
|
|
object2 = {};
|
|
copyDataProperties(object2, copyInput, 13);
|
|
copyDataProperties(object2, styles.copyInputCopied, 13);
|
|
r15 = object2;
|
|
} else {
|
|
r15 = copyInput;
|
|
}
|
|
object.style = r15;
|
|
items3 = [<ScrollView style={{flex: 1}} horizontal showsHorizontalScrollIndicator={false}><View onStartShouldSetResponderCapture={function() {
|
|
return true;
|
|
}}><Text lineClamp={1} variant="text-sm/medium" color="interactive-text-active">{code}</Text></View></ScrollView>];
|
|
var viewBinding2Props = {style: styles.copyButton};
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
items3[1] = <View {...viewBinding2Props}><Button text={property2 ? Reflect.apply(string, intl,
|
|
[t.t5VZ88]) : Reflect.apply(string, intl, [t.OpuAlK])} size="sm" onPress={onPress_93853} /></View>;
|
|
items2[1] = <View {...object}>{items3}</View>;
|
|
items2[2] = <Text variant="text-sm/medium" color="text-muted">{'This code is included in your confirmation email'}</Text>;
|
|
items5[3] = <View {...viewBindingProps2}>{items2}</View>;
|
|
r4 = <View {...viewBindingProps}>{items5}</View>;
|
|
} else {
|
|
r4 = <ActivityIndicator style={styles.loading} />;
|
|
}
|
|
const items4 = [<Image source={importDefault(12286) /* metro dependency 12286 */} style={styles.errorArt} />];
|
|
items4[1] = <Text style={styles.errorTitle} variant="text-lg/bold" color="mobile-text-heading-primary">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iufib1)}</Text>;
|
|
items4[2] = <Text style={styles.bodyText} variant="text-md/medium">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.eAn6z2)}</Text>;
|
|
const view = <View style={styles.body}>{items4}</View>;
|
|
const Alert = importDefault(4596) /* metro dependency 4596: Alert */;
|
|
const r11 = property != null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+zx47d']);
|
|
const r8 = property != null ? undefined : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TulDPl);
|
|
r4 = property != null ? view : r4;
|
|
return (
|
|
<Alert
|
|
onCancel={onCancel}
|
|
confirmText={r11}
|
|
onConfirm={onConfirm}
|
|
cancelText={r8}
|
|
noDefaultButtons={!value6 && property == null}
|
|
>
|
|
{r4}
|
|
</Alert>
|
|
);
|
|
}
|
|
|
|
function _fun93849() { // fn#93849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12469:1384, offset: 0x020c731c, size: 134 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var value2;
|
|
var moduleValue;
|
|
var claimOutboundPromotion;
|
|
var outboundPromotionBinding;
|
|
var value;
|
|
if (!result) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(7286) /* metro dependency 7286: PromotionUtils */;
|
|
claimOutboundPromotion = moduleValue.claimOutboundPromotion;
|
|
outboundPromotionBinding = outboundPromotion;
|
|
value = Reflect.apply(claimOutboundPromotion, moduleValue, [{promotionId: outboundPromotionBinding.id,
|
|
promotionTitle: outboundPromotionBinding.outboundTitle, partnerId: outboundPromotionBinding.partnerId,
|
|
analyticsLocations: analyticsLocations}]);
|
|
value = value.then(function(a0) {
|
|
return onClaim(a0);
|
|
});
|
|
value.catch(_fun93851);
|
|
}
|
|
}
|
|
|
|
function OutboundPromotionClaimAlertOnPress() { // fn#93853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12469:2559, owner: OutboundPromotionClaimAlert.onPress, offset: 0x020c73a2, size: 56 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
value.copy(code);
|
|
env0_5(true);
|
|
}
|
|
|
|
function OutboundPromotionClaimAlertOnConfirm() { // fn#93854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12469:3219, owner: OutboundPromotionClaimAlert.onConfirm, offset: 0x020c73da, size: 97 bytes, params: 1, frame: 17
|
|
var value2;
|
|
var moduleValue;
|
|
if (code != null) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(7286) /* metro dependency 7286: PromotionUtils */;
|
|
(importDefault(3853) /* metro dependency 3853: Linking */).openURL(moduleValue.getOutboundPromotionRedemptionUrl(code,
|
|
|
|
outboundPromotion));
|
|
}
|
|
onCancel();
|
|
}
|
|
|