88 lines
5.2 KiB
TypeScript
88 lines
5.2 KiB
TypeScript
/* Metro module 12186; source: modules/premium/native/PremiumPerkCarousel.tsx; dependencies: [57, 31, 27, 33, 4501, 7562, 4573, 7939, 1305, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import PremiumPerkCard from './PremiumPerkCard.tsx'; /* Metro dependency 7562 */
|
|
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 CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as PremiumPerkCardModule from './PremiumPerkCard.tsx'; /* Metro dependency 7562 */
|
|
|
|
function _fun93367(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12372:6, offset: 0x020b13bd, size: 288 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_8 = (CreateStylesModule).createStyles({title: {marginLeft: 24},
|
|
indicators: {marginBottom: -36}, carousel: {marginTop: 16}, carouselCard: {marginLeft: 8},
|
|
lastCarouselCard: {marginRight: 8}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/PremiumPerkCarousel.tsx');
|
|
exports.default = PremiumPerkCarousel;
|
|
function PremiumPerkCarousel({title, perks, style, onItemChange}) { // fn#93368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12372:411, offset: 0x020b14dd, size: 518 bytes, params: 2, frame: 29
|
|
const styles = useStyles();
|
|
const usePerkCardHeight = PremiumPerkCardModule.usePerkCardHeight;
|
|
const PerkCardVariant = PremiumPerkCardModule.PerkCardVariant;
|
|
let NARROW = PerkCardVariant.NARROW;
|
|
const value2 = Reflect.apply(usePerkCardHeight, PremiumPerkCardModule, [NARROW]);
|
|
const binding = length;
|
|
const [property, env0_3] = env0_3Binding(binding.useState(0), 2);
|
|
const value5 = binding.useCallback(_fun93369, [property, onItemChange]);
|
|
const PERK_CARD_SIZES = PremiumPerkCardModule.PERK_CARD_SIZES;
|
|
NARROW = PerkCardVariant.NARROW;
|
|
const width = PERK_CARD_SIZES[NARROW].width;
|
|
var length = perks.length;
|
|
const Text = (TextModule).Text;
|
|
const items2 = [
|
|
<Text
|
|
style={styles.title}
|
|
variant="heading-xl/extrabold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{title}
|
|
</Text>,
|
|
];
|
|
items2[1] = ((Component) => <Component style={[styles.carousel,
|
|
{height: value2 + 8}]} width={width} onPageChange={value5} pageIndictor={false} scrollViewProps={{'overScrollMode': 'always',
|
|
'snapToInterval': null, 'snapToStart': true, 'snapToAlignment': 'start', 'decelerationRate': 'normal',
|
|
snapToInterval: width + 8 + 0.2}}>{perks.map(_fun93370)}</Component>)(importDefault(7939) /* metro dependency 7939: Carousel */);
|
|
const CarouselPagination = (NativeModule).CarouselPagination;
|
|
items2[2] = (
|
|
<CarouselPagination
|
|
containerStyle={styles.indicators}
|
|
numberOfItems={perks.length}
|
|
currentIndex={property}
|
|
/>
|
|
);
|
|
return (
|
|
<View style={style}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun93369(a0) { // fn#93369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12372:608, offset: 0x020b16e3, size: 48 bytes, params: 2, frame: 13
|
|
if (a0 !== env0_2) {
|
|
env0_3(a0);
|
|
if (onItemChange != null) {
|
|
onItemChange(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun93370(a0, a1) { // fn#93370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12372:1091, offset: 0x020b1713, size: 148 bytes, params: 3, frame: 20
|
|
const items2 = [styles.carouselCard];
|
|
items2[1] = length - 1 !== a1 ? null : styles.lastCarouselCard;
|
|
const defaultImportProps = {...a0};
|
|
const PerkCardVariant = (PremiumPerkCardModule).PerkCardVariant;
|
|
const NARROW = PerkCardVariant.NARROW;
|
|
defaultImportProps['variant'] = NARROW;
|
|
defaultImportProps['style'] = items2;
|
|
return <PremiumPerkCard {...defaultImportProps} key={a1} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun93367, 12186, [57, 31, 27, 33, 4501, 7562, 4573, 7939, 1305,
|
|
2]) /* metro module 12186, dependencies: [57, 31, 27, 33, 4501, 7562, 4573, 7939, 1305, 2] */;
|