decord/source/modules/user_profile/native/UserProfileBanner.tsx

130 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9024
// Function ID: 9025
2026-07-20 16:05:17 +00:00
// Name: UserProfileBanner
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 676, 21, 4668, 4069, 8451, 1435, 9025, 5438, 1236, 9026, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 9024 (UserProfileBanner)
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { BANNER_HEIGHT } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-08-14 17:33:39 +00:00
let closure_9 = createCacheKey.createStyles({ bannerContainer: { position: "relative" }, gifTag: { position: "absolute", left: 12, top: 12, right: "auto", bottom: "auto" } });
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileBanner.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileBanner(displayProfile) {
displayProfile = displayProfile.displayProfile;
2026-07-23 10:11:24 +00:00
({ style: importDefault, bannerSafeArea } = displayProfile);
2026-07-20 16:05:17 +00:00
if (bannerSafeArea === undefined) {
bannerSafeArea = 0;
}
let bannerHeight = displayProfile.bannerHeight;
if (bannerHeight === undefined) {
2026-07-23 10:11:24 +00:00
bannerHeight = first;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
({ pendingBanner, pendingAccentColor: closure_4, pendingThemeColors: View, disableInteraction, pendingAvatarSrc } = displayProfile);
2026-07-20 16:05:17 +00:00
if (disableInteraction === undefined) {
disableInteraction = false;
}
2026-07-23 10:11:24 +00:00
first = undefined;
2026-08-24 06:08:38 +00:00
closure_7 = undefined;
closure_8 = undefined;
2026-07-23 10:11:24 +00:00
let source;
const tmp = source();
2026-08-14 17:33:39 +00:00
const GifAutoPlay = displayProfile(bannerSafeArea[6]).GifAutoPlay;
2026-07-20 16:05:17 +00:00
const setting = GifAutoPlay.useSetting();
2026-07-29 08:29:29 +00:00
const tmp5 = bannerHeight(React.useState(false), 2);
first = tmp5[0];
closure_7 = tmp5[1];
let tmp7 = setting;
2026-07-20 16:05:17 +00:00
if (!setting) {
2026-07-29 08:29:29 +00:00
tmp7 = first;
2026-07-20 16:05:17 +00:00
}
2026-08-14 17:33:39 +00:00
let tmp2Result = tmp2(tmp3[7]);
2026-07-29 08:29:29 +00:00
let obj = { user: displayProfile.user, guildId: null, pendingAvatarSrc: null, displayProfile: null };
2026-07-20 16:05:17 +00:00
let guildId;
2026-07-29 08:29:29 +00:00
if (displayProfile != null) {
2026-07-20 16:05:17 +00:00
guildId = displayProfile.guildId;
}
2026-07-29 08:29:29 +00:00
obj[1] = guildId;
obj[2] = pendingAvatarSrc;
obj[3] = displayProfile;
closure_8 = tmp2Result.useUserProfileBannerBackgroundColor(obj);
2026-07-20 16:05:17 +00:00
if (undefined !== pendingBanner) {
let previewBanner;
2026-07-29 08:29:29 +00:00
if (displayProfile != null) {
previewBanner = displayProfile.getPreviewBanner(pendingBanner, tmp7, 600);
2026-07-20 16:05:17 +00:00
}
let bannerURL = previewBanner;
2026-07-29 08:29:29 +00:00
} else if (displayProfile != null) {
obj = { canAnimate: null, size: 600 };
obj[0] = tmp7;
2026-07-20 16:05:17 +00:00
bannerURL = displayProfile.getBannerURL(obj);
}
2026-07-23 10:11:24 +00:00
source = null;
2026-07-20 16:05:17 +00:00
if (null != bannerURL) {
2026-08-14 17:33:39 +00:00
tmp2Result = tmp2(tmp3[8]);
2026-07-29 08:29:29 +00:00
source = tmp2Result.makeSource(bannerURL);
}
function renderBanner() {
const obj = { style: closure_1, bannerSource: source, backgroundColor: null, bannerSafeArea: null, bannerHeight: null };
2026-08-24 06:08:38 +00:00
first = undefined;
2026-07-29 08:29:29 +00:00
if (table != null) {
first = table[0];
}
if (first == null) {
2026-08-24 06:08:38 +00:00
first = closure_4;
2026-07-29 08:29:29 +00:00
}
if (first == null) {
let primaryColor;
if (displayProfile != null) {
primaryColor = displayProfile.primaryColor;
}
first = primaryColor;
}
if (first == null) {
first = closure_8;
}
obj[2] = first;
obj[3] = bannerSafeArea;
obj[4] = bannerHeight;
let banner;
if (displayProfile != null) {
banner = displayProfile.banner;
}
2026-08-24 06:08:38 +00:00
return closure_7(closure_1_1(bannerSafeArea[9]), obj, banner);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { style: tmp.bannerContainer, children: null };
2026-07-29 08:29:29 +00:00
if (tmp2Result1.isAnimatedImageURL(bannerURL)) {
2026-07-20 16:05:17 +00:00
if (!setting) {
if (!disableInteraction) {
2026-07-29 08:29:29 +00:00
const obj2 = { onPress: null, accessibilityRole: "button", accessibilityLabel: null, children: null };
obj2[0] = function onPress() {
callback(!first);
2026-07-20 16:05:17 +00:00
};
2026-08-14 17:33:39 +00:00
const intl = tmp2(tmp3[11]).intl;
obj2[2] = intl.string(tmp2(tmp3[11]).t["3fzj/l"]);
2026-07-20 16:05:17 +00:00
const items = [renderBanner(), ];
2026-08-14 17:33:39 +00:00
let tmp12Result = null;
2026-07-29 08:29:29 +00:00
if (!tmp7) {
2026-08-14 17:33:39 +00:00
const obj3 = { style: null };
obj3[0] = tmp.gifTag;
tmp12Result = tmp12(importDefault(tmp3[12]), obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[1] = tmp12Result;
obj2[3] = items;
2026-08-14 17:33:39 +00:00
let renderBannerResult = closure_8(tmp2(tmp3[10]).PressableOpacity, obj2);
2026-07-20 16:05:17 +00:00
const tmp14 = closure_8;
}
2026-07-29 08:29:29 +00:00
obj1[1] = renderBannerResult;
2026-07-20 16:05:17 +00:00
return tmp12(tmp13, obj1);
}
}
renderBannerResult = renderBanner();
};