173 lines
11 KiB
TypeScript
173 lines
11 KiB
TypeScript
/* Metro module 13240; source: modules/guild_identity/native/EditGuildIdentityAvatar.tsx; dependencies: [31, 1945, 1878, 661, 1880, 33, 4501, 566, 6771, 6789, 8398, 13201, 8403, 3802, 8402, 7882, 4080, 13202, 1962, 13203, 13203, 8396, 5278, 1244, 8417, 13204, 2] */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import PremiumUtils from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import UsePendingAvatarSettings from '../../user_profile/hooks/usePendingAvatarSettings.tsx'; /* Metro dependency 8398 */
|
|
import UseUploadAvatar from '../../user_profile/hooks/native/useUploadAvatar.tsx'; /* Metro dependency 13201 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as PremiumConstantsModule from '../../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as AvatarDecorationUtilsModule from '../../collectibles/avatar_decorations/native/AvatarDecorationUtils.tsx'; /* Metro dependency 8396 */
|
|
import * as RecentAvatarUtilsModule from '../../recent_avatars/RecentAvatarUtils.tsx'; /* Metro dependency 8403 */
|
|
|
|
function _fun100979(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:6, offset: 0x0220384f, size: 294 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_6 = value.AnalyticsSections;
|
|
const env0_7 = value.AnalyticsObjects;
|
|
const env0_8 = value.UpsellTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const env0_12 = (CreateStylesModule).createStyles({editAvatarIcon: {'position': 'absolute',
|
|
'right': 0}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_identity/native/EditGuildIdentityAvatar.tsx');
|
|
exports.default = EditGuildIdentityAvatar;
|
|
function EditGuildIdentityAvatar({userId, guildId, disabled, disableStatus, style, statusStyle, avatarStyle}) { // fn#100980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:424, offset: 0x02203975, size: 825 bytes, params: 2, frame: 36
|
|
var r15;
|
|
var r0;
|
|
var PressableOpacity;
|
|
var intl;
|
|
var HeaderAvatar;
|
|
var object2;
|
|
var value12;
|
|
var items2;
|
|
let value = undefined;
|
|
disableStatus = disableStatus === value || disableStatus;
|
|
const styles = useStyles();
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [UserStore];
|
|
const currentUser = Reflect.apply(useStateFromStores, FluxModule, [object, function() {
|
|
return UserStore.getCurrentUser();
|
|
}]);
|
|
const value4 = FluxModule.useStateFromStores([GuildMemberStore], _fun100982);
|
|
const defaultImport = UseAnalyticsLocations;
|
|
const EDIT_AVATAR = (AnalyticsLocation).EDIT_AVATAR;
|
|
const analyticsLocations = defaultImport(EDIT_AVATAR).analyticsLocations;
|
|
const analyticsLocations2 = analyticsLocations;
|
|
const {pendingAvatar, pendingAvatarDecoration,
|
|
setPendingAvatar} = (UsePendingAvatarSettings)({guildId: guildId,
|
|
analyticsLocations: analyticsLocations});
|
|
const value6 = (UseUploadAvatar)({guildId: guildId,
|
|
analyticsLocations: analyticsLocations});
|
|
const pendingAvatarSrc = (RecentAvatarUtilsModule).getPendingAvatarSrc({userId: userId,
|
|
image: pendingAvatar});
|
|
const canUsePremiumGuildMemberProfile2 = (PremiumUtils).canUsePremiumGuildMemberProfile(currentUser);
|
|
const defaultImport5 = PremiumUtils;
|
|
const value8 = !defaultImport5.canUseAnimatedAvatar(currentUser);
|
|
const value10 = (require(8402) /* metro dependency 8402: ProfileCustomizationUtils */).showRemoveAvatar(pendingAvatar,
|
|
value4 == null ? value : value4.avatar);
|
|
const r21 = value !== pendingAvatarDecoration ? pendingAvatarDecoration : value4 == null ? value : value4.avatarDecoration;
|
|
const binding = analyticsLocations2;
|
|
const useCallback = binding.useCallback;
|
|
if (currentUser == null) {
|
|
r0 = null;
|
|
} else {
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
object = {style: style, disabled: disabled, onPress: Reflect.apply(useCallback, binding, [_fun100983, [guildId,
|
|
value4, currentUser, canUsePremiumGuildMemberProfile2, value8, value10, r21, analyticsLocations, value6,
|
|
setPendingAvatar]]), accessibilityRole: 'button'};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['70lEQe']);
|
|
HeaderAvatar = importDefault(8417) /* metro dependency 8417: HeaderAvatar */;
|
|
object2 = {user: currentUser};
|
|
value12 = pendingAvatar === null;
|
|
r15 = value12 ? value : guildId;
|
|
object2.guildId = r15;
|
|
r15 = value12 ? value : pendingAvatarSrc;
|
|
object2.pendingAvatarSrc = r15;
|
|
object2.pendingAvatarDecoration = pendingAvatarDecoration;
|
|
object2.statusStyle = statusStyle;
|
|
object2.disableStatus = disableStatus;
|
|
object2.style = avatarStyle;
|
|
items2 = [
|
|
<HeaderAvatar {...object2} />,
|
|
];
|
|
items2[1] = !disabled && ((Component) => <Component style={styles.editAvatarIcon} />)(importDefault(13204) /* metro dependency 13204: EditIcon */);
|
|
value = (
|
|
<PressableOpacity {...object}>
|
|
{items2}
|
|
</PressableOpacity>
|
|
);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun100982() { // fn#100982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:648, offset: 0x02203cae, size: 65 bytes, params: 1, frame: 16
|
|
const currentUserBinding = currentUser;
|
|
const value2 = null;
|
|
return value2 != currentUserBinding ? GuildMemberStore.getMember(guildId,
|
|
value2 == currentUser ? undefined : currentUser.id) : value2;
|
|
}
|
|
|
|
function _fun100983() { // fn#100983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1163, offset: 0x02203cef, size: 300 bytes, params: 1, frame: 20
|
|
var environment;
|
|
var binding;
|
|
var value4;
|
|
var defaultImport2;
|
|
if (env0_2 != null && currentUser != null) {
|
|
binding = env0_6;
|
|
value4 = environment.__proto__;
|
|
if (binding) {
|
|
defaultImport2 = importDefault(dependencyMap[16]);
|
|
defaultImport2.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths), 'Change Avatar',
|
|
{handleUploadAvatarSelect: env0_5, handleRemoveAvatarSelect: handleRemoveAvatarSelect_100984,
|
|
handleUploadGIFAvatarSelect: handleUploadGIFAvatarSelect_100985,
|
|
handleEditAvatarDecorationSelect: handleEditAvatarDecorationSelect_100986,
|
|
showAnimatedAvatarUpsell: env0_7,
|
|
showRemoveAvatar: env0_8});
|
|
} else {
|
|
importDefault(dependencyMap[15]).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.PREMIUM_GUILD_PROFILE,
|
|
analyticsLocation: {section: AnalyticsSections.PREMIUM_GUILD_MEMBER_PROFILE,
|
|
object: AnalyticsObjects.EDIT_GUILD_PROFILE_AVATAR}, analyticsLocations: analyticsLocations,
|
|
analyticsProperties: {type: PremiumUpsellTypes.PREMIUM_GUILD_IDENTITY_MODAL}});
|
|
}
|
|
}
|
|
function handleRemoveAvatarSelect_100984() { // fn#100984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1300, offset: 0x02203e1b, size: 51 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
value = environment.__proto__;
|
|
setPendingAvatar(null);
|
|
}
|
|
|
|
function handleUploadGIFAvatarSelect_100985() { // fn#100985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1369, offset: 0x02203e4e, size: 167 bytes, params: 1, frame: 19
|
|
let value = environment.__proto__.__proto__;
|
|
importDefault(dependencyMap[16]).hideActionSheet();
|
|
const defaultImport2 = importDefault(dependencyMap[16]);
|
|
const openLazy = defaultImport2.openLazy;
|
|
value = require(dependencyMap[18]);
|
|
value = value(dependencyMap[19], dependencyMap.paths);
|
|
const object = {};
|
|
const ProfileAssetType = require(dependencyMap[20]).ProfileAssetType;
|
|
const AVATAR = ProfileAssetType.AVATAR;
|
|
object.profileAssetType = AVATAR;
|
|
const GIFSelectionContext = require(dependencyMap[20]).GIFSelectionContext;
|
|
const PROFILE_EDIT = GIFSelectionContext.PROFILE_EDIT;
|
|
object.selectionContext = PROFILE_EDIT;
|
|
object.guildId = guildId;
|
|
Reflect.apply(openLazy, defaultImport2, [value, 'Select GIF Avatar', object]);
|
|
}
|
|
|
|
function handleEditAvatarDecorationSelect_100986() { // fn#100986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1619, offset: 0x02203ef5, size: 77 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
(AvatarDecorationUtilsModule).openAvatarDecorationActionSheet({user: currentUser,
|
|
guildId: guildId, currentAvatarDecoration: env1_9, analyticsLocations: analyticsLocations});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100979, 13240, [31, 1945, 1878, 661, 1880, 33, 4501, 566, 6771, 6789, 8398, 13201, 8403, 3802, 8402,
|
|
7882, 4080, 13202, 1962, 13203, 13203, 8396, 5278, 1244, 8417, 13204,
|
|
2]) /* metro module 13240, dependencies: [31, 1945, 1878, 661, 1880, 33, 4501, 566, 6771, 6789, 8398, 13201, 8403, 3802, 8402, 7882, 4080, 13202, 1962, 13203, 13203, 8396, 5278, 1244, 8417, 13204, 2] */;
|