110 lines
6.8 KiB
TypeScript
110 lines
6.8 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] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Module00674 from '../../../by-id/module-00674.js'; /* Metro dependency 674 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import Banner from '../../profile_customization/native/Banner.tsx'; /* Metro dependency 8508 */
|
|
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 UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
object.bannerContainer = {position: 'relative'};
|
|
const object3 = {'position': 'absolute', 'left': 12, 'top': 12, 'right': 'auto', 'bottom': 'auto'};
|
|
const WHITE = (Native).unsafe_rawColors.WHITE;
|
|
object3.backgroundColor = Module00674(WHITE).alpha(0.9).css();
|
|
object.gifTag = object3;
|
|
const PRIMARY_800 = (Native).unsafe_rawColors.PRIMARY_800;
|
|
object.gifTagText = {color: PRIMARY_800, fontSize: 14};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 object;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
if (bannerSafeArea !== undefined) {
|
|
}
|
|
disableInteraction = !(disableInteraction === undefined) && disableInteraction;
|
|
const styles = useStyles();
|
|
const GifAutoPlay = (UserSettingsModule).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 renderBanner2 = renderBanner;
|
|
if (isAnimatedImageURL2) {
|
|
if (value6) {
|
|
r4 = renderBanner2();
|
|
} else if (disableInteraction) {
|
|
r4 = renderBanner2();
|
|
} 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 = [renderBanner2()];
|
|
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 = renderBanner2();
|
|
}
|
|
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 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={Module00057}
|
|
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(!ConstantsModule.BANNER_HEIGHT);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun67444, 8507, [57, 31, 27, 661, 33, 4501, 674, 697, 3829, 8420, 1423, 8508, 5278, 1244, 8509,
|
|
2]) /* metro module 8507, dependencies: [57, 31, 27, 661, 33, 4501, 674, 697, 3829, 8420, 1423, 8508, 5278, 1244, 8509, 2] */;
|