120 lines
8.2 KiB
TypeScript
120 lines
8.2 KiB
TypeScript
/* Metro module 10507; source: modules/collectibles/nameplates/native/NameplatePreview.tsx; dependencies: [31, 27, 4502, 1945, 33, 4501, 697, 1901, 4618, 8398, 566, 3995, 4635, 1305, 8483, 8696, 8697, 4573, 2] */
|
|
import GuildMemberStore from '../../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import UseDisplayNameStyles from '../../../display_name_styles/hooks/useDisplayNameStyles.tsx'; /* Metro dependency 4635 */
|
|
import UsePendingAvatarSettings from '../../../user_profile/hooks/usePendingAvatarSettings.tsx'; /* Metro dependency 8398 */
|
|
import Nameplate from './Nameplate.tsx'; /* Metro dependency 8483 */
|
|
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 NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseAvatarDecorationModule from '../../avatar_decorations/useAvatarDecoration.tsx'; /* Metro dependency 4618 */
|
|
|
|
function _fun81230(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10693:6, offset: 0x01e9f56b, size: 237 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_9 = (CreateStylesModule).createStyles(_fun81231);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/nameplates/native/NameplatePreview.tsx');
|
|
exports.NameplatePreview = NameplatePreview_81232;
|
|
function _fun81231(a0) { // fn#81231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10693:192, offset: 0x01e9f658, size: 281 bytes, params: 2, frame: 18
|
|
const object = {};
|
|
const object2 = {'borderRadius': null, 'padding': null, 'flexDirection': 'row', 'alignItems': 'center',
|
|
'width': '100%'};
|
|
const value = 0;
|
|
object2.borderRadius = a0 ? (importDefault(697) /* metro dependency 697: native */).radii.sm : value;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.padding = PX_8;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object.container = object2;
|
|
object.nameplate = {borderRadius: a0 ? (importDefault(697) /* metro dependency 697: native */).radii.sm : value};
|
|
const object4 = {};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.marginRight = PX_8;
|
|
object.avatar = object4;
|
|
const PX_40 = (importDefault(697) /* metro dependency 697: native */).space.PX_40;
|
|
object.content = {flex: 1, paddingRight: PX_40};
|
|
return object;
|
|
}
|
|
|
|
function NameplatePreview_81232(a0) { // fn#81232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10693:663, offset: 0x01e9f771, size: 813 bytes, params: 2, frame: 31
|
|
const nameplate = a0.nameplate;
|
|
const nameplateData = a0.nameplateData;
|
|
const user = a0.user;
|
|
let hasRoundedCorners = a0.hasRoundedCorners;
|
|
const value = undefined;
|
|
hasRoundedCorners = hasRoundedCorners === value || hasRoundedCorners;
|
|
let animate = a0.animate;
|
|
animate = !(animate === value) && animate;
|
|
const guildId = a0.guildId;
|
|
const pendingDisplayNameStyles = a0.pendingDisplayNameStyles;
|
|
const pendingGlobalName = a0.pendingGlobalName;
|
|
const property = a0['aria-hidden'];
|
|
const styles = useStyles(hasRoundedCorners);
|
|
const r17 = nameplate == null ? nameplateData : (require(1901) /* metro dependency 1901: utils */).getNameplateData(nameplate);
|
|
const value6 = (UseAvatarDecorationModule).useAvatarDecoration(user, guildId);
|
|
const pendingAvatarDecoration = (UsePendingAvatarSettings)({guildId: guildId}).pendingAvatarDecoration;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const useReducedMotion2 = useReducedMotion;
|
|
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun81234);
|
|
const r11 = pendingGlobalName ?? (guildId == null || (value7 == null ? value : value7.nick) == null ? (importDefault(3995) /* metro dependency 3995: UserUtils */).useName(user) : value7 == null ? value : value7.nick);
|
|
const r19 = value === pendingAvatarDecoration ? value6 : pendingAvatarDecoration;
|
|
const value9 = (UseDisplayNameStyles)({userId: user.id,
|
|
guildId: guildId, pendingDisplayNameStyles: pendingDisplayNameStyles});
|
|
const value10 = useReducedMotion2.useMemo(_fun81235, [styles.avatar, user, guildId, r19, useReducedMotion]);
|
|
object = {style: styles.container};
|
|
object['aria-hidden'] = property;
|
|
const items2 = [
|
|
((Component) => <Component nameplate={r17} style={styles.nameplate} fullOpacity animate={animate} />)(Nameplate),
|
|
|
|
];
|
|
items2[1] = (
|
|
<View style={styles.avatar}>
|
|
{value10}
|
|
</View>
|
|
);
|
|
items2[2] = (
|
|
<View style={styles.content}>
|
|
{value9 != null && ((Component) => <Component userId={user.id} guildId={guildId} userName={r11} variant="text-md/semibold" effectDisplayType={(require(8697) /* metro dependency 8697: types */).EffectDisplayType.STATIC} lineClamp={1} pendingDisplayNameStyles={pendingDisplayNameStyles} />)(importDefault(8696) /* metro dependency 8696: UsernameWithEffects */)}
|
|
{value9 == null && ((Text) => <Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary">{r11}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
</View>
|
|
);
|
|
return (
|
|
<View {...object}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun81234() { // fn#81234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10693:1041, offset: 0x01e9fa9e, size: 65 bytes, params: 1, frame: 14
|
|
const guildIdBinding = guildId;
|
|
const value2 = null;
|
|
return value2 != guildIdBinding && value2 != user ? GuildMemberStore.getMember(guildId, user.id) : value2;
|
|
}
|
|
|
|
function _fun81235() { // fn#81235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10693:1279, offset: 0x01e9fadf, size: 136 bytes, params: 1, frame: 18
|
|
const Avatar = (NativeModule).Avatar;
|
|
const avatarProps = {style: styles.avatar, user: user, guildId: guildId};
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const NORMAL = AvatarSizes.NORMAL;
|
|
avatarProps.size = NORMAL;
|
|
avatarProps.avatarDecoration = ReactNativeModule.View;
|
|
avatarProps.animate = !useReducedMotion;
|
|
avatarProps.autoStatusCutout = true;
|
|
avatarProps['aria-hidden'] = true;
|
|
return <Avatar {...avatarProps} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun81230, 10507, [31, 27, 4502, 1945, 33, 4501, 697, 1901, 4618, 8398, 566, 3995, 4635, 1305, 8483,
|
|
8696, 8697, 4573,
|
|
2]) /* metro module 10507, dependencies: [31, 27, 4502, 1945, 33, 4501, 697, 1901, 4618, 8398, 566, 3995, 4635, 1305, 8483, 8696, 8697, 4573, 2] */;
|