247 lines
17 KiB
TypeScript
247 lines
17 KiB
TypeScript
/* Metro module 13562; source: modules/quests/native/BountiesCtaHeader.tsx; dependencies: [31, 27, 4502, 13563, 6528, 33, 4501, 697, 1244, 4573, 13557, 6766, 566, 7121, 9529, 6531, 7110, 7120, 13515, 13564, 13565, 1305, 4578, 13561, 9949, 3868, 13551, 10183, 2] */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import BountiesModalActionCreators from './BountiesModal/BountiesModalActionCreators.tsx'; /* Metro dependency 13515 */
|
|
import OpenBountiesNuxPromoSheet from './openBountiesNuxPromoSheet.tsx'; /* Metro dependency 13557 */
|
|
import UseIsCarouselInView from './useIsCarouselInView.tsx'; /* Metro dependency 13561 */
|
|
import AdContentSeenStore from '../AdContentSeenStore.tsx'; /* Metro dependency 13563 */
|
|
import BountiesBannerBackground from './BountiesBannerBackground.tsx'; /* Metro dependency 13564 */
|
|
import Bounty_bannerMp4 from '../../../external/discord_assets/assets/quests/bounties/bounty_banner.mp4.js'; /* Metro dependency 13565 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
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 QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
|
|
import * as AnalyticsActionsModule from '../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */
|
|
import * as AnalyticsTypesModule from '../lib/analytics/AnalyticsTypes.tsx'; /* Metro dependency 7120 */
|
|
import * as AdCreativeTypeModule from '../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */
|
|
import * as UseVideoModalPlacementEnabledModule from '../hooks/useVideoModalPlacementEnabled.tsx'; /* Metro dependency 9529 */
|
|
import * as ThemeTypesModule from '../../../external/discord_common/js/packages/design/shared/ThemeTypes.tsx'; /* Metro dependency 13551 */
|
|
|
|
function _fun103039(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:6, offset: 0x02254a75, size: 307 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
ReactNativeModule.StyleSheet;
|
|
const env0_11 = (CreateStylesModule).createStyles(_fun103046);
|
|
value = value.memo(BountiesCtaHeader);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/BountiesCtaHeader.tsx');
|
|
exports.default = value;
|
|
function BountiesCtaDescription({isEmptyOrCompleted}) { // fn#103040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:1628, offset: 0x02254ba8, size: 379 bytes, params: 2, frame: 23
|
|
const styles = useStyles();
|
|
const t = (IndexNativeModule).t;
|
|
const r13 = isEmptyOrCompleted ? t.q4wlOE : t.AZGGo1;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const text = (
|
|
<Text variant="text-sm/medium" color="text-subtle">
|
|
{intl.string(r13)}
|
|
</Text>
|
|
);
|
|
const value3 = intl.format((IndexNativeModule).t.fjSvsC,
|
|
{onClick: OpenBountiesNuxPromoSheet});
|
|
if (isEmptyOrCompleted) {
|
|
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
return (
|
|
<TextWithIOSLinkWorkaround variant="text-sm/medium">
|
|
{text}
|
|
{' '}
|
|
{value3}
|
|
</TextWithIOSLinkWorkaround>
|
|
);
|
|
} else {
|
|
return (
|
|
<View style={styles.description}>
|
|
{text}
|
|
{((TextWithIOSLinkWorkaround) => <TextWithIOSLinkWorkaround variant="text-sm/medium">{value3}</TextWithIOSLinkWorkaround>)((require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround)}
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
function BountiesCtaHeaderInner({bounties, isEmptyOrCompleted, containerRef}) { // fn#103041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:2097, offset: 0x02254d23, size: 750 bytes, params: 2, frame: 32
|
|
isEmptyOrCompleted = !(isEmptyOrCompleted === undefined) && isEmptyOrCompleted;
|
|
const styles = useStyles();
|
|
(require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AdContentSeenStore], function() {
|
|
return bounties.some(_fun103044);
|
|
}, [bounties]);
|
|
const value3 = (UseVideoModalPlacementEnabledModule).useVideoModalPlacementEnabled('BountiesCtaHeader');
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
const value4 = env0_3.useCallback(_fun103045, [bounties,
|
|
value3 ? QuestContent.VIDEO_MODAL_MOBILE : QuestContent.QUEST_HOME_MOBILE_CAROUSEL]);
|
|
const bountiesBannerBackgroundProps = {uri: Bounty_bannerMp4,
|
|
style: [styles.header, styles.headerRoundedBottom]};
|
|
const r8 = value2 && ((NewTag) => <NewTag variant="text-xs/bold" containerStyle={styles.newPill} textStyle={styles.newPillText} />)((require(1305) /* metro dependency 1305: native */).NewTag);
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const items4 = [
|
|
<Text variant="text-lg/semibold" color="white">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.qetVDw)}
|
|
</Text>,
|
|
];
|
|
items4[1] = <BountiesCtaDescription isEmptyOrCompleted={isEmptyOrCompleted} />;
|
|
items4[2] = !isEmptyOrCompleted && ((Button) => <Button grow size="md" variant="primary-overlay" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1kkbKw'])} onPress={value4} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button);
|
|
return (
|
|
<View ref={containerRef} style={styles.container}>
|
|
<BountiesBannerBackground {...bountiesBannerBackgroundProps}>
|
|
{r8}
|
|
<View style={styles.headerTextBox}>
|
|
{items4}
|
|
</View>
|
|
</BountiesBannerBackground>
|
|
{false}
|
|
</View>
|
|
);
|
|
function _fun103043() { // fn#103043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:2286, offset: 0x02255011, size: 29 bytes, params: 1, frame: 11
|
|
return bounties.some(function(a0) {
|
|
var adContentSeenStoreBinding = AdContentSeenStore;
|
|
var BOUNTY = require(dependencyMap[13]).AdCreativeType.BOUNTY;
|
|
return !adContentSeenStoreBinding.hasSeen(BOUNTY, a0.id);
|
|
});
|
|
function _fun103044({id}) { // fn#103044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:2298, offset: 0x0225502e, size: 66 bytes, params: 2, frame: 14
|
|
const adContentSeenStoreBinding = AdContentSeenStore;
|
|
const hasSeen = adContentSeenStoreBinding.hasSeen;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const BOUNTY = AdCreativeType.BOUNTY;
|
|
return !Reflect.apply(hasSeen, adContentSeenStoreBinding, [BOUNTY, id]);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103045() { // fn#103045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:2527, offset: 0x02255070, size: 228 bytes, params: 1, frame: 20
|
|
const property = bounties[0];
|
|
const trackAdContentClicked = AnalyticsActionsModule.trackAdContentClicked;
|
|
const object = {};
|
|
object.adContentId = DEFAULT_PLACEHOLDER_ENTRYPOINT_BOUNTY_ID;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const BOUNTY = AdCreativeType.BOUNTY;
|
|
object.adCreativeType = BOUNTY;
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
let QUEST_HOME_ENTRYPOINT_MOBILE = QuestContent.QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
object.questContent = QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
|
|
const START_BOUNTY = QuestContentCTA.START_BOUNTY;
|
|
object.questContentCTA = START_BOUNTY;
|
|
QUEST_HOME_ENTRYPOINT_MOBILE = QuestContent.QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
object.sourceQuestContent = QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
object.questContentPosition = 0;
|
|
Reflect.apply(trackAdContentClicked, AnalyticsActionsModule, [object]);
|
|
(BountiesModalActionCreators).showModal({bountyId: property.id,
|
|
sourceQuestContent: env0_1});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103046() { // fn#103046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:301, offset: 0x02255154, size: 719 bytes, params: 1, frame: 16
|
|
const object = {};
|
|
const object2 = {'width': '100%', 'backgroundColor': null, 'borderWidth': 1};
|
|
let BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
const BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
|
|
object2.borderColor = BORDER_MUTED;
|
|
object2.borderBottomLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
|
|
object2.borderBottomRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
|
|
object2.overflow = 'hidden';
|
|
object.container = object2;
|
|
BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.header = {'width': '100%', 'minHeight': 296, 'justifyContent': 'flex-end', 'overflow': 'hidden',
|
|
backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
const object4 = {};
|
|
object4.borderBottomLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
|
|
object4.borderBottomRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
|
|
object.headerRoundedBottom = object4;
|
|
const object5 = {position: 'absolute'};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.top = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.left = PX_12;
|
|
object5.zIndex = 1;
|
|
const CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object5.backgroundColor = CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.paddingHorizontal = PX_8;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object5.paddingVertical = PX_4;
|
|
object.newPill = object5;
|
|
const CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
|
|
object.newPillText = {color: CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT};
|
|
const object7 = {};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object7.paddingBottom = PX_24;
|
|
const PX_20 = (importDefault(697) /* metro dependency 697: native */).space.PX_20;
|
|
object7.paddingHorizontal = PX_20;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object7.gap = PX_8;
|
|
object.headerTextBox = object7;
|
|
object.description = {marginBottom: 16};
|
|
const object9 = {'width': '100%', 'overflow': 'hidden'};
|
|
object9.borderBottomLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object9.borderBottomRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object.bottomSection = object9;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.bottomContent = {'paddingBottom': 24, 'paddingHorizontal': 20, gap: PX_12};
|
|
const object11 = {'alignSelf': 'stretch', 'height': 160};
|
|
object11.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object11.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object.placeholderCards = object11;
|
|
return object;
|
|
}
|
|
|
|
function BountiesCtaHeader(a0) { // fn#103047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:3476, offset: 0x02255423, size: 406 bytes, params: 2, frame: 25
|
|
var QuestContentImpressionTrackerNative;
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
var QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
const env0_0 = a0;
|
|
const {containerRef, isInView} = (UseIsCarouselInView)();
|
|
const bounties = a0.bounties;
|
|
const isEmptyOrCompleted = a0.isEmptyOrCompleted;
|
|
let r4 = isEmptyOrCompleted !== undefined && isEmptyOrCompleted;
|
|
(require(9949) /* metro dependency 9949: AnalyticsHooks */).useBountyCarouselEmptyStateAnalytics(r4 ? bounties.length === 0 ? BountyCarouselEmptyStateReason.EMPTY : BountyCarouselEmptyStateReason.COMPLETED : null);
|
|
const ThemeContextProvider = (NativeModule).ThemeContextProvider;
|
|
const ThemeTypes = (ThemeTypesModule).ThemeTypes;
|
|
const DARKER = ThemeTypes.DARKER;
|
|
if (r4) {
|
|
r4 = <BountiesCtaHeaderInner {...a0} {...{['containerRef']: containerRef}} />;
|
|
} else {
|
|
QuestContentImpressionTrackerNative = (require(10183) /* metro dependency 10183: QuestContentImpressionTrackerNative */).QuestContentImpressionTrackerNative;
|
|
var questContentImpressionTrackerNativeProps = {adContentId: DEFAULT_PLACEHOLDER_ENTRYPOINT_BOUNTY_ID,
|
|
adCreativeType: (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.BOUNTY};
|
|
QUEST_HOME_ENTRYPOINT_MOBILE = QuestContent.QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
questContentImpressionTrackerNativeProps.questContent = QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
questContentImpressionTrackerNativeProps.questContentPosition = 0;
|
|
questContentImpressionTrackerNativeProps.overrideVisibility = isInView;
|
|
QUEST_HOME_ENTRYPOINT_MOBILE = QuestContent.QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
questContentImpressionTrackerNativeProps.sourceQuestContent = QUEST_HOME_ENTRYPOINT_MOBILE;
|
|
r4 = (
|
|
<QuestContentImpressionTrackerNative {...questContentImpressionTrackerNativeProps}>
|
|
{children_103048}
|
|
</QuestContentImpressionTrackerNative>
|
|
);
|
|
}
|
|
return (
|
|
<ThemeContextProvider theme={DARKER}>
|
|
{r4}
|
|
</ThemeContextProvider>
|
|
);
|
|
function BountiesCtaHeaderChildren() { // fn#103048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13752:4123, owner: BountiesCtaHeader.children, offset: 0x022555b9, size: 50 bytes, params: 1, frame: 14
|
|
return <BountiesCtaHeaderInner {...env0_0} {...{['containerRef']: containerRef}} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103039, 13562, [31, 27, 4502, 13563, 6528, 33, 4501, 697, 1244, 4573, 13557, 6766, 566, 7121, 9529,
|
|
6531, 7110, 7120, 13515, 13564, 13565, 1305, 4578, 13561, 9949, 3868, 13551, 10183,
|
|
2]) /* metro module 13562, dependencies: [31, 27, 4502, 13563, 6528, 33, 4501, 697, 1244, 4573, 13557, 6766, 566, 7121, 9529, 6531, 7110, 7120, 13515, 13564, 13565, 1305, 4578, 13561, 9949, 3868, 13551, 10183, 2] */;
|