// Metro module 14634 (f14635). import { useMemo, useCallback, useLayoutEffect } from "react"; import { View } from "react-native"; import UserStore from "../../../stores/UserStore"; import { CollectiblesMobileShopScreen } from "../CollectiblesShopConstants"; import { AnalyticEvents } from "../../../Constants"; import { RewardFilterTypes } from "../../quests/QuestConstants"; import { UserProfileSections } from "../../user_profile/Constants"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import { ShopIcon } from "../../../design/components/Icon/native/redesign/generated/ShopIcon"; import { Heading } from "../../../design/components/Text/native/Text"; import { intl, t } from "../../../intl/index.native"; import { useStateFromStores } from "../../../_bundle/Module589"; import { useFetchVirtualCurrencyBalance } from "../../virtual_currency/hooks/useFetchVirtualCurrencyBalance"; import { openCollectiblesShopMobile } from "../CollectiblesActionCreators"; import AnalyticsLocation from "../../app_analytics/AnalyticsLocation"; import { CheckmarkSmallIcon } from "../../../design/components/Icon/native/redesign/generated/CheckmarkSmallIcon"; import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators"; import AnalyticsUtils from "../../../utils/AnalyticsUtils"; import { openQuestHome } from "../../quests/native/QuestUtils.native"; import { QuestContent } from "../../quests/QuestTypes"; import ModalActionCreators from "../../../actions/ModalActionCreators"; import showUserProfileActionSheet from "../../user_profile/native/showUserProfileActionSheet"; import { BalanceWidgetPillButton } from "../../virtual_currency/native/index"; import { IconButton } from "../../../design/components/Button/native/IconButton.native"; import { HeartIcon } from "../../../design/components/Icon/native/redesign/generated/HeartIcon"; import { ContextMenu } from "../../../design/components/ContextMenu/native/ContextMenu.native"; import { MenuIcon } from "../../../design/components/Icon/native/redesign/generated/MenuIcon"; import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native"; let useStyles, CollectiblesShopHeaderRight; const CollectiblesShopHeaderTitle = function CollectiblesShopHeaderTitle(props) { const currentScreen3 = props.currentScreen; const styles = useStyles(); return {currentScreen3 === CollectiblesMobileShopScreen.ORBS ? intl.string(t.ElYQFS) : intl.string(t.pWG4ze)} ; }; CollectiblesShopHeaderRight = function CollectiblesShopHeaderRight(props) { let balance; const currentScreen = props.currentScreen; balance = void 0; const styles = useStyles(); const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), []); balance = useFetchVirtualCurrencyBalance().balance; const memo = useMemo(() => [{ label: intl.string(t["xNiB/O"]), action: () => { openCollectiblesShopMobile({ analyticsLocations: [AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_FEATURED_PAGE_MENU_ITEM], analyticsSource: AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_FEATURED_PAGE_MENU_ITEM, screen: CollectiblesMobileShopScreen.FEATURED_PAGE }); }, trailingIndicator: currentScreen === CollectiblesMobileShopScreen.FEATURED_PAGE ? CheckmarkSmallIcon : void 0 }, { label: intl.string(t.RSyoZu), action: () => { openCollectiblesShopMobile({ analyticsLocations: [AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_SHOP_ALL_MENU_ITEM], analyticsSource: AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_SHOP_ALL_MENU_ITEM, screen: CollectiblesMobileShopScreen.SHOP_ALL }); }, trailingIndicator: currentScreen === CollectiblesMobileShopScreen.SHOP_ALL ? CheckmarkSmallIcon : void 0 }, { label: intl.string(t.EBYkzk), action: () => { openCollectiblesShopMobile({ analyticsLocations: [AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_ORBS_MENU_ITEM], analyticsSource: AnalyticsLocation.COLLECTIBLES_SHOP_MOBILE_ORBS_MENU_ITEM, screen: CollectiblesMobileShopScreen.ORBS }); }, trailingIndicator: currentScreen === CollectiblesMobileShopScreen.ORBS ? CheckmarkSmallIcon : void 0 }], [currentScreen]); const callback = useCallback(() => { ActionSheetActionCreators.openLazy(() => import("../../virtual_currency/native/BalanceWidgetActionSheet").then((result) => result.default), "BalanceWidgetActionSheet", { balance, primaryButtonConfig: { buttonText: intl.string(t.SymzJC), onButtonPress: () => { AnalyticsUtils.track(AnalyticEvents.ORB_BALANCE_ACTION_SHEET_ACTION, { type: "GO_TO_QUEST_HOME", source: AnalyticsLocation.COLLECTIBLES_SHOP, balance }); ActionSheetActionCreators.hideActionSheet(); openQuestHome({ mergeExistingRoutes: true, filter: RewardFilterTypes.VIRTUAL_CURRENCY, fromContent: QuestContent.ORBS_BALANCE_MENU }); } }, secondaryButtonConfig: { buttonText: intl.string(t["/g10LC"]), onButtonPress: () => { AnalyticsUtils.track(AnalyticEvents.ORB_BALANCE_ACTION_SHEET_ACTION, { type: "GO_BACK", source: AnalyticsLocation.COLLECTIBLES_SHOP, balance }); ActionSheetActionCreators.hideActionSheet(); } }, source: AnalyticsLocation.COLLECTIBLES_SHOP }); }, [balance]); const callback2 = useCallback(() => { if (stateFromStores?.id != null) { AnalyticsUtils.track(AnalyticEvents.COLLECTIBLES_SHOP_ELEMENT_CLICKED, { cta_name: "wishlist header button", page_type: currentScreen }); ModalActionCreators.popAll(); showUserProfileActionSheet({ userId: stateFromStores.id, sourceAnalyticsLocations: [AnalyticsLocation.COLLECTIBLES_SHOP], initialSection: UserProfileSections.WISHLIST }); } }, [currentScreen, stateFromStores?.id]); return {stateFromStores != null && } onPress={callback2} />} {(a0) => { const { ref, ...rest } = a0; return } />; }} ; }; useStyles = createStyles({ headerTitleContainer: { width: "100%", flexDirection: "row", alignItems: "center", marginTop: Module712.space.PX_8, paddingLeft: Module712.space.PX_8, gap: Module712.space.PX_8 }, headerTitle: { flexShrink: 1 }, headerRightContainer: { flexDirection: "row", justifyContent: "flex-end", alignItems: "center", gap: Module712.space.PX_8, marginTop: Module712.space.PX_8 } }); export default function useCollectiblesShopHeader(r3 = {}) { const currentScreen2 = r3.currentScreen; const navigation = useNavigation(); useLayoutEffect(() => { navigation.setOptions({ headerTitle: () => , headerRight: () => }); }, [navigation, currentScreen2]); };