256 lines
16 KiB
TypeScript
256 lines
16 KiB
TypeScript
/* Metro module 13223; source: modules/user_profile/native/EditNameplateActionSheet.tsx; dependencies: [57, 31, 27, 5145, 1902, 1945, 661, 33, 4501, 697, 7326, 6771, 6789, 683, 8400, 6275, 4573, 1244, 8404, 7675, 566, 13224, 8402, 13225, 8414, 8415, 8409, 8405, 8482, 4589, 10507, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import CollectiblesPurchaseStore from '../../collectibles/CollectiblesPurchaseStore.tsx'; /* Metro dependency 5145 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
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 UseNameplateSections from '../../collectibles/nameplates/useNameplateSections.tsx'; /* Metro dependency 13224 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NameplateRecordModule from '../../collectibles/records/NameplateRecord.tsx'; /* Metro dependency 1902 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
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 NameplateDummyUserPreviewModule from '../../collectibles/nameplates/native/NameplateDummyUserPreview.tsx'; /* Metro dependency 8482 */
|
|
import * as NameplatePreviewModule from '../../collectibles/nameplates/native/NameplatePreview.tsx'; /* Metro dependency 10507 */
|
|
import * as EditNameplateSectionModule from '../../collectibles/nameplates/native/EditNameplateSection.tsx'; /* Metro dependency 13225 */
|
|
|
|
function _fun100864(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:6, offset: 0x021fd72c, size: 503 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const env0_12 = 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.nameplatePreviewContainer = {'width': '80%', 'alignSelf': 'center', 'justifyContent': 'center',
|
|
'alignItems': 'center'};
|
|
object.nameplateGradientContainer = {width: '100%'};
|
|
MOBILE_ACTIONSHEET_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ACTIONSHEET_BACKGROUND;
|
|
object.nameplatePreviewGradient = {'position': 'absolute', 'width': '100%', 'height': '100%',
|
|
color: MOBILE_ACTIONSHEET_BACKGROUND};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/EditNameplateActionSheet.tsx');
|
|
exports.default = EditNameplateActionSheet;
|
|
function EditNameplateInner({user, selectedNameplate, setSelectedNameplate, guildId}) { // fn#100865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:799, offset: 0x021fd923, size: 659 bytes, params: 2, frame: 29
|
|
(UseFetchCollectiblesCategoriesAndPurchasesModule).useGetOrFetchCollectiblesCategoriesAndPurchases();
|
|
const isFetching = (require(566) /* metro dependency 566: flux */).useStateFromStores([CollectiblesPurchaseStore],
|
|
function() {
|
|
return CollectiblesPurchaseStore.isFetching;
|
|
});
|
|
const value3 = (UseNameplateSections)();
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun100867);
|
|
const profilePreviewValue = (require(8402) /* metro dependency 8402: ProfileCustomizationUtils */).getProfilePreviewValue({pendingValue: selectedNameplate,
|
|
userValue: user == null || user.collectibles == null ? undefined : user.collectibles.nameplate,
|
|
guildValue: value4 == null || value4.collectibles == null ? undefined : value4.collectibles.nameplate,
|
|
guildId: guildId});
|
|
const value6 = ReactModule.useCallback(_fun100868, [setSelectedNameplate, guildId]);
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
let skuId = profilePreviewValue?.skuId;
|
|
const items2 = [
|
|
<NameplateActionSheetPreview
|
|
previewSkuId={skuId}
|
|
user={user}
|
|
guildId={guildId}
|
|
/>,
|
|
];
|
|
const defaultImportProps = {user: user, previewSkuId: profilePreviewValue?.skuId};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
defaultImportProps.nitroJoinCTA = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['V+IE93']);
|
|
defaultImportProps.nitroUpgradeCTA = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.a6SrkR);
|
|
items2[1] = <EditCollectiblesPreviewDetails {...defaultImportProps} />;
|
|
const EditCollectiblesPickerList = (EditCollectiblesPickerListModule).EditCollectiblesPickerList;
|
|
skuId = selectedNameplate?.skuId;
|
|
const COLLECTIBLE_ROW_HEIGHT = (UseCollectibleListLayoutModule).COLLECTIBLE_ROW_HEIGHT;
|
|
items2[2] = (
|
|
<EditCollectiblesPickerList
|
|
sections={value3}
|
|
selectedSkuId={skuId}
|
|
renderRow={value6}
|
|
estimatedItemSize={COLLECTIBLE_ROW_HEIGHT}
|
|
isFetching={isFetching}
|
|
/>
|
|
);
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
function _fun100867() { // fn#100867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:1038, offset: 0x01c0746e, size: 50 bytes, params: 1, frame: 14
|
|
const guildIdBinding = guildId;
|
|
const value2 = null;
|
|
return value2 != guildIdBinding ? GuildMemberStore.getMember(guildId, user.id) : value2;
|
|
}
|
|
|
|
function _fun100868({items, size, selectedSkuId}) { // fn#100868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:1283, offset: 0x021fdbb6, size: 99 bytes, params: 2, frame: 16
|
|
const EditNameplateRow = (EditNameplateSectionModule).EditNameplateRow;
|
|
return (
|
|
<EditNameplateRow
|
|
items={items}
|
|
size={size}
|
|
selectedSkuId={selectedSkuId}
|
|
setSelectedNameplate={setSelectedNameplate}
|
|
guildId={guildId}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function NameplateActionSheetPreview({previewSkuId, user, guildId}) { // fn#100869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:1895, offset: 0x021fdc19, size: 827 bytes, params: 2, frame: 38
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
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 isNameplateRecord(r1) ? r1 : value2;
|
|
}, [value2.purchase, value2.product]);
|
|
const r4 = value3 != null ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.YJig7C,
|
|
{a11y_text: value3.label}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.aqlsGS);
|
|
let nameplateGradientContainer = styles.nameplateGradientContainer;
|
|
const NameplateDummyUserPreview = (NameplateDummyUserPreviewModule).NameplateDummyUserPreview;
|
|
const items2 = [
|
|
<NameplateDummyUserPreview width={100} />,
|
|
];
|
|
items2[1] = <NameplateDummyUserPreview width={140} />;
|
|
items2[2] = ((Component) => <Component style={styles.nameplatePreviewGradient} start={{'x': 0,
|
|
'y': 0.1}} end={{'x': 0, 'y': 0.8}} colors={[styles.nameplatePreviewGradient.color,
|
|
'' + styles.nameplatePreviewGradient.color + '00']} />)(importDefault(4589) /* metro dependency 4589 */);
|
|
const items3 = [
|
|
<View style={nameplateGradientContainer}>
|
|
{items2}
|
|
</View>,
|
|
];
|
|
const NameplatePreview = (NameplatePreviewModule).NameplatePreview;
|
|
items3[1] = (
|
|
<NameplatePreview
|
|
nameplate={value3}
|
|
user={user}
|
|
guildId={guildId}
|
|
animate
|
|
{...{['aria-hidden']: true}}
|
|
/>
|
|
);
|
|
nameplateGradientContainer = styles.nameplateGradientContainer;
|
|
const items4 = [
|
|
<NameplateDummyUserPreview width={140} />,
|
|
];
|
|
items4[1] = <NameplateDummyUserPreview width={100} />;
|
|
items4[2] = ((Component) => <Component style={styles.nameplatePreviewGradient} start={{'x': 0,
|
|
'y': 0.2}} end={{'x': 0, 'y': 0.9}} colors={['' + styles.nameplatePreviewGradient.color + '00',
|
|
styles.nameplatePreviewGradient.color]} />)(importDefault(4589) /* metro dependency 4589 */);
|
|
items3[2] = (
|
|
<View style={nameplateGradientContainer}>
|
|
{items4}
|
|
</View>
|
|
);
|
|
return (
|
|
<View
|
|
style={styles.nameplatePreviewContainer}
|
|
accessibilityLabel={r4}
|
|
accessibilityRole="image"
|
|
accessible
|
|
>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function EditNameplateActionSheet({user, currentNameplate, guildId}) { // fn#100871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:3058, offset: 0x021fdf54, size: 633 bytes, params: 2, frame: 36
|
|
const styles = useStyles();
|
|
const useBottomSheetRef = UseBottomSheetRefModule.useBottomSheetRef;
|
|
const bottomSheetRef = Reflect.apply(useBottomSheetRef, UseBottomSheetRefModule, []).bottomSheetRef;
|
|
let binding = ReactModule;
|
|
const [property, property2] = Module00057(binding.useState(undefined), 2);
|
|
const r15 = property === undefined ? currentNameplate : property;
|
|
let defaultImport = UseAnalyticsLocations;
|
|
let EDIT_NAMEPLATE_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EDIT_NAMEPLATE_SHEET;
|
|
const analyticsLocations = defaultImport(EDIT_NAMEPLATE_SHEET).analyticsLocations;
|
|
binding = ReactModule;
|
|
const value5 = binding.useCallback(function() {
|
|
var defaultImport = importDefault(dependencyMap[13]);
|
|
var OPEN_POPOUT = AnalyticEvents.OPEN_POPOUT;
|
|
defaultImport.track(OPEN_POPOUT, {type: importDefault(dependencyMap[12]).EDIT_NAMEPLATE_SHEET,
|
|
is_fullscreen: true});
|
|
}, []);
|
|
const value6 = binding.useCallback(_fun100873, [property, guildId]);
|
|
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const view = <View style={styles.bounceOffset} />;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const BwdeM1 = (IndexNativeModule).t.BwdeM1;
|
|
const view2 = (
|
|
<View style={styles.container}>
|
|
{view}
|
|
<Text
|
|
variant="redesign/heading-18/bold"
|
|
style={styles.title}
|
|
accessibilityRole="header"
|
|
>
|
|
{Reflect.apply(string, intl, [BwdeM1])}
|
|
</Text>
|
|
<EditNameplateInner
|
|
user={user}
|
|
selectedNameplate={r15}
|
|
setSelectedNameplate={property2}
|
|
guildId={guildId}
|
|
/>
|
|
</View>
|
|
);
|
|
const defaultImport2Props = {user: user, currentSkuId: currentNameplate?.skuId, selectedSkuId: r15?.skuId,
|
|
onApply: value6, analyticsLocations: analyticsLocations};
|
|
EDIT_NAMEPLATE_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EDIT_NAMEPLATE_SHEET;
|
|
defaultImport2Props.analyticsSource = EDIT_NAMEPLATE_SHEET;
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<BottomSheet
|
|
scrollable
|
|
ref={bottomSheetRef}
|
|
onExpand={value5}
|
|
startExpanded
|
|
>
|
|
{view2}
|
|
<EditCollectiblesCTAButton {...defaultImport2Props} />
|
|
</BottomSheet>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
function _fun100873() { // fn#100873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13413:3438, offset: 0x021fe21c, size: 73 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(8400) /* metro dependency 8400: UserProfileSettingsActionCreators */;
|
|
const value3 = null;
|
|
value.setPendingChanges({guildId: guildId, nameplate: value3 != env0_1 ? env0_1 : value3});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100864, 13223, [57, 31, 27, 5145, 1902, 1945, 661, 33, 4501, 697, 7326, 6771, 6789, 683, 8400, 6275,
|
|
4573, 1244, 8404, 7675, 566, 13224, 8402, 13225, 8414, 8415, 8409, 8405, 8482, 4589, 10507,
|
|
2]) /* metro module 13223, dependencies: [57, 31, 27, 5145, 1902, 1945, 661, 33, 4501, 697, 7326, 6771, 6789, 683, 8400, 6275, 4573, 1244, 8404, 7675, 566, 13224, 8402, 13225, 8414, 8415, 8409, 8405, 8482, 4589, 10507, 2] */;
|