107 lines
7.3 KiB
TypeScript
107 lines
7.3 KiB
TypeScript
/* Metro module 13221; source: modules/user_profile/native/UserProfileNameplateEditButton.tsx; dependencies: [31, 27, 1945, 6816, 482, 33, 4501, 697, 566, 8402, 13222, 4080, 13223, 1962, 13209, 1244, 8483, 1305, 8411, 2] */
|
|
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
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 '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule2 from './Constants.tsx'; /* Metro dependency 6816 */
|
|
import * as ProfileCustomizationUtilsModule from '../../profile_customization/ProfileCustomizationUtils.tsx'; /* Metro dependency 8402 */
|
|
import * as UserProfileEditFormControlsModule from './UserProfileEditFormControls.tsx'; /* Metro dependency 13209 */
|
|
|
|
function _fun100858(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13411:6, offset: 0x021fd03a, size: 340 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.ActivityIndicator;
|
|
const env0_5 = value.View;
|
|
const COLLECTIBLES_PREVIEW_SIZE = (ConstantsModule2).COLLECTIBLES_PREVIEW_SIZE;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {height: COLLECTIBLES_PREVIEW_SIZE, width: COLLECTIBLES_PREVIEW_SIZE};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object2.overflow = 'hidden';
|
|
object.previewContainer = object2;
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
object.noneIcon = {tintColor: TEXT_SUBTLE};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileNameplateEditButton.tsx');
|
|
exports.default = UserProfileNameplateEditButton;
|
|
function UserProfileNameplateEditButton({user, pendingNameplate, guildId}) { // fn#100859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13411:487, offset: 0x021fd18e, size: 998 bytes, params: 2, frame: 26
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const UserProfileEditFormButton = (UserProfileEditFormControlsModule).UserProfileEditFormButton;
|
|
const styles = useStyles();
|
|
const value3 = guildId != null;
|
|
const value4 = (FluxModule).useStateFromStores([GuildMemberStore], _fun100860);
|
|
const getProfilePreviewValue = ProfileCustomizationUtilsModule.getProfilePreviewValue;
|
|
object = {pendingValue: pendingNameplate};
|
|
object.userValue = user.collectibles?.nameplate;
|
|
object.guildValue = value4 == null ? undefined : value4.collectibles?.nameplate;
|
|
object.guildId = guildId;
|
|
const {nameplateProduct, nameplateRecord, nameplateData,
|
|
isFetching} = (require(13222) /* metro dependency 13222: useFetchNameplate */).useFetchNameplate(Reflect.apply(getProfilePreviewValue,
|
|
ProfileCustomizationUtilsModule, [object])?.skuId);
|
|
let r0 = value3 ? value4 == null || value4.collectibles == null ? undefined : value4.collectibles.nameplate : user.collectibles?.nameplate;
|
|
r0 = pendingNameplate !== undefined ? pendingNameplate : r0;
|
|
const value7 = r0.useCallback(_fun100861, [user, r0, guildId]);
|
|
if (isFetching) {
|
|
return (
|
|
<UserProfileEditFormButton
|
|
label={intl.string(t.x5CoXR)}
|
|
buttonText={intl.string(t.MKDeyL)}
|
|
onPress={NOOP}
|
|
leading={<ActivityIndicator animating size="large" />}
|
|
loading
|
|
disabled
|
|
hideArrow
|
|
/>
|
|
);
|
|
}
|
|
const r13 = nameplateProduct?.name ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PoWNfe);
|
|
const r12 = value3 ? r0 != null ? r13 : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.ep5D4i,
|
|
{label: r13}) : r13;
|
|
return (
|
|
<UserProfileEditFormButton
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.x5CoXR)}
|
|
buttonText={r12}
|
|
accessibilityValue={{text: r12}}
|
|
onPress={value7}
|
|
leading={nameplateData == null || nameplateRecord == null
|
|
? ((Icon) => <Icon source={importDefault(8411) /* metro dependency 8411 */} style={styles.noneIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)
|
|
: (
|
|
nameplateProduct != null
|
|
? (
|
|
<View style={styles.previewContainer}>
|
|
{((Component) => <Component nameplate={nameplateData} fullOpacity isSquarePreview />)(importDefault(8483) /* metro dependency 8483: Nameplate */)}
|
|
</View>
|
|
)
|
|
: ((Icon) => <Icon source={importDefault(8411) /* metro dependency 8411 */} style={styles.noneIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)
|
|
)}
|
|
/>
|
|
);
|
|
function _fun100860() { // fn#100860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13411:630, offset: 0x021fd574, size: 46 bytes, params: 1, frame: 14
|
|
return result ? GuildMemberStore.getMember(guildId, user.id) : null;
|
|
}
|
|
|
|
function _fun100861() { // fn#100861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13411:1104, offset: 0x021fd5a2, size: 110 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[11]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[13]);
|
|
value = value(dependencyMap[12], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'Edit Nameplate', {user: user, currentNameplate: ReactModule,
|
|
guildId: guildId}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100858, 13221, [31, 27, 1945, 6816, 482, 33, 4501, 697, 566, 8402, 13222, 4080, 13223, 1962, 13209,
|
|
1244, 8483, 1305, 8411,
|
|
2]) /* metro module 13221, dependencies: [31, 27, 1945, 6816, 482, 33, 4501, 697, 566, 8402, 13222, 4080, 13223, 1962, 13209, 1244, 8483, 1305, 8411, 2] */;
|