Files
discord-decomp/sources/modules/avatar/native/components/TouchableUploadAvatar.tsx
T
2026-07-28 01:06:53 +03:00

82 lines
5.6 KiB
TypeScript

/* Metro module 15789; source: modules/avatar/native/components/TouchableUploadAvatar.tsx; dependencies: [31, 27, 33, 4501, 697, 12636, 5278, 1244, 5475, 1305, 12066, 2] */
import FastImage from '../../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
import Module12066 from '../../../../by-id/module-12066.js'; /* Metro dependency 12066 */
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 PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
function _fun121294(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15997:6, offset: 0x02543b07, size: 483 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {avatarContainer: {'display': 'flex', 'paddingTop': 24}};
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object.defaultLogoStyle = {tintColor: INTERACTIVE_TEXT_DEFAULT, width: 96};
object.uploadedAvatarStyle = {'width': 200, 'height': 200, 'borderRadius': 100, 'position': 'relative'};
const object3 = {'borderColor': null, 'borderStyle': 'dashed', 'borderWidth': 2, 'borderRadius': null, 'width': 200,
'height': 200, 'justifyContent': 'center', 'alignItems': 'center', 'position': 'relative',
'overflow': 'visible'};
const BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object3.borderColor = BORDER_MUTED;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.avatarWrapper = object3;
const object4 = {'backgroundColor': null, 'borderRadius': null, 'tintColor': null, 'position': 'absolute',
'right': 10, 'top': 10, 'width': 40, 'height': 40, 'flex': 1, 'justifyContent': 'center'};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object4.backgroundColor = BACKGROUND_BRAND;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object4.tintColor = BACKGROUND_BASE_LOW;
object.uploadAvatarWrapper = object4;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object.uploadAvatarIcon = {tintColor: WHITE, alignSelf: 'center'};
const env0_6 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/avatar/native/components/TouchableUploadAvatar.tsx');
exports.default = TouchableUploadAvatar;
function TouchableUploadAvatar({avatarSource, showPendingAvatar, onSelectAvatar}) { // fn#121295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15997:914, offset: 0x02543cea, size: 409 bytes, params: 2, frame: 26
showPendingAvatar = !(showPendingAvatar === undefined) && showPendingAvatar;
const styles = useStyles();
const r10 = showPendingAvatar && avatarSource != null ? avatarSource : importDefault(12636) /* metro dependency 12636 */;
const r11 = showPendingAvatar && avatarSource != null ? styles.uploadedAvatarStyle : styles.defaultLogoStyle;
const PressableOpacity = (PressablesModule).PressableOpacity;
const object2 = {onPress: onSelectAvatar, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['70lEQe']);
let value = FastImage;
value = ((Component) => <Component resizeMode="contain" style={r11} source={r10} />)(value);
const Icon = (NativeModule).Icon;
const Icon2 = (NativeModule).Icon;
const Sizes = Icon2.Sizes;
const MEDIUM = Sizes.MEDIUM;
return (
<View style={styles.avatarContainer}>
<PressableOpacity {...object2}>
<View style={styles.avatarWrapper}>
{value}
<View style={styles.uploadAvatarWrapper}>
<Icon
size={MEDIUM}
source={Module12066}
style={styles.uploadAvatarIcon}
/>
</View>
</View>
</PressableOpacity>
</View>
);
}
}
global.__d(_fun121294, 15789, [31, 27, 33, 4501, 697, 12636, 5278, 1244, 5475, 1305, 12066,
2]) /* metro module 15789, dependencies: [31, 27, 33, 4501, 697, 12636, 5278, 1244, 5475, 1305, 12066, 2] */;