160 lines
9.5 KiB
TypeScript
160 lines
9.5 KiB
TypeScript
/* Metro module 8417; source: modules/profile_customization/native/HeaderAvatar.tsx; dependencies: [31, 27, 4502, 1945, 4396, 661, 33, 4501, 697, 1305, 566, 8418, 8402, 8419, 8420, 5278, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import PresenceStore from '../../../stores/PresenceStore.tsx'; /* Metro dependency 4396 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import UseAvatarDecorationIfNotExpired from '../../collectibles/avatar_decorations/useAvatarDecorationIfNotExpired.tsx'; /* Metro dependency 8418 */
|
|
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as ProfileCustomizationUtilsModule from '../ProfileCustomizationUtils.tsx'; /* Metro dependency 8402 */
|
|
|
|
function _fun66858(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:6, offset: 0x01c0d012, size: 291 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
|
|
const env0_9 = Reflect.apply(createStyles, CreateStylesModule,
|
|
[{avatarStatusStyle: {backgroundColor: BACKGROUND_SURFACE_HIGH}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/profile_customization/native/HeaderAvatar.tsx');
|
|
exports.default = HeaderAvatar;
|
|
function HeaderAvatar(a0) { // fn#66859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:386, offset: 0x01c0d135, size: 705 bytes, params: 2, frame: 35
|
|
const user = a0.user;
|
|
const guildId = a0.guildId;
|
|
const disableStatus = a0.disableStatus;
|
|
const env0_2 = a0.pendingAvatarSrc;
|
|
const pendingAvatarDecoration = a0.pendingAvatarDecoration;
|
|
const style = a0.style;
|
|
const statusStyle = a0.statusStyle;
|
|
const onPress = a0.onPress;
|
|
const size = a0.size;
|
|
const value = undefined;
|
|
const r14 = size !== value ? size : (require(1305) /* metro dependency 1305: native */).AvatarSizes.XXLARGE;
|
|
let animate = a0.animate;
|
|
animate = animate === value || animate;
|
|
let object = {'user': 0, 'guildId': 0, 'disableStatus': 0, 'pendingAvatarSrc': 0, 'pendingAvatarDecoration': 0,
|
|
'style': 0, 'statusStyle': 0, 'onPress': 0, 'size': 0, 'animate': 0};
|
|
const value4 = null;
|
|
silentSetPrototypeOf(object, value4, undefined);
|
|
const value5 = copyDataProperties({}, a0, object, undefined);
|
|
const styles = useStyles();
|
|
const id = user.id;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const {isMobileOnline, status,
|
|
activities} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PresenceStore],
|
|
function() {
|
|
var object = {};
|
|
var presenceStoreBinding = PresenceStore;
|
|
object.isMobileOnline = presenceStoreBinding.isMobileOnline(id);
|
|
object.status = presenceStoreBinding.getStatus(id);
|
|
object.activities = presenceStoreBinding.getActivities(id);
|
|
object.customStatusActivity = presenceStoreBinding.findActivity(id, _fun66862);
|
|
return object;
|
|
}, [id]);
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun66863);
|
|
const defaultImport = UseAvatarDecorationIfNotExpired;
|
|
const getProfilePreviewValue = ProfileCustomizationUtilsModule.getProfilePreviewValue;
|
|
const value9 = defaultImport(Reflect.apply(getProfilePreviewValue, ProfileCustomizationUtilsModule,
|
|
[{pendingValue: pendingAvatarDecoration, userValue: value4 == user ? value : user.avatarDecoration,
|
|
guildValue: value4 == value8 ? value : value8.avatarDecoration, guildId: guildId}]));
|
|
const object3 = {isMobileOnline: isMobileOnline, size: r14};
|
|
object3.status = disableStatus ? value4 : status;
|
|
object3.statusStyle = [styles.avatarStatusStyle, statusStyle];
|
|
object3.streaming = (importDefault(8419) /* metro dependency 8419: isStreaming */)(activities);
|
|
object3.animate = animate && !useReducedMotion;
|
|
object3.avatarDecoration = value9;
|
|
const renderAvatar2 = renderAvatar;
|
|
if (value4 != onPress) {
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
return (
|
|
<PressableOpacity
|
|
onPress={onPress}
|
|
onLongPress={onPress}
|
|
style={style}
|
|
activeOpacity={0.8}
|
|
accessibilityRole="imagebutton"
|
|
{...value5}
|
|
>
|
|
{renderAvatar2()}
|
|
</PressableOpacity>
|
|
);
|
|
} else {
|
|
return (
|
|
<View
|
|
style={style}
|
|
accessibilityRole="image"
|
|
accessible
|
|
{...value5}
|
|
>
|
|
{renderAvatar2()}
|
|
</View>
|
|
);
|
|
}
|
|
function _fun66861() { // fn#66861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:692, offset: 0x01c0d3f6, size: 103 bytes, params: 1, frame: 14
|
|
const presenceStoreBinding = PresenceStore;
|
|
const getStatus = presenceStoreBinding.getStatus;
|
|
const getActivities = presenceStoreBinding.getActivities;
|
|
return {isMobileOnline: presenceStoreBinding.isMobileOnline(id), status: Reflect.apply(getStatus,
|
|
presenceStoreBinding, [id]), activities: Reflect.apply(getActivities, presenceStoreBinding, [id]),
|
|
customStatusActivity: presenceStoreBinding.findActivity(id, function({type}) {
|
|
return type === ActivityTypes.CUSTOM_STATUS;
|
|
})};
|
|
function _fun66862({type}) { // fn#66862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:824, offset: 0x01c0d45d, size: 27 bytes, params: 2, frame: 2
|
|
const CUSTOM_STATUS = ActivityTypes.CUSTOM_STATUS;
|
|
return type === CUSTOM_STATUS;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun66863() { // fn#66863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:942, offset: 0x01c0d478, size: 45 bytes, params: 1, frame: 14
|
|
const guildIdBinding = guildId;
|
|
const value2 = null;
|
|
return value2 != guildIdBinding ? GuildMemberStore.getMember(guildId, id) : value2;
|
|
}
|
|
|
|
function renderAvatar() { // fn#66864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8602:1287, owner: HeaderAvatar.renderAvatar, offset: 0x01c0d4a5, size: 154 bytes, params: 1, frame: 23
|
|
var r0;
|
|
var object;
|
|
var userBinding;
|
|
var guildIdBinding;
|
|
var getAvatarSource;
|
|
let value = environment.__proto__;
|
|
const Avatar = (NativeModule).Avatar;
|
|
let pendingAvatarSrcBinding = pendingAvatarSrc;
|
|
if (pendingAvatarSrcBinding !== undefined) {
|
|
object = {};
|
|
value = require(8420) /* metro dependency 8420: ProfileCustomizationUtils */;
|
|
getAvatarSource = value.getAvatarSource;
|
|
userBinding = user;
|
|
guildIdBinding = guildId;
|
|
pendingAvatarSrcBinding = pendingAvatarSrc;
|
|
object.source = Reflect.apply(getAvatarSource, value, [userBinding, guildIdBinding, pendingAvatarSrcBinding,
|
|
useReducedMotion]);
|
|
copyDataProperties(object, env0_5, pendingAvatarSrcBinding);
|
|
r0 = object;
|
|
} else {
|
|
object = {};
|
|
object.user = user;
|
|
object.guildId = guildId;
|
|
copyDataProperties(object, env0_5, undefined);
|
|
r0 = object;
|
|
}
|
|
return <Avatar {...r0} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun66858, 8417, [31, 27, 4502, 1945, 4396, 661, 33, 4501, 697, 1305, 566, 8418, 8402, 8419, 8420, 5278,
|
|
2]) /* metro module 8417, dependencies: [31, 27, 4502, 1945, 4396, 661, 33, 4501, 697, 1305, 566, 8418, 8402, 8419, 8420, 5278, 2] */;
|