231 lines
14 KiB
TypeScript
231 lines
14 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] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import HelpdeskUtils from '../../../utils/HelpdeskUtils.tsx'; /* Metro dependency 1948 */
|
|
import Linking from '../../../lib/native/Linking.tsx'; /* Metro dependency 3853 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import FastImage2 from '../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
|
|
import Mobile_fraction_nitro_2xPng from '../../../external/discord_assets/assets/orbs/mobile_fraction_nitro_2x.png.js'; /* Metro dependency 10064 */
|
|
import Module10145 from '../../../by-id/module-10145.js'; /* Metro dependency 10145 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as CollectiblesUtilsModule from '../utils/CollectiblesUtils.tsx'; /* Metro dependency 5178 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as ActionSheetHeaderBarNativeModule from '../../../design/components/Sheet/native/ActionSheetHeaderBar.native.tsx'; /* Metro dependency 6515 */
|
|
import * as CircleQuestionIconModule from '../../../design/components/Icon/native/redesign/generated/CircleQuestionIcon.tsx'; /* Metro dependency 10139 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.ActivityIndicator;
|
|
const env0_5 = value.View;
|
|
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;
|
|
object = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.body = {flex: 1, padding: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.content = {'flex': 1, 'gap': null, 'alignItems': 'center', gap: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.buttonContainer = {'flex': 1, 'gap': null, 'alignSelf': 'stretch', gap: PX_16};
|
|
object.description = {textAlign: 'center'};
|
|
object.header = {'height': 112, 'justifyContent': 'center', 'alignItems': 'center', 'overflow': 'hidden'};
|
|
object.fractionNitroIcon = {'width': 68, 'height': 68, 'position': 'absolute', 'top': '50%', 'left': '50%',
|
|
transform: [{translateX: -34}, {translateY: -34}]};
|
|
const object4 = {'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;
|
|
object4.right = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.top = PX_16;
|
|
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object4.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object4.alignItems = 'center';
|
|
object.questionIconContainer = object4;
|
|
object.questionIcon = {'width': 18, 'height': 18};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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={Module10145} />)(FastImage2)}
|
|
{((Component) => <Component source={{uri: Mobile_fraction_nitro_2xPng}} style={styles.fractionNitroIcon} />)(FastImage2)}
|
|
</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 = (ButtonNativeModule).Button;
|
|
var object2;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var items4;
|
|
const styles = useStyles();
|
|
const value2 = (UseTheme)();
|
|
const value3 = (CollectiblesUtilsModule).useFetchFractionalPremiumInfo();
|
|
const isLoading = value3.isLoading;
|
|
const isFractionalPremiumActive = value3.isFractionalPremiumActive;
|
|
const isFractionalPremiumActive2 = isFractionalPremiumActive;
|
|
const expiresAt = value3.expiresAt;
|
|
const binding = isFractionalPremiumActive2;
|
|
const value4 = binding.useMemo(_fun79081, [consumed, value2]);
|
|
const value5 = binding.useMemo(_fun79082, [consumed, expiresAt, isFractionalPremiumActive, styles.description]);
|
|
const value6 = binding.useCallback(_fun79083, []);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
|
|
const r10 = (
|
|
consumed
|
|
? ((Component) => <Component premiumType={PremiumTypes.TIER_2} />)(importDefault(7046) /* metro dependency 7046: PremiumPlanActionSheetHeader */)
|
|
: (
|
|
<NitroAcquiredHeader />
|
|
)
|
|
);
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const CircleQuestionIcon = (CircleQuestionIconModule).CircleQuestionIcon;
|
|
const WHITE = (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};
|
|
object2 = {size: 'lg'};
|
|
string = intl.string;
|
|
if (consumed) {
|
|
object2.text = Reflect.apply(string, intl, [t.ERKK6v]);
|
|
object2.onPress = onPressExplorePerks;
|
|
} else {
|
|
object2.text = Reflect.apply(string, intl, [t['Jr6N+s']]);
|
|
object2.onPress = onPressViewCredits;
|
|
}
|
|
items4 = [
|
|
<Button {...object2} />,
|
|
];
|
|
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 = (ActionSheetHeaderBarNativeModule).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 = (TextModule).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 = HelpdeskUtils;
|
|
const getArticleURL = defaultImport.getArticleURL;
|
|
const FRACTIONAL_PREMIUM_ABOUT = HelpdeskArticles.FRACTIONAL_PREMIUM_ABOUT;
|
|
(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 (ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79078, 10144, [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]) /* metro module 10144, 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] */;
|