232 lines
16 KiB
TypeScript
232 lines
16 KiB
TypeScript
/* Metro module 13510; source: modules/quests/native/useQuestHomeHeader.tsx; dependencies: [31, 27, 6528, 661, 663, 33, 4501, 697, 13507, 4573, 1244, 10070, 4080, 10135, 1962, 683, 6789, 5120, 10123, 13511, 8342, 13512, 1484, 4127, 5176, 2] */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
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 CollectiblesShopConstantsModule from '../../collectibles/CollectiblesShopConstants.tsx'; /* Metro dependency 663 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as UseVirtualCurrencyMobileEnabledModule from '../../virtual_currency/hooks/native/useVirtualCurrencyMobileEnabled.tsx'; /* Metro dependency 4127 */
|
|
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 CollectiblesActionCreatorsModule from '../../collectibles/CollectiblesActionCreators.tsx'; /* Metro dependency 5120 */
|
|
import * as YouBarExperimentModule from '../../main_tabs_v2/YouBarExperiment.tsx'; /* Metro dependency 5176 */
|
|
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as BaseIconButtonNativeModule from '../../../design/components/Button/native/BaseIconButton.native.tsx'; /* Metro dependency 8342 */
|
|
import * as UseFetchVirtualCurrencyBalanceModule from '../../virtual_currency/hooks/useFetchVirtualCurrencyBalance.tsx'; /* Metro dependency 10070 */
|
|
import * as QuestsIconModule from '../../../design/components/Icon/native/redesign/generated/QuestsIcon.tsx'; /* Metro dependency 13507 */
|
|
import * as FiltersHorizontalIconModule from '../../../design/components/Icon/native/redesign/generated/FiltersHorizontalIcon.tsx'; /* Metro dependency 13512 */
|
|
|
|
function _fun102606(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:6, offset: 0x02241d5a, size: 304 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_10 = (CreateStylesModule).createStyles(_fun102607);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/useQuestHomeHeader.tsx');
|
|
exports.default = _default_102617;
|
|
function _fun102607(a0, a1) { // fn#102607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:267, offset: 0x02241e8a, size: 263 bytes, params: 3, frame: 17
|
|
const object = {};
|
|
const object2 = {'width': null, 'flexDirection': 'row', 'alignItems': 'center'};
|
|
const value = undefined;
|
|
object2.width = a1 ? '100%' : value;
|
|
let PX_8 = a0 ? (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
|
|
object2.marginTop = PX_8;
|
|
PX_8 = a1 ? (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
|
|
object2.paddingLeft = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.gap = PX_8;
|
|
object.headerTitleContainer = object2;
|
|
object.headerTitle = {flexShrink: 1};
|
|
const object4 = {'flexDirection': 'row', 'justifyContent': 'flex-end', 'alignItems': 'center'};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.gap = PX_8;
|
|
PX_8 = a0 ? (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
|
|
object4.marginTop = PX_8;
|
|
object.headerRightContainer = object4;
|
|
return object;
|
|
}
|
|
|
|
function QuestHomeHeaderTitle({youBarEnabled, leftAlignHeader}) { // fn#102608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:664, offset: 0x02241f91, size: 223 bytes, params: 2, frame: 22
|
|
const styles = useStyles(youBarEnabled, leftAlignHeader);
|
|
const QuestsIcon = (QuestsIconModule).QuestsIcon;
|
|
const questsIcon = <QuestsIcon size="md" color="icon-strong" />;
|
|
const Heading = (TextModule).Heading;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const JALI2K = (IndexNativeModule).t.JALI2K;
|
|
return (
|
|
<View style={styles.headerTitleContainer}>
|
|
{questsIcon}
|
|
<Heading
|
|
variant="redesign/heading-18/bold"
|
|
color="mobile-text-heading-primary"
|
|
maxFontSizeMultiplier={2}
|
|
lineClamp={1}
|
|
style={styles.headerTitle}
|
|
>
|
|
{Reflect.apply(string, intl, [JALI2K])}
|
|
</Heading>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function QuestHomeHeaderRight(a0) { // fn#102609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:1044, offset: 0x02242070, size: 263 bytes, params: 2, frame: 23
|
|
const youBarEnabled = a0.youBarEnabled;
|
|
const leftAlignHeader = a0.leftAlignHeader;
|
|
const isVirtualCurrencyEnabled = a0.isVirtualCurrencyEnabled;
|
|
const object = {'youBarEnabled': 0, 'leftAlignHeader': 0, 'isVirtualCurrencyEnabled': 0};
|
|
silentSetPrototypeOf(object, null, undefined);
|
|
const value = copyDataProperties({}, a0, object, undefined);
|
|
const styles = useStyles(youBarEnabled, leftAlignHeader);
|
|
const useFetchVirtualCurrencyBalance = UseFetchVirtualCurrencyBalanceModule.useFetchVirtualCurrencyBalance;
|
|
const balance = Reflect.apply(useFetchVirtualCurrencyBalance, UseFetchVirtualCurrencyBalanceModule, []).balance;
|
|
return (
|
|
<View style={styles.headerRightContainer}>
|
|
{isVirtualCurrencyEnabled && ((BalanceWidgetPillButton) => <BalanceWidgetPillButton balance={balance} onPress={ReactModule.useCallback(_fun102610,
|
|
[balance])} />)((require(10123) /* metro dependency 10123: native */).BalanceWidgetPillButton)}
|
|
<FiltersButton {...value} />
|
|
</View>
|
|
);
|
|
function _fun102610() { // fn#102610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:1198, offset: 0x02242177, size: 234 bytes, params: 1, frame: 23
|
|
const defaultImport = ActionSheetActionCreators;
|
|
const openLazy = defaultImport.openLazy;
|
|
const object = {};
|
|
object.balance = balance;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const WrzJBf = t.WrzJBf;
|
|
object.primaryButtonConfig = {buttonText: Reflect.apply(string, intl, [WrzJBf]),
|
|
onButtonPress: onButtonPress_102613};
|
|
const object3 = {};
|
|
object3.buttonText = intl.string(t['/g10LC']);
|
|
object3.onButtonPress = onButtonPress_102614;
|
|
object.secondaryButtonConfig = object3;
|
|
const QUEST_HOME_PAGE = (AnalyticsLocation).QUEST_HOME_PAGE;
|
|
object.source = QUEST_HOME_PAGE;
|
|
Reflect.apply(openLazy, defaultImport, [_fun102611, 'BalanceWidgetActionSheet', object]);
|
|
function _fun102611() { // fn#102611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:1222, offset: 0x02242261, size: 64 bytes, params: 1, frame: 13
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(dependencyMap[14]);
|
|
value = value(dependencyMap[13], dependencyMap.paths);
|
|
return value.then(function(a0) {
|
|
return a0.default;
|
|
});
|
|
}
|
|
|
|
function onButtonPress_102613() { // fn#102613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:1396, offset: 0x022422a1, size: 208 bytes, params: 1, frame: 19
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const ORB_BALANCE_ACTION_SHEET_ACTION = AnalyticEvents.ORB_BALANCE_ACTION_SHEET_ACTION;
|
|
const QUEST_HOME_PAGE = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).QUEST_HOME_PAGE;
|
|
Reflect.apply(track, defaultImport, [ORB_BALANCE_ACTION_SHEET_ACTION, {type: 'GO_TO_SHOP', source: QUEST_HOME_PAGE,
|
|
balance: balance}]);
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
const openCollectiblesShopMobile = CollectiblesActionCreatorsModule.openCollectiblesShopMobile;
|
|
object = {};
|
|
let COLLECTIBLES_SHOP = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).COLLECTIBLES_SHOP;
|
|
object.analyticsLocations = [COLLECTIBLES_SHOP];
|
|
COLLECTIBLES_SHOP = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).COLLECTIBLES_SHOP;
|
|
object.analyticsSource = COLLECTIBLES_SHOP;
|
|
const ORBS = CollectiblesMobileShopScreen.ORBS;
|
|
object.screen = ORBS;
|
|
Reflect.apply(openCollectiblesShopMobile, CollectiblesActionCreatorsModule, [object]);
|
|
}
|
|
|
|
function onButtonPress_102614() { // fn#102614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:1777, offset: 0x02242371, size: 116 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__.__proto__;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const ORB_BALANCE_ACTION_SHEET_ACTION = AnalyticEvents.ORB_BALANCE_ACTION_SHEET_ACTION;
|
|
const QUEST_HOME_PAGE = (AnalyticsLocation).QUEST_HOME_PAGE;
|
|
value = environment.__proto__;
|
|
Reflect.apply(track, defaultImport, [ORB_BALANCE_ACTION_SHEET_ACTION, {type: 'GO_BACK', source: QUEST_HOME_PAGE,
|
|
balance: balance}]);
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function FiltersButton({setSelectedSortMethod, setSelectedFilters, selectedFilters, selectedSortMethod}) { // fn#102615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:2115, offset: 0x022423e5, size: 329 bytes, params: 2, frame: 22
|
|
const selectedSortMethod2 = selectedSortMethod;
|
|
let value = selectedFilters.length > 0;
|
|
const SUGGESTED = QuestHomeSortMethods.SUGGESTED;
|
|
const r2 = value || selectedSortMethod !== SUGGESTED;
|
|
const colors = (Native).colors;
|
|
const r11 = r2 ? colors.WHITE : colors.INTERACTIVE_TEXT_DEFAULT;
|
|
const r5 = r2 ? 'primary' : 'tertiary';
|
|
value = selectedSortMethod2.useCallback(_fun102616, [setSelectedSortMethod, setSelectedFilters, selectedFilters,
|
|
selectedSortMethod]);
|
|
const BaseIconButton = (BaseIconButtonNativeModule).BaseIconButton;
|
|
object = {};
|
|
const FiltersHorizontalIcon = (FiltersHorizontalIconModule).FiltersHorizontalIcon;
|
|
object.icon = <FiltersHorizontalIcon size="sm" color={r11} />;
|
|
object.size = 'sm';
|
|
object.variant = r5;
|
|
object.onPress = value;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const UdhTtk = (IndexNativeModule).t.UdhTtk;
|
|
object.accessibilityLabel = Reflect.apply(string, intl, [UdhTtk]);
|
|
object.scaleAmountInPx = 4;
|
|
return <BaseIconButton {...object} />;
|
|
function _fun102616() { // fn#102616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:2354, offset: 0x0224252e, size: 121 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[12]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[14]);
|
|
value = value(dependencyMap[19], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'QuestHomeSortingFilteringBottomSheet',
|
|
{onSortMethodChange: setSelectedSortMethod, onFiltersChange: setSelectedFilters,
|
|
initialSortMethod: selectedSortMethod, initialFilters: selectedFilters}]);
|
|
}
|
|
|
|
}
|
|
|
|
function _default_102617({setSelectedSortMethod, setSelectedFilters, selectedFilters, selectedSortMethod}) { // fn#102617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:2744, offset: 0x022425a7, size: 203 bytes, params: 2, frame: 21
|
|
const selectedSortMethod2 = selectedSortMethod;
|
|
const value2 = (UseNavigationNativeModule).useNavigation();
|
|
const useVirtualCurrencyMobileEnabled = UseVirtualCurrencyMobileEnabledModule.useVirtualCurrencyMobileEnabled;
|
|
selectedSortMethod2.useLayoutEffect(_fun102618, [value2,
|
|
(YouBarExperimentModule).useYouBarEnabled('QuestHome'),
|
|
Reflect.apply(useVirtualCurrencyMobileEnabled, UseVirtualCurrencyMobileEnabledModule, []).enabled,
|
|
setSelectedSortMethod, setSelectedFilters, selectedFilters, selectedSortMethod]);
|
|
function _fun102618() { // fn#102618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:2978, offset: 0x02242672, size: 65 bytes, params: 1, frame: 13
|
|
const env0_0 = enabled || ConstantsModule.AnalyticEvents;
|
|
ReactNativeModule.View.setOptions({headerTitle: headerTitle_102619, headerRight: headerRight_102620});
|
|
function headerTitle_102619() { // fn#102619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:3020, offset: 0x022426b3, size: 47 bytes, params: 1, frame: 13
|
|
return <QuestHomeHeaderTitle youBarEnabled={env1_6} leftAlignHeader={env0_0} />;
|
|
}
|
|
|
|
function headerRight_102620() { // fn#102620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13700:3096, offset: 0x022426e2, size: 92 bytes, params: 1, frame: 14
|
|
return (
|
|
<QuestHomeHeaderRight
|
|
youBarEnabled={env1_6}
|
|
leftAlignHeader={env0_0}
|
|
isVirtualCurrencyEnabled={enabled}
|
|
setSelectedSortMethod={setSelectedSortMethod}
|
|
setSelectedFilters={setSelectedFilters}
|
|
selectedFilters={selectedFilters}
|
|
selectedSortMethod={selectedSortMethod}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102606, 13510, [31, 27, 6528, 661, 663, 33, 4501, 697, 13507, 4573, 1244, 10070, 4080, 10135, 1962,
|
|
683, 6789, 5120, 10123, 13511, 8342, 13512, 1484, 4127, 5176,
|
|
2]) /* metro module 13510, dependencies: [31, 27, 6528, 661, 663, 33, 4501, 697, 13507, 4573, 1244, 10070, 4080, 10135, 1962, 683, 6789, 5120, 10123, 13511, 8342, 13512, 1484, 4127, 5176, 2] */;
|