118 lines
7.7 KiB
TypeScript
118 lines
7.7 KiB
TypeScript
/* Metro module 14943; source: modules/premium/native/MobileTrialUserSettingsAvatarBadge.tsx; dependencies: [31, 27, 1878, 1880, 33, 4501, 697, 7062, 7061, 566, 14944, 14945, 14946, 14947, 10357, 1365, 1305, 10843, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as MobileTrialUtilsModule from './MobileTrialUtils.tsx'; /* Metro dependency 7061 */
|
|
import * as UsePremiumTrialOfferNativeModule from '../hooks/usePremiumTrialOffer.native.tsx'; /* Metro dependency 7062 */
|
|
|
|
function _fun113050(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15140:6, offset: 0x023e74bd, size: 518 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = JsxRuntimeModule;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.Fragment;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (Native).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
const env0_9 = Reflect.apply(createStyles, value, [{sparkleContainer: {position: 'absolute'}, sparkle: {'width': 12,
|
|
'height': 12}, sparkle2: {'width': 4, 'height': 4, tintColor: MOBILE_TEXT_HEADING_PRIMARY}, star: {'width': 8,
|
|
'height': 8}, defaultSparklePosition: {'bottom': -6, 'left': -8}, defaultSparkle2Position: {'bottom': 16,
|
|
'left': -2}, defaultStarPosition: {'top': -4, 'right': -8}, avatarSparklePosition: {'bottom': -8, 'left': -10},
|
|
avatarSparkle2Position: {'bottom': 16, 'left': -2}, avatarStarPosition: {'top': -4, 'right': -10},
|
|
sparkle2Transform: {transform: [{rotate: '20deg'}]}, starTransform: {transform: [{rotate: '-165deg'}]}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/MobileTrialUserSettingsAvatarBadge.tsx');
|
|
exports.MobileTrialUserSettingsAvatarBadge = MobileTrialUserSettingsAvatarBadge;
|
|
function MobileTrialUserSettingsAvatarBadge() { // fn#113051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15140:880, offset: 0x023e76c3, size: 461 bytes, params: 1, frame: 20
|
|
var r7;
|
|
var r2;
|
|
var sku_id;
|
|
var value5;
|
|
var TIER_0;
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const value3 = (UsePremiumTrialOfferNativeModule).usePremiumTrialOffer();
|
|
const subscription_trial = value3 == null ? value2 : value3.subscription_trial;
|
|
const value4 = (MobileTrialUtilsModule).useShouldShowPremiumTrialUserSettingsAvatarBadge();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
if (value4) {
|
|
value5 = (currentUser == null ? value2 : currentUser.avatar) != null;
|
|
r7 = value5 ? styles.avatarSparklePosition : styles.defaultSparklePosition;
|
|
r7 = value5 ? styles.avatarSparkle2Position : styles.defaultSparkle2Position;
|
|
r2 = value5 ? styles.avatarStarPosition : styles.defaultStarPosition;
|
|
sku_id = subscription_trial == null ? value2 : subscription_trial.sku_id;
|
|
TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
r2 = sku_id === TIER_0 ? importDefault(14944) /* metro dependency 14944 */ : importDefault(14945) /* metro dependency 14945 */;
|
|
sku_id = subscription_trial == null ? value2 : subscription_trial.sku_id;
|
|
TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
var env0_5 = sku_id === TIER_0 ? importDefault(14946) /* metro dependency 14946 */ : importDefault(14947) /* metro dependency 14947 */;
|
|
return ((Component) => <Component contentTypes={[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE]}>{children_113053}</Component>)(importDefault(10357) /* metro dependency 10357: SelectedDismissibleContent */);
|
|
}
|
|
return null;
|
|
function MobileTrialUserSettingsAvatarBadgeChildren({visibleContent}) { // fn#113053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15140:1571, owner: MobileTrialUserSettingsAvatarBadge.children, offset: 0x023e7890, size: 399 bytes, params: 2, frame: 27
|
|
var jsxRuntimeEnv1_7Binding;
|
|
var stylesBinding;
|
|
var sparkleContainer;
|
|
const Icon = (NativeModule).Icon;
|
|
var items2;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE = DismissibleContent.PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE;
|
|
if (visibleContent === PREMIUM_MOBILE_TRIAL_USER_SETTINGS_AVATAR_BADGE) {
|
|
jsxRuntimeEnv1_7Binding = jsxRuntimeEnv1_7;
|
|
stylesBinding = styles;
|
|
sparkleContainer = stylesBinding.sparkleContainer;
|
|
items2 = [
|
|
<View style={[sparkleContainer, env0_1]}>
|
|
<Icon
|
|
source={env0_4}
|
|
style={stylesBinding.sparkle}
|
|
disableColor
|
|
/>
|
|
</View>,
|
|
];
|
|
sparkleContainer = stylesBinding.sparkleContainer;
|
|
items2[1] = (
|
|
<View style={[sparkleContainer, stylesBinding.starTransform, ReactNativeModule.View]}>
|
|
<Icon
|
|
source={env0_5}
|
|
style={stylesBinding.star}
|
|
disableColor
|
|
/>
|
|
</View>
|
|
);
|
|
sparkleContainer = stylesBinding.sparkleContainer;
|
|
items2[2] = (
|
|
<View style={[sparkleContainer, stylesBinding.sparkle2Transform, env0_2]}>
|
|
<Icon
|
|
source={importDefault(10843) /* metro dependency 10843 */}
|
|
style={stylesBinding.sparkle2}
|
|
disableColor
|
|
/>
|
|
</View>
|
|
);
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun113050, 14943, [31, 27, 1878, 1880, 33, 4501, 697, 7062, 7061, 566, 14944, 14945, 14946, 14947,
|
|
10357, 1365, 1305, 10843,
|
|
2]) /* metro module 14943, dependencies: [31, 27, 1878, 1880, 33, 4501, 697, 7062, 7061, 566, 14944, 14945, 14946, 14947, 10357, 1365, 1305, 10843, 2] */;
|