208 lines
11 KiB
TypeScript
208 lines
11 KiB
TypeScript
/* Metro module 8414; source: modules/user_profile/native/EditCollectiblesPreviewDetails.tsx; dependencies: [31, 27, 1949, 33, 4501, 566, 3802, 5134, 3826, 4573, 1244, 8405, 2] */
|
|
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import UseCollectiblesData from '../../collectibles/hooks/useCollectiblesData.tsx'; /* Metro dependency 8405 */
|
|
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 CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
|
|
function _fun66840(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8599:6, offset: 0x01c0c22d, size: 252 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const env0_8 = (CreateStylesModule).createStyles({productDetailsContainer: {'width': '100%',
|
|
'marginTop': 16, 'alignItems': 'center', 'gap': 2}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/EditCollectiblesPreviewDetails.tsx');
|
|
exports.default = _default_66843;
|
|
function EditCollectiblesPreviewDescription({user, product, purchase, nitroJoinCTA, nitroUpgradeCTA}) { // fn#66841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8599:308, offset: 0x01c0c329, size: 1112 bytes, params: 2, frame: 37
|
|
var r21;
|
|
var r12;
|
|
var moduleValue5;
|
|
var diffAsUnits;
|
|
var Date;
|
|
var value5;
|
|
var date;
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
var Io7ozn;
|
|
var object3;
|
|
var eZSTa5;
|
|
var object5;
|
|
const locale = (require(566) /* metro dependency 566: flux */).useStateFromStores([LocaleStore], function() {
|
|
return LocaleStore.locale;
|
|
});
|
|
const canUseCollectibles2 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseCollectibles(user);
|
|
let r0 = (require(5134) /* metro dependency 5134: CollectiblesUtils */).isPremiumCollectiblesProduct(product) || (require(5134) /* metro dependency 5134: CollectiblesUtils */).isPremiumCollectiblesPurchase(purchase);
|
|
const r4 = !canUseCollectibles2 && (require(5134) /* metro dependency 5134: CollectiblesUtils */).isPremiumCollectiblesPurchase(purchase);
|
|
if (purchase == null) {
|
|
r0 = (
|
|
r0
|
|
? (
|
|
canUseCollectibles2
|
|
? (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hmyYK8)}
|
|
</Text>
|
|
)
|
|
: (
|
|
(importDefault(3802) /* metro dependency 3802: PremiumUtils */).isPremium(user)
|
|
? (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{nitroUpgradeCTA}
|
|
</Text>
|
|
)
|
|
: (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{nitroJoinCTA}
|
|
</Text>
|
|
)
|
|
)
|
|
)
|
|
: (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fEGjVQ)}
|
|
</Text>
|
|
)
|
|
);
|
|
return r0;
|
|
}
|
|
if (r4) {
|
|
r0 = (
|
|
r0
|
|
? (
|
|
canUseCollectibles2
|
|
? (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hmyYK8)}
|
|
</Text>
|
|
)
|
|
: (
|
|
(importDefault(3802) /* metro dependency 3802: PremiumUtils */).isPremium(user)
|
|
? (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{nitroUpgradeCTA}
|
|
</Text>
|
|
)
|
|
: (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{nitroJoinCTA}
|
|
</Text>
|
|
)
|
|
)
|
|
)
|
|
: (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fEGjVQ)}
|
|
</Text>
|
|
)
|
|
);
|
|
return r0;
|
|
}
|
|
if (purchase?.expiresAt != null) {
|
|
moduleValue5 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
diffAsUnits = moduleValue5.diffAsUnits;
|
|
Date = global.Date;
|
|
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r21 = Reflect.apply(diffAsUnits, moduleValue5, [date instanceof Object ? date : value5, purchase.expiresAt]);
|
|
} else {
|
|
r21 = null;
|
|
}
|
|
const jsxRuntimeEnv0_6Binding = jsxRuntimeEnv0_6;
|
|
const value8 = r21 != null;
|
|
if (value8) {
|
|
format = intl.format;
|
|
Io7ozn = (require(1244) /* metro dependency 1244: indexNative */).t.Io7ozn;
|
|
object3 = {};
|
|
object3.days = r21.days.toString();
|
|
r12 = (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{Reflect.apply(format, intl, [Io7ozn, object3])}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r12 = value8;
|
|
}
|
|
const items2 = [r12];
|
|
format = intl.format;
|
|
const gW9R4B = (require(1244) /* metro dependency 1244: indexNative */).t.gW9R4B;
|
|
const object6 = {};
|
|
object6.date = purchase == null ? undefined : purchase.purchasedAt.toLocaleDateString(locale, {'month': 'long',
|
|
'year': 'numeric'});
|
|
items2[1] = (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{Reflect.apply(format, intl, [gW9R4B, object6])}
|
|
</Text>
|
|
);
|
|
const value11 = purchase?.expiresAt != null;
|
|
if (value11) {
|
|
format = intl.format;
|
|
eZSTa5 = (require(1244) /* metro dependency 1244: indexNative */).t.eZSTa5;
|
|
object5 = {};
|
|
object5.date = purchase.expiresAt.toLocaleDateString(locale, {'minute': 'numeric', 'hour': 'numeric',
|
|
'day': 'numeric', 'month': 'long', 'year': 'numeric'});
|
|
r12 = (
|
|
<Text variant="text-sm/medium" color="text-default">
|
|
{Reflect.apply(format, intl, [eZSTa5, object5])}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r12 = value11;
|
|
}
|
|
items2[2] = r12;
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _default_66843({user, previewSkuId, nitroJoinCTA, nitroUpgradeCTA}) { // fn#66843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8599:1752, offset: 0x01c0c781, size: 278 bytes, params: 2, frame: 26
|
|
const styles = useStyles();
|
|
const {product, purchase} = (UseCollectiblesData)(previewSkuId);
|
|
return (
|
|
previewSkuId == null
|
|
? null
|
|
: (
|
|
product != null
|
|
? (
|
|
<View style={styles.productDetailsContainer}>
|
|
{((Text) => <Text variant="text-md/bold" color="text-default">{product?.name ?? purchase?.name}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
<EditCollectiblesPreviewDescription
|
|
user={user}
|
|
product={product}
|
|
purchase={purchase}
|
|
nitroJoinCTA={nitroJoinCTA}
|
|
nitroUpgradeCTA={nitroUpgradeCTA}
|
|
/>
|
|
</View>
|
|
)
|
|
: (
|
|
purchase == null
|
|
? null
|
|
: (
|
|
<View style={styles.productDetailsContainer}>
|
|
{((Text) => <Text variant="text-md/bold" color="text-default">{product?.name ?? purchase?.name}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
<EditCollectiblesPreviewDescription
|
|
user={user}
|
|
product={product}
|
|
purchase={purchase}
|
|
nitroJoinCTA={nitroJoinCTA}
|
|
nitroUpgradeCTA={nitroUpgradeCTA}
|
|
/>
|
|
</View>
|
|
)
|
|
)
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun66840, 8414, [31, 27, 1949, 33, 4501, 566, 3802, 5134, 3826, 4573, 1244, 8405,
|
|
2]) /* metro module 8414, dependencies: [31, 27, 1949, 33, 4501, 566, 3802, 5134, 3826, 4573, 1244, 8405, 2] */;
|