255 lines
16 KiB
TypeScript
255 lines
16 KiB
TypeScript
/* Metro module 13214; source: modules/user_profile/native/EditProfileEffectActionSheet.tsx; dependencies: [57, 31, 27, 5145, 5127, 661, 33, 4501, 697, 8490, 7326, 6771, 6789, 683, 7613, 8400, 6275, 4573, 1244, 8404, 7675, 566, 13215, 8402, 8491, 13216, 8414, 8415, 8409, 8405, 8488, 4589, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import CollectiblesPurchaseStore from '../../collectibles/CollectiblesPurchaseStore.tsx'; /* Metro dependency 5145 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import EditCollectiblesCTAButton from './EditCollectiblesCTAButton.tsx'; /* Metro dependency 8404 */
|
|
import UseCollectiblesData from '../../collectibles/hooks/useCollectiblesData.tsx'; /* Metro dependency 8405 */
|
|
import EditCollectiblesPreviewDetails from './EditCollectiblesPreviewDetails.tsx'; /* Metro dependency 8414 */
|
|
import ProfileEffectUserPreview from '../../collectibles/profile_effects/native/previews/ProfileEffectUserPreview.tsx'; /* Metro dependency 8488 */
|
|
import UseDisplayProfile from '../hooks/useDisplayProfile.tsx'; /* Metro dependency 8490 */
|
|
import UseProfileEffectSections from '../../collectibles/profile_effects/useProfileEffectSections.tsx'; /* Metro dependency 13215 */
|
|
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 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 ProfileEffectRecordModule from '../../collectibles/records/ProfileEffectRecord.tsx'; /* Metro dependency 5127 */
|
|
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import * as UseBottomSheetRefModule from '../../../design/components/Sheet/native/useBottomSheetRef.tsx'; /* Metro dependency 7326 */
|
|
import * as UseFetchCollectiblesCategoriesAndPurchasesModule from '../../collectibles/hooks/useFetchCollectiblesCategoriesAndPurchases.tsx'; /* Metro dependency 7675 */
|
|
import * as UseCollectibleListLayoutModule from '../../collectibles/native/useCollectibleListLayout.tsx'; /* Metro dependency 8409 */
|
|
import * as EditCollectiblesPickerListModule from '../../collectibles/native/EditCollectiblesPickerList.tsx'; /* Metro dependency 8415 */
|
|
import * as EditProfileEffectSectionModule from '../../collectibles/profile_effects/native/EditProfileEffectSection.tsx'; /* Metro dependency 13216 */
|
|
|
|
function _fun100806(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:6, offset: 0x021fa056, size: 497 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.View;
|
|
const StyleSheet = value.StyleSheet;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
const env0_11 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
let MOBILE_ACTIONSHEET_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ACTIONSHEET_BACKGROUND;
|
|
object.container = {flex: 1, backgroundColor: MOBILE_ACTIONSHEET_BACKGROUND};
|
|
object.bounceOffset = {'position': 'absolute', 'top': -250, 'height': 250, 'right': 0, 'left': 0};
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object.title = {'alignSelf': 'center', 'color': null, 'margin': 25, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
object.previewContainer = {'overflow': 'hidden', 'height': 300, 'alignItems': 'center'};
|
|
const object4 = {};
|
|
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
|
|
object4['bottom'] = -1;
|
|
MOBILE_ACTIONSHEET_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ACTIONSHEET_BACKGROUND;
|
|
object4['color'] = MOBILE_ACTIONSHEET_BACKGROUND;
|
|
object.previewGradient = object4;
|
|
const env0_12 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/EditProfileEffectActionSheet.tsx');
|
|
exports.default = EditProfileEffectActionSheet;
|
|
function EditProfileEffectInner({user, selectedProfileEffect, setSelectedProfileEffect, guildId, isTryItOut}) { // fn#100807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:717, offset: 0x021fa247, size: 689 bytes, params: 2, frame: 29
|
|
isTryItOut = !(isTryItOut === undefined) && isTryItOut;
|
|
(UseFetchCollectiblesCategoriesAndPurchasesModule).useGetOrFetchCollectiblesCategoriesAndPurchases();
|
|
const isFetching = (require(566) /* metro dependency 566: flux */).useStateFromStores([CollectiblesPurchaseStore],
|
|
function() {
|
|
return CollectiblesPurchaseStore.isFetching;
|
|
});
|
|
const value4 = (UseProfileEffectSections)();
|
|
const value5 = (UseDisplayProfile)(user.id, guildId);
|
|
const profilePreviewValue = (require(8402) /* metro dependency 8402: ProfileCustomizationUtils */).getProfilePreviewValue({pendingValue: selectedProfileEffect,
|
|
userValue: value5 == null || value5._userProfile == null ? undefined : value5._userProfile.profileEffect,
|
|
guildValue: value5 == null || value5._guildMemberProfile == null ? undefined : value5._guildMemberProfile.profileEffect,
|
|
guildId: guildId});
|
|
ReactModule.useEffect(_fun100809, [user]);
|
|
const value7 = ReactModule.useCallback(_fun100810, [setSelectedProfileEffect, guildId, isTryItOut]);
|
|
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
|
|
let skuId = profilePreviewValue?.skuId;
|
|
const items2 = [
|
|
<ProfileEffectSectionPreview
|
|
previewSkuId={skuId}
|
|
user={user}
|
|
guildId={guildId}
|
|
/>,
|
|
];
|
|
const defaultImport2Props = {user: user, previewSkuId: profilePreviewValue?.skuId};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
defaultImport2Props.nitroJoinCTA = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pertpd);
|
|
defaultImport2Props.nitroUpgradeCTA = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5eotIZ']);
|
|
items2[1] = <EditCollectiblesPreviewDetails {...defaultImport2Props} />;
|
|
const EditCollectiblesPickerList = (EditCollectiblesPickerListModule).EditCollectiblesPickerList;
|
|
skuId = selectedProfileEffect?.skuId;
|
|
const COLLECTIBLE_ROW_HEIGHT = (UseCollectibleListLayoutModule).COLLECTIBLE_ROW_HEIGHT;
|
|
items2[2] = (
|
|
<EditCollectiblesPickerList
|
|
sections={value4}
|
|
selectedSkuId={skuId}
|
|
renderRow={value7}
|
|
estimatedItemSize={COLLECTIBLE_ROW_HEIGHT}
|
|
isFetching={isFetching}
|
|
/>
|
|
);
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
function _fun100809() { // fn#100809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:1180, offset: 0x021fa4f8, size: 107 bytes, params: 1, frame: 17
|
|
var value3;
|
|
var defaultImport;
|
|
if (!(user == null || user.isNonUserBot())) {
|
|
value3 = environment.__proto__;
|
|
defaultImport = importDefault(8491) /* metro dependency 8491: maybeFetchUserProfile */;
|
|
userBinding = user;
|
|
defaultImport(userBinding.id, userBinding.getAvatarURL(null, 80), {'withMutualGuilds': true,
|
|
'dispatchWait': true});
|
|
}
|
|
}
|
|
|
|
function _fun100810({items, size, selectedSkuId}) { // fn#100810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:1317, offset: 0x021fa563, size: 108 bytes, params: 2, frame: 16
|
|
const EditProfileEffectRow = (EditProfileEffectSectionModule).EditProfileEffectRow;
|
|
return (
|
|
<EditProfileEffectRow
|
|
items={items}
|
|
size={size}
|
|
selectedSkuId={selectedSkuId}
|
|
setSelectedProfileEffect={setSelectedProfileEffect}
|
|
guildId={guildId}
|
|
isTryItOut={isTryItOut}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function ProfileEffectSectionPreview({previewSkuId, user, guildId}) { // fn#100811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:1952, offset: 0x021fa5cf, size: 329 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
let value2 = (UseCollectiblesData)(previewSkuId);
|
|
let value3 = ReactModule.useMemo(function() {
|
|
var r1;
|
|
var productBinding = product;
|
|
var value2 = null;
|
|
var value3 = undefined;
|
|
r1 = value2 == productBinding ? value3 : product.items[0];
|
|
r1 = value2 == r1 ? value2 == purchase ? value3 : purchase.items[0] : r1;
|
|
return isProfileEffectRecord(r1) ? r1 : value2;
|
|
}, [value2.purchase, value2.product]);
|
|
let value = ProfileEffectUserPreview;
|
|
value = ((Component) => <Component user={user} guildId={guildId} profileEffect={value3} maxWidth={250} />)(value);
|
|
const items2 = [value];
|
|
items2[1] = ((Component) => <Component style={styles.previewGradient} start={{'x': 0, 'y': 0.6}} end={{'x': 0,
|
|
'y': 1}} colors={['' + styles.previewGradient.color + '00',
|
|
styles.previewGradient.color]} />)(importDefault(4589) /* metro dependency 4589 */);
|
|
return (
|
|
<View style={styles.previewContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function EditProfileEffectActionSheet({user, currentProfileEffect, guildId, isTryItOut}) { // fn#100813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:2403, offset: 0x021fa718, size: 733 bytes, params: 2, frame: 38
|
|
const env0_3 = undefined;
|
|
const env0_4 = undefined;
|
|
const styles = useStyles();
|
|
const value4 = (importDefault(8490) /* metro dependency 8490: useDisplayProfile */)(user.id ?? '');
|
|
const binding = env0_4;
|
|
const [property, property2] = env0_3(binding.useState(currentProfileEffect), 2);
|
|
const useBottomSheetRef = UseBottomSheetRefModule.useBottomSheetRef;
|
|
const bottomSheetRef = Reflect.apply(useBottomSheetRef, UseBottomSheetRefModule, []).bottomSheetRef;
|
|
const defaultImport2 = UseAnalyticsLocations;
|
|
let EDIT_PROFILE_EFFECT_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EDIT_PROFILE_EFFECT_SHEET;
|
|
const analyticsLocations = defaultImport2(EDIT_PROFILE_EFFECT_SHEET).analyticsLocations;
|
|
const value8 = binding.useCallback(_fun100815, [binding.useMemo(_fun100814, [guildId, value4])]);
|
|
const value9 = binding.useCallback(_fun100816, [property, guildId, isTryItOut]);
|
|
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const view = <View style={styles.bounceOffset} />;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const view2 = (
|
|
<View style={styles.container}>
|
|
{view}
|
|
<Text
|
|
variant="redesign/heading-18/bold"
|
|
style={styles.title}
|
|
accessibilityRole="header"
|
|
>
|
|
{intl.string((IndexNativeModule).t['/6nv6N'])}
|
|
</Text>
|
|
<EditProfileEffectInner
|
|
user={user}
|
|
selectedProfileEffect={property}
|
|
setSelectedProfileEffect={property2}
|
|
guildId={guildId}
|
|
isTryItOut={isTryItOut}
|
|
/>
|
|
</View>
|
|
);
|
|
const defaultImport3Props = {user: user, currentSkuId: currentProfileEffect?.skuId, selectedSkuId: property?.skuId,
|
|
isTryItOut: isTryItOut, onApply: value9, analyticsLocations: analyticsLocations};
|
|
EDIT_PROFILE_EFFECT_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EDIT_PROFILE_EFFECT_SHEET;
|
|
defaultImport3Props.analyticsSource = EDIT_PROFILE_EFFECT_SHEET;
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<BottomSheet
|
|
scrollable
|
|
ref={bottomSheetRef}
|
|
onExpand={value8}
|
|
startExpanded
|
|
>
|
|
{view2}
|
|
<EditCollectiblesCTAButton {...defaultImport3Props} />
|
|
</BottomSheet>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
function _fun100814() { // fn#100814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:2704, offset: 0x021fa9f5, size: 98 bytes, params: 1, frame: 14
|
|
const object = {};
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
const EDIT_PROFILE_EFFECT_SHEET = (AnalyticsLocation).EDIT_PROFILE_EFFECT_SHEET;
|
|
object.type = EDIT_PROFILE_EFFECT_SHEET;
|
|
object.guild_id = guildId;
|
|
object.profile_has_nitro_customization = env0_2 != null && (env0_2 == null ? value : env0_2.hasPremiumCustomization());
|
|
return object;
|
|
}
|
|
|
|
function _fun100815() { // fn#100815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:2874, offset: 0x021faa57, size: 75 bytes, params: 1, frame: 16
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const OPEN_POPOUT = AnalyticEvents.OPEN_POPOUT;
|
|
const object = {};
|
|
copyDataProperties(object, env0_4, undefined);
|
|
object['is_fullscreen'] = true;
|
|
Reflect.apply(track, defaultImport, [OPEN_POPOUT, object]);
|
|
}
|
|
|
|
function _fun100816() { // fn#100816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13404:2957, offset: 0x021faaa2, size: 126 bytes, params: 1, frame: 16
|
|
var moduleValue;
|
|
var value3;
|
|
var moduleValue2;
|
|
var value4;
|
|
if (isTryItOut) {
|
|
moduleValue2 = require(7613) /* metro dependency 7613: UserProfileActionCreators */;
|
|
value4 = null;
|
|
moduleValue2.setTryItOutProfileEffect(value4 != env0_3 ? env0_3 : value4);
|
|
} else {
|
|
moduleValue = require(8400) /* metro dependency 8400: UserProfileSettingsActionCreators */;
|
|
value3 = null;
|
|
moduleValue.setPendingChanges({guildId: guildId, profileEffect: value3 != env0_3 ? env0_3 : value3});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100806, 13214, [57, 31, 27, 5145, 5127, 661, 33, 4501, 697, 8490, 7326, 6771, 6789, 683, 7613, 8400,
|
|
6275, 4573, 1244, 8404, 7675, 566, 13215, 8402, 8491, 13216, 8414, 8415, 8409, 8405, 8488, 4589,
|
|
2]) /* metro module 13214, dependencies: [57, 31, 27, 5145, 5127, 661, 33, 4501, 697, 8490, 7326, 6771, 6789, 683, 7613, 8400, 6275, 4573, 1244, 8404, 7675, 566, 13215, 8402, 8491, 13216, 8414, 8415, 8409, 8405, 8488, 4589, 2] */;
|