141 lines
8.7 KiB
TypeScript
141 lines
8.7 KiB
TypeScript
/* Metro module 10460; source: modules/premium/native/gifting/PremiumGiftDuration.tsx; dependencies: [31, 27, 1880, 33, 4501, 697, 7669, 6238, 7975, 10391, 3874, 4573, 1244, 7672, 6518, 2] */
|
|
import UseInitialValue from '../../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
|
|
import NitroGiftPriceCopyExperiment from '../../gifting/experiments/NitroGiftPriceCopyExperiment.tsx'; /* Metro dependency 7672 */
|
|
import UsePremiumProductPricingString from '../hooks/usePremiumProductPricingString.tsx'; /* Metro dependency 10391 */
|
|
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 IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as UseA11yRolesNativeModule from '../../../../external/discord_common/js/packages/design/hooks/useA11yRolesNative.tsx'; /* Metro dependency 3874 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as NativeGiftContextModule from '../../../payments/native/NativeGiftContext.tsx'; /* Metro dependency 7669 */
|
|
|
|
function _fun80958(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:6, offset: 0x01e91715, size: 567 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = PremiumConstantsModule;
|
|
const env0_5 = value.PREMIUM_YEARLY_DISCOUNT_PERCENT;
|
|
const SubscriptionIntervalTypes = value.SubscriptionIntervalTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
object = [YEAR];
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
object[1] = MONTH;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
let createStyles = value.createStyles;
|
|
object = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.container = {marginTop: PX_8};
|
|
const object3 = {};
|
|
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
|
|
object3.borderColor = BACKGROUND_BRAND;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object3.borderWidth = 2;
|
|
object.containerSelected = object3;
|
|
object.labelContainer = {flexDirection: 'row'};
|
|
const object5 = {};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.marginStart = PX_8;
|
|
const STATUS_POSITIVE_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_POSITIVE_BACKGROUND;
|
|
object5.backgroundColor = STATUS_POSITIVE_BACKGROUND;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.paddingHorizontal = PX_8;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object.labelPromo = object5;
|
|
const env0_10 = Reflect.apply(createStyles, value, [object]);
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
createStyles = value.createStyles;
|
|
object = {};
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.durationContainer = {marginHorizontal: PX_16};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object.durationTitle = {marginTop: PX_24};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftDuration.tsx');
|
|
exports.default = PremiumGiftDuration;
|
|
function PremiumGiftDurationButton({selected, planInterval}) { // fn#80959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:627, offset: 0x01e9194c, size: 773 bytes, params: 2, frame: 40
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const value2 = (NativeGiftContextModule).useNativeGiftContext();
|
|
const premiumType = value2.premiumType;
|
|
const env0_1 = value2.setPlanInterval;
|
|
const styles = useStyles();
|
|
const r6 = selected ? (require(6238) /* metro dependency 6238: TableRowNative */).TableRow : (require(7975) /* metro dependency 7975: RowButtonNative */).RowButton;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
const r29 = planInterval !== YEAR ? null : '' + PREMIUM_YEARLY_DISCOUNT_PERCENT + '%';
|
|
const value5 = (UsePremiumProductPricingString)(premiumType,
|
|
planInterval);
|
|
const {accessibilityRole,
|
|
accessibilityState} = (UseA11yRolesNativeModule).useRadioA11yNative({selected: selected});
|
|
const items2 = [styles.container];
|
|
items2[1] = selected && styles.containerSelected;
|
|
const Text = (TextModule).Text;
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
return (
|
|
<View style={items2}>
|
|
{((Component) => <Component label={<View style={styles.labelContainer}><Text variant="text-md/semibold">{planInterval === MONTH ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Mh9bTt) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DRgqMo)}</Text>{r29 != null && <View style={styles.labelPromo}><Text variant="text-md/bold" color="always-white">{intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.IAybsG,
|
|
{discount: r29}).toUpperCase()}</Text></View>}</View>} trailing={<Text variant="text-md/semibold">{value5}</Text>} onPress={function() {
|
|
setPlanInterval(planInterval);
|
|
}} arrow={false} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState} start end />)(r6)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function PremiumGiftDuration() { // fn#80961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:1785, offset: 0x01e91c51, size: 314 bytes, params: 1, frame: 23
|
|
const styles = useStyles();
|
|
const useNativeGiftContext = NativeGiftContextModule.useNativeGiftContext;
|
|
const env0_0 = Reflect.apply(useNativeGiftContext, NativeGiftContextModule, []).planInterval;
|
|
const defaultImport = NitroGiftPriceCopyExperiment;
|
|
const useConfig = defaultImport.useConfig;
|
|
const value3 = ReactModule.useMemo(_fun80962,
|
|
[(UseInitialValue)(Reflect.apply(useConfig, defaultImport,
|
|
[{location: 'PremiumGiftDuration'}]).monthlyDefaultSelected)]);
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const items2 = [
|
|
<Text style={styles.durationTitle} variant="text-sm/semibold">
|
|
{intl.string((IndexNativeModule).t['8XT6Nf'])}
|
|
</Text>,
|
|
];
|
|
items2[1] = value3.map(_fun80963);
|
|
return (
|
|
<View style={styles.durationContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun80962() { // fn#80962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:1977, offset: 0x01e91d8b, size: 50 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var items2;
|
|
const binding = env0_1;
|
|
const value = environment.__proto__;
|
|
const binding2 = env1_9;
|
|
if (binding) {
|
|
items2 = [];
|
|
arraySpread(items2, binding2, 0, binding2);
|
|
r0 = items2.reverse();
|
|
} else {
|
|
r0 = binding2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun80963(a0, a1) { // fn#80963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10646:2183, offset: 0x01e91dbd, size: 51 bytes, params: 3, frame: 15
|
|
return (
|
|
<PremiumGiftDurationButton
|
|
selected={planInterval === a0}
|
|
planInterval={a0}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80958, 10460, [31, 27, 1880, 33, 4501, 697, 7669, 6238, 7975, 10391, 3874, 4573, 1244, 7672, 6518,
|
|
2]) /* metro module 10460, dependencies: [31, 27, 1880, 33, 4501, 697, 7669, 6238, 7975, 10391, 3874, 4573, 1244, 7672, 6518, 2] */;
|