169 lines
11 KiB
TypeScript
169 lines
11 KiB
TypeScript
/* Metro module 10144; source: modules/collectibles/native/FractionalNitroCollectedActionSheet.tsx; dependencies: [31, 27, 661, 1880, 33, 4501, 697, 5475, 10145, 10064, 4048, 5178, 4002, 7316, 7317, 4573, 1244, 1948, 3853, 6275, 7046, 5278, 10139, 4578, 4080, 6515, 2] */
|
|
function _fun79078(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:6, offset: 0x01e43e5b, size: 627 bytes, params: 8, frame: 25
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.ActivityIndicator;
|
|
const env0_5 = value.View;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).HelpdeskArticles;
|
|
const env0_7 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
const env0_10 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.body = {flex: 1, padding: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.content = {'flex': 1, 'gap': null, 'alignItems': 'center', gap: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.buttonContainer = {'flex': 1, 'gap': null, 'alignSelf': 'stretch', gap: PX_16};
|
|
object2.description = {textAlign: 'center'};
|
|
object2.header = {'height': 112, 'justifyContent': 'center', 'alignItems': 'center', 'overflow': 'hidden'};
|
|
object2.fractionNitroIcon = {'width': 68, 'height': 68, 'position': 'absolute', 'top': '50%', 'left': '50%',
|
|
transform: [{translateX: -34}, {translateY: -34}]};
|
|
const object3 = {'position': 'absolute', 'right': null, 'top': null, 'width': 32, 'height': 32,
|
|
'backgroundColor': null, 'justifyContent': 'center'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.right = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.top = PX_16;
|
|
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object3.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object3.alignItems = 'center';
|
|
object2.questionIconContainer = object3;
|
|
object2.questionIcon = {'width': 18, 'height': 18};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/native/FractionalNitroCollectedActionSheet.tsx');
|
|
exports.default = FractionalNitroCollectedActionSheet;
|
|
}
|
|
|
|
function NitroAcquiredHeader() { // fn#79079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:973, offset: 0x01e440ce, size: 157 bytes, params: 1, frame: 22
|
|
const styles = useStyles();
|
|
return (
|
|
<View style={styles.header}>
|
|
{((Component) => <Component source={importDefault(10145) /* metro dependency 10145 */} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
|
|
{((Component) => <Component source={{uri: importDefault(10064) /* metro dependency 10064: mobile_fraction_nitro_2xPng */}} style={styles.fractionNitroIcon} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FractionalNitroCollectedActionSheet({consumed, onPressExplorePerks, onPressViewCredits}) { // fn#79080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:1254, offset: 0x01e4416b, size: 946 bytes, params: 2, frame: 38
|
|
var r9;
|
|
var items3;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
var object;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items4;
|
|
const styles = useStyles();
|
|
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const value3 = (require(5178) /* metro dependency 5178: CollectiblesUtils */).useFetchFractionalPremiumInfo();
|
|
const isLoading = value3.isLoading;
|
|
const isFractionalPremiumActive = value3.isFractionalPremiumActive;
|
|
const env0_3 = isFractionalPremiumActive;
|
|
const expiresAt = value3.expiresAt;
|
|
const binding = env0_3;
|
|
const value4 = binding.useMemo(_fun79081, [consumed, value2]);
|
|
const value5 = binding.useMemo(_fun79082, [consumed, expiresAt, isFractionalPremiumActive, styles.description]);
|
|
const value6 = binding.useCallback(_fun79083, []);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
|
|
const r10 = consumed ? ((Component) => <Component premiumType={PremiumTypes.TIER_2} />)(importDefault(7046) /* metro dependency 7046: PremiumPlanActionSheetHeader */) : <NitroAcquiredHeader />;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const CircleQuestionIcon = (require(10139) /* metro dependency 10139: CircleQuestionIcon */).CircleQuestionIcon;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
const items2 = [<>{r10}<PressableOpacity style={styles.questionIconContainer} onPress={value6}><CircleQuestionIcon style={styles.questionIcon} color={WHITE} /></PressableOpacity></>];
|
|
if (isLoading) {
|
|
r9 = <ActivityIndicator size="large" />;
|
|
} else {
|
|
var viewBinding2Props = {style: styles.content};
|
|
items3 = [value4, value5];
|
|
var viewBinding3Props = {style: styles.buttonContainer};
|
|
object = {size: 'lg'};
|
|
string = intl.string;
|
|
if (consumed) {
|
|
object.text = Reflect.apply(string, intl, [t.ERKK6v]);
|
|
object.onPress = onPressExplorePerks;
|
|
} else {
|
|
object.text = Reflect.apply(string, intl, [t['Jr6N+s']]);
|
|
object.onPress = onPressViewCredits;
|
|
}
|
|
items4 = [<Button {...object} />];
|
|
string = intl.string;
|
|
items4[1] = <Button size="lg" variant="secondary" text={Reflect.apply(string, intl,
|
|
[t.TkTvBz])} onPress={onPress_79084} />;
|
|
items3[2] = <View {...viewBinding3Props}>{items4}</View>;
|
|
r9 = <View {...viewBinding2Props}>{items3}</View>;
|
|
}
|
|
items2[1] = <View style={styles.body}>{r9}</View>;
|
|
const ActionSheetHeaderBar = (require(6515) /* metro dependency 6515: ActionSheetHeaderBarNative */).ActionSheetHeaderBar;
|
|
items2[2] = <ActionSheetHeaderBar variant="floating" />;
|
|
return (
|
|
<BottomSheet handleDisabled>
|
|
{items2}
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function _fun79081() { // fn#79081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:1493, offset: 0x01e4451d, size: 223 bytes, params: 1, frame: 20
|
|
var r0;
|
|
var Text;
|
|
var intl;
|
|
var FastImage;
|
|
var value;
|
|
if (consumed) {
|
|
FastImage = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
value = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_2);
|
|
value = <FastImage source={value ? importDefault(7316) /* metro dependency 7316 */ : importDefault(7317) /* metro dependency 7317 */} />;
|
|
r0 = value;
|
|
} else {
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r0 = <Text variant="heading-lg/bold" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.g5W1g8)}</Text>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun79082() { // fn#79082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:1697, offset: 0x01e445fc, size: 325 bytes, params: 1, frame: 24
|
|
const value = environment.__proto__;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const Cz1G97 = (require(1244) /* metro dependency 1244: indexNative */).t.Cz1G97;
|
|
const value2 = Reflect.apply(formatToPlainString, intl, [Cz1G97, {days: 3}]);
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const consumedBinding = consumed;
|
|
const textProps = {'variant': 'text-md/normal', 'color': 'text-default', style: styles.description};
|
|
if (consumedBinding) {
|
|
textProps.children = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['93PGOI'],
|
|
{duration: value2, expirationDate: expiresAt});
|
|
} else {
|
|
textProps.children = isFractionalPremiumActive ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fBmhE9) : intl.format((require(1244) /* metro dependency 1244: indexNative */).t['8fyBPf'],
|
|
|
|
{duration: value2});
|
|
}
|
|
return <Text {...textProps} />;
|
|
}
|
|
|
|
function _fun79083() { // fn#79083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:2163, offset: 0x01e44741, size: 71 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
const getArticleURL = defaultImport.getArticleURL;
|
|
const FRACTIONAL_PREMIUM_ABOUT = HelpdeskArticles.FRACTIONAL_PREMIUM_ABOUT;
|
|
(importDefault(3853) /* metro dependency 3853: Linking */).openURL(Reflect.apply(getArticleURL, defaultImport,
|
|
[FRACTIONAL_PREMIUM_ABOUT]));
|
|
}
|
|
|
|
function FractionalNitroCollectedActionSheetOnPress() { // fn#79084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10330:2935, owner: FractionalNitroCollectedActionSheet.onPress, offset: 0x01e44788, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
}
|
|
|