159 lines
10 KiB
TypeScript
159 lines
10 KiB
TypeScript
/* Metro module 12281; source: components_native/premium/OutboundPromotionCard.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 6235, 6275, 6758, 1244, 4573, 6622, 4048, 7286, 12282, 4496, 12283, 1962, 7289, 4578, 6766, 4080, 2] */
|
|
function _fun93833(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:6, offset: 0x020c603e, size: 529 bytes, params: 8, frame: 23
|
|
var object4;
|
|
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.View;
|
|
const env0_6 = value.Image;
|
|
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = (require(661) /* metro dependency 661: Constants */).USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object4 = {};
|
|
const object5 = {'flex': 1, 'flexDirection': 'column', 'paddingHorizontal': null, 'paddingVertical': 12,
|
|
'backgroundColor': null, 'marginTop': 8};
|
|
object5.paddingHorizontal = USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object5.backgroundColor = BACKGROUND_BASE_LOW;
|
|
object4.card = object5;
|
|
object4.mainContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'space-between'};
|
|
object4.textContainer = {'flexDirection': 'row', 'flexShrink': 1, 'alignItems': 'center'};
|
|
const object6 = {'width': 32, 'height': 32, 'marginRight': 8, 'borderRadius': null, 'alignItems': 'center',
|
|
'justifyContent': 'center'};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
const DARK_BLACK_500_LIGHT_PRIMARY_100 = (require(6235) /* metro dependency 6235: LegacyTokens */).DARK_BLACK_500_LIGHT_PRIMARY_100;
|
|
object6.backgroundColor = DARK_BLACK_500_LIGHT_PRIMARY_100;
|
|
object4.imageContainer = object6;
|
|
object4.image = {'width': 28, 'height': 28, 'resizeMode': 'contain'};
|
|
object4.title = {lineHeight: 20};
|
|
object4.subText = {lineHeight: 18};
|
|
object4.claimButton = {paddingHorizontal: 12};
|
|
object4.moreDetails = {marginLeft: 40};
|
|
object4.termsAndConditionsText = {'paddingHorizontal': 16, 'paddingTop': 16};
|
|
object4.buttonContainer = {'flexGrow': 1, 'flexDirection': 'row', 'marginLeft': 4, 'justifyContent': 'flex-end'};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object4]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/OutboundPromotionCard.tsx');
|
|
exports.default = OutboundPromotionCard;
|
|
}
|
|
|
|
function TermsAndConditionsActionSheet({termsAndConditions}) { // fn#93834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1039, offset: 0x020c624f, size: 246 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const object2 = {};
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const PdKWVT = (require(1244) /* metro dependency 1244: indexNative */).t.PdKWVT;
|
|
object2.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [PdKWVT])} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<BottomSheet {...object2}>
|
|
<Text style={styles.termsAndConditionsText} variant="text-sm/medium">
|
|
{(importDefault(6622) /* metro dependency 6622: MarkupUtils */).parse(termsAndConditions, false,
|
|
{allowLinks: true})}
|
|
</Text>
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function OutboundPromotionCard({outboundPromotion, code}) { // fn#93835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1369, offset: 0x020c6345, size: 927 bytes, params: 2, frame: 32
|
|
var env0_3Binding = undefined;
|
|
const styles = useStyles();
|
|
const promotionImageURL = (require(7286) /* metro dependency 7286: PromotionUtils */).getPromotionImageURL(outboundPromotion.id,
|
|
(importDefault(4048) /* metro dependency 4048: useTheme */)());
|
|
const value4 = code != null;
|
|
const value5 = (importDefault(12282) /* metro dependency 12282: useOutboundPromotionRedemptionEndDate */)(outboundPromotion,
|
|
value4);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r21 = value4 ? Reflect.apply(formatToPlainString, intl, [t.VaD05h,
|
|
{endDate: value5}]) : Reflect.apply(formatToPlainString, intl, [t['/XWgfG'], {endDate: value5}]);
|
|
const string = intl.string;
|
|
const r20 = value4 ? Reflect.apply(string, intl, [t['2cHUti']]) : Reflect.apply(string, intl, [t.O13yhz]);
|
|
const binding = env0_4;
|
|
var [property, env0_3] = env0_3Binding(binding.useState(false), 2);
|
|
binding.useLayoutEffect(_fun93836, [property, code, outboundPromotion]);
|
|
const items2 = [<View style={styles.imageContainer}><Image style={styles.image} source={{uri: promotionImageURL}} /></View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <View style={styles.textContainer}><View><Text style={styles.title} accessibilityRole="header" variant="text-md/semibold" color="mobile-text-heading-primary">{outboundPromotion.outboundTitle}</Text><Text style={styles.subText} variant="text-sm/medium" color="text-default">{r21}</Text></View></View>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items2[2] = <View style={styles.buttonContainer}><View style={styles.claimButton}><Button size="sm" shrink text={r20} onPress={onPress_93841} /></View></View>;
|
|
const view = <View style={styles.mainContainer}>{items2}</View>;
|
|
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
return (
|
|
<View style={styles.card}>
|
|
{view}
|
|
<View>
|
|
<TextWithIOSLinkWorkaround style={styles.moreDetails} variant="text-sm/medium">
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.sCm3Zb,
|
|
{onClick: onClick_93842})}
|
|
</TextWithIOSLinkWorkaround>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun93836() { // fn#93836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1809, offset: 0x020c66e4, size: 66 bytes, params: 1, frame: 12
|
|
var environment;
|
|
var value;
|
|
if (env0_2) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
|
|
value.openLazy({importer: importer_93837});
|
|
}
|
|
}
|
|
|
|
function OutboundPromotionCardOnClick() { // fn#93842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:2773, owner: OutboundPromotionCard.onClick, offset: 0x020c683a, size: 117 bytes, params: 1, frame: 17
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
const openLazy = value.openLazy;
|
|
const outboundPromotionBinding = outboundPromotion;
|
|
Reflect.apply(openLazy, value, [function() {
|
|
var Promise = global.Promise;
|
|
return Promise.resolve(TermsAndConditionsActionSheet);
|
|
}, 'OutboundPromotionTermsAndConditions-' + outboundPromotionBinding.id,
|
|
{termsAndConditions: outboundPromotionBinding.outboundTermsAndConditions}]);
|
|
}
|
|
|
|
function importer_93837() { // fn#93837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1845, offset: 0x020c6726, size: 64 bytes, params: 1, frame: 13
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(dependencyMap[18]);
|
|
value = value(dependencyMap[17], dependencyMap.paths);
|
|
return value.then(function({default: env0_0}) {
|
|
return _fun93839;
|
|
});
|
|
}
|
|
|
|
function _fun93838({default: env0_0}) { // fn#93838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1879, offset: 0x020c6766, size: 23 bytes, params: 2, frame: 2
|
|
return _fun93839;
|
|
}
|
|
|
|
function _fun93839(a0) { // fn#93839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1894, offset: 0x020c677d, size: 120 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
const bindingProps = {...a0};
|
|
bindingProps['onCancel'] = onCancel_93840;
|
|
bindingProps['onClaim'] = (importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).addClaimedOutboundPromotionCode;
|
|
bindingProps['code'] = code;
|
|
bindingProps['outboundPromotion'] = outboundPromotion;
|
|
return ((Component) => <Component {...bindingProps} />)(binding);
|
|
}
|
|
|
|
function onCancel_93840() { // fn#93840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1916, offset: 0x020c67f5, size: 51 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
|
|
(importDefault(4496) /* metro dependency 4496: AlertActionCreators */).close();
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
env4_3(false);
|
|
}
|
|
|