100 lines
5.7 KiB
TypeScript
100 lines
5.7 KiB
TypeScript
/* Metro module 8507; source: modules/user_profile/native/UserProfileBanner.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 674, 697, 3829, 8420, 1423, 8508, 5278, 1244, 8509, 2] */
|
|
function _fun67444(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8692:6, offset: 0x01c22b7d, size: 386 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).BANNER_HEIGHT;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.bannerContainer = {position: 'relative'};
|
|
const object4 = {'position': 'absolute', 'left': 12, 'top': 12, 'right': 'auto', 'bottom': 'auto'};
|
|
const value2 = importDefault(674) /* metro dependency 674 */;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object4.backgroundColor = value2(WHITE).alpha(0.9).css();
|
|
object2.gifTag = object4;
|
|
const PRIMARY_800 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_800;
|
|
object2.gifTagText = {color: PRIMARY_800, fontSize: 14};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfileBanner.tsx');
|
|
exports.default = UserProfileBanner;
|
|
}
|
|
|
|
function UserProfileBanner({user, displayProfile, style, bannerSafeArea, bannerHeight = BANNER_HEIGHT, pendingBanner, pendingAvatarSrc, pendingAccentColor, pendingThemeColors, disableInteraction}) { // fn#67445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8692:551, offset: 0x01c22cff, size: 758 bytes, params: 2, frame: 29
|
|
var r4;
|
|
var PressableOpacity;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
if (bannerSafeArea !== undefined) {
|
|
}
|
|
disableInteraction = !(disableInteraction === undefined) && disableInteraction;
|
|
const styles = useStyles();
|
|
const GifAutoPlay = (require(3829) /* metro dependency 3829: UserSettings */).GifAutoPlay;
|
|
const value6 = GifAutoPlay.useSetting();
|
|
const [property, env0_7] = bannerHeight(pendingAccentColor.useState(false), 2);
|
|
let r9 = value6 || property;
|
|
const env0_8 = (require(8420) /* metro dependency 8420: ProfileCustomizationUtils */).useUserProfileBannerBackgroundColor({user: user,
|
|
guildId: displayProfile?.guildId, pendingAvatarSrc: pendingAvatarSrc, displayProfile: displayProfile});
|
|
const r2 = pendingBanner !== undefined ? displayProfile?.getPreviewBanner(pendingBanner, r9,
|
|
600) : displayProfile?.getBannerURL({canAnimate: r9, size: 600});
|
|
const env0_9 = r2 != null ? (require(1423) /* metro dependency 1423: AvatarUtils */).makeSource(r2) : null;
|
|
const isAnimatedImageURL2 = (require(1423) /* metro dependency 1423: AvatarUtils */).isAnimatedImageURL(r2);
|
|
const closure = renderBanner;
|
|
if (isAnimatedImageURL2) {
|
|
if (value6) {
|
|
r4 = closure();
|
|
} else if (disableInteraction) {
|
|
r4 = closure();
|
|
} else {
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
var pressableOpacityProps = {onPress: onPress_67447, accessibilityRole: 'button',
|
|
accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3fzj/l'])};
|
|
items2 = [closure()];
|
|
r9 = !r9 && ((Caption) => <Caption label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.I5gL2H)} style={styles.gifTag} textStyle={styles.gifTagText} />)((require(8509) /* metro dependency 8509: Caption */).Caption);
|
|
items2[1] = r9;
|
|
r4 = <PressableOpacity {...pressableOpacityProps}>{items2}</PressableOpacity>;
|
|
}
|
|
} else {
|
|
r4 = closure();
|
|
}
|
|
return (
|
|
<View style={styles.bannerContainer}>
|
|
{r4}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function renderBanner() { // fn#67446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8692:1162, owner: UserProfileBanner.renderBanner, offset: 0x01c22ff5, size: 176 bytes, params: 1, frame: 19
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
const Banner = importDefault(8508) /* metro dependency 8508: Banner */;
|
|
const styleBinding = style;
|
|
let r0 = pendingThemeColors == null ? value : pendingThemeColors[0];
|
|
r0 = r0 ?? pendingAccentColor;
|
|
r0 = r0 ?? (displayProfile == null ? value : displayProfile.primaryColor);
|
|
r0 = r0 ?? env0_8;
|
|
return (
|
|
<Banner
|
|
style={styleBinding}
|
|
bannerSource={env0_9}
|
|
backgroundColor={r0}
|
|
bannerSafeArea={bannerSafeArea}
|
|
bannerHeight={env0_3}
|
|
key={displayProfile == null ? value : displayProfile.banner}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function UserProfileBannerOnPress() { // fn#67447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8692:1490, owner: UserProfileBanner.onPress, offset: 0x01c230a5, size: 23 bytes, params: 1, frame: 11
|
|
env0_7(!env0_6);
|
|
}
|
|
|