157 lines
8.2 KiB
TypeScript
157 lines
8.2 KiB
TypeScript
/* Metro module 10387; source: modules/premium/gifting/native/GiftingBadgeInfoActionSheet.tsx; dependencies: [31, 27, 4502, 7670, 661, 33, 4501, 697, 1585, 566, 7635, 683, 6275, 4573, 1244, 2320, 10388, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import BadgeDirectoryStore from '../../../badges/BadgeDirectoryStore.tsx'; /* Metro dependency 7670 */
|
|
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 ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as BottomSheetNativeModule from '../../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as BadgeDirectoryStoreModule from '../../../badges/BadgeDirectoryStore.tsx'; /* Metro dependency 7670 */
|
|
|
|
function _fun80468(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10573:6, offset: 0x01e7c2a7, size: 519 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {alignItems: 'center'};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingTop = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingHorizontal = PX_16;
|
|
object.container = object2;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.title = {textAlign: 'center', marginBottom: PX_8};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.description = {textAlign: 'center', marginBottom: PX_16};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.tierCards = {'flexDirection': 'row', 'flexWrap': 'wrap', rowGap: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.tierCard = {'width': '33.33%', 'alignItems': 'center', padding: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.iconWrapper = {paddingVertical: PX_8};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/gifting/native/GiftingBadgeInfoActionSheet.tsx');
|
|
exports.default = GiftingBadgeInfoActionSheet;
|
|
function GiftingBadgeInfoActionSheet() { // fn#80469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10573:788, offset: 0x01e7c4ae, size: 555 bytes, params: 1, frame: 30
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const bottom = (UseSafeAreaInsetsNative)().bottom;
|
|
const badgeById = (require(566) /* metro dependency 566: flux */).useStateFromStores([BadgeDirectoryStore],
|
|
function() {
|
|
return BadgeDirectoryStore.getBadgeById(require(dependencyMap[10]).BadgeId.GIFTING);
|
|
});
|
|
const env0_1 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
ReactModule.useEffect(function() {
|
|
importDefault(dependencyMap[11]).track(AnalyticEvents.GIFTING_BADGE_INFO_ACTION_SHEET_OPENED);
|
|
}, []);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const items3 = [styles.container];
|
|
const PX_16 = (Native).space.PX_16;
|
|
items3[1] = {paddingBottom: bottom + PX_16};
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const items2 = [
|
|
<Text
|
|
style={styles.title}
|
|
variant="heading-xl/semibold"
|
|
color="text-strong"
|
|
accessibilityRole="header"
|
|
>
|
|
{intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */)['0MB2C6'])}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.description}
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
>
|
|
{intl.string((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).k9sNVH)}
|
|
</Text>
|
|
);
|
|
items2[2] = (
|
|
<View style={styles.tierCards}>
|
|
{badgeById == null || badgeById.tiers == null ? value2 : badgeById.tiers.map(_fun80473)}
|
|
</View>
|
|
);
|
|
return (
|
|
<BottomSheet scrollable={false} startExpanded>
|
|
<View style={items3}>
|
|
{items2}
|
|
</View>
|
|
</BottomSheet>
|
|
);
|
|
function _fun80473(a0) { // fn#80473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10573:1588, offset: 0x01e7c73e, size: 391 bytes, params: 2, frame: 26
|
|
var r13;
|
|
var r7;
|
|
var r6;
|
|
var intl;
|
|
var value;
|
|
if (useReducedMotion) {
|
|
r13 = a0.complex_icon_static_url ?? a0.simple_icon_url;
|
|
} else {
|
|
r13 = a0.complex_icon_animated_url ?? a0.complex_icon_static_url;
|
|
r13 = r13 ?? a0.simple_icon_url;
|
|
}
|
|
const singleRequirementThreshold = getSingleRequirementThreshold(a0);
|
|
const value4 = r13 != null;
|
|
if (value4) {
|
|
var viewBinding2Props = {style: styles.iconWrapper};
|
|
value = importDefault(10388) /* metro dependency 10388: GiftingBadgeIcon */;
|
|
value = (
|
|
<View {...viewBinding2Props}>
|
|
{((Component) => <Component icon={r13} size={58} />)(value)}
|
|
</View>
|
|
);
|
|
r7 = value;
|
|
} else {
|
|
r7 = value4;
|
|
}
|
|
const items2 = [r7];
|
|
const Text = (TextModule).Text;
|
|
items2[1] = (
|
|
<Text variant="text-lg/semibold" color="text-strong">
|
|
{a0.name}
|
|
</Text>
|
|
);
|
|
value = singleRequirementThreshold != null;
|
|
if (value) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r6 = (
|
|
<Text variant="text-md/normal" color="text-subtle">
|
|
{intl.formatToPlainString((importDefault(2320) /* metro dependency 2320: GiftingBadgeMessages */).qvx9E4,
|
|
|
|
{count: singleRequirementThreshold})}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
items2[2] = r6;
|
|
return (
|
|
<View style={styles.tierCard} key={a0.key}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80468, 10387, [31, 27, 4502, 7670, 661, 33, 4501, 697, 1585, 566, 7635, 683, 6275, 4573, 1244, 2320,
|
|
10388,
|
|
2]) /* metro module 10387, dependencies: [31, 27, 4502, 7670, 661, 33, 4501, 697, 1585, 566, 7635, 683, 6275, 4573, 1244, 2320, 10388, 2] */;
|