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

104 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 14005
// Function ID: 14006
2026-07-20 16:05:17 +00:00
// Name: ProfilePreviewButton
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 17, 21, 4661, 712, 7139, 8934, 8929, 5433, 1236, 4734, 9925, 8972, 8987, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-15 05:55:55 +00:00
// Module 14005 (ProfilePreviewButton)
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-20 16:05:17 +00:00
function ProfilePreviewButton(userId) {
userId = userId.userId;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
let context;
2026-07-23 10:11:24 +00:00
analyticsLocations = analyticsLocations(context[5])().analyticsLocations;
let obj = userId(context[6]);
context = obj.useUserProfileAnalyticsContext().context;
2026-07-20 16:05:17 +00:00
const items = [userId, context, analyticsLocations];
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (null != userId) {
2026-07-29 08:29:29 +00:00
obj = { style: null, onPress: null, accessibilityRole: "button", accessibilityLabel: null, children: null };
obj[0] = tmp.previewButton;
obj[1] = tmp4;
const intl = tmp3(tmp2[9]).intl;
obj[3] = intl.string(tmp3(tmp2[9]).t["3Qcx6K"]);
obj = { variant: "text-sm/semibold", color: "text-overlay-light", children: null };
const intl2 = tmp3(tmp2[9]).intl;
obj[2] = intl2.string(tmp3(tmp2[9]).t["3Qcx6K"]);
obj[4] = callback(tmp3(tmp2[10]).Text, obj);
tmp5 = callback(tmp3(tmp2[8]).PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
function EditButton(disabled) {
let accessibilityLabel;
let onPress;
let flag = disabled.disabled;
({ onPress, accessibilityLabel } = disabled);
if (flag === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
let obj = { accessibilityRole: "button", accessibilityLabel, onPress, disabled: flag, style: createCacheKey().editButton, children: null };
obj = { size: "xs", color: null };
obj[1] = importDefault(712).colors.WHITE;
2026-08-15 05:55:55 +00:00
obj[5] = callback(require(9925) /* PencilIcon */.PencilIcon, obj);
return callback(require(5433) /* PressableBase */.PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ jsx: c5, jsxs: closure_6 } = jsxProd);
createCacheKey = { container: { position: "relative" }, editButton: null, previewButton: null };
createCacheKey = { position: "absolute", top: 12, right: 12, width: 28, height: 28, alignItems: "center", justifyContent: "center", backgroundColor: require("Themes").colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT, borderRadius: require("Themes").radii.round };
createCacheKey[1] = createCacheKey;
createCacheKey[2] = { position: "absolute", justifyContent: "center", minHeight: 28, top: 12, right: 48, paddingVertical: 4, paddingHorizontal: 12, borderRadius: require("Themes").radii.round, backgroundColor: require("Themes").colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT, zIndex: 1 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
const obj1 = { position: "absolute", justifyContent: "center", minHeight: 28, top: 12, right: 48, paddingVertical: 4, paddingHorizontal: 12, borderRadius: require("Themes").radii.round, backgroundColor: require("Themes").colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT, zIndex: 1 };
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("modules/user_profile/native/UserProfileEditBannerButton.tsx");
2026-07-20 16:05:17 +00:00
export default function UserProfileEditBannerButton(arg0) {
let bannerSafeArea;
let displayProfile;
let editButtonAccessibilityLabel;
let editDisabled;
let onPressEdit;
let pendingAccentColor;
let pendingAvatarSrc;
let pendingBanner;
let pendingThemeColors;
let showEditButton;
let showProfilePreviewButton;
let user;
({ user, showProfilePreviewButton, showEditButton } = arg0);
({ displayProfile, pendingBanner, pendingAvatarSrc, pendingThemeColors, pendingAccentColor, bannerSafeArea } = arg0);
if (showEditButton === undefined) {
showEditButton = true;
}
({ editDisabled, onPressEdit, editButtonAccessibilityLabel } = arg0);
if (editDisabled === undefined) {
editDisabled = false;
}
2026-07-29 08:29:29 +00:00
let obj = { style: createCacheKey().container, children: null };
const tmp = createCacheKey();
2026-08-15 05:55:55 +00:00
const items = [callback(importDefault(8987), { user, displayProfile, pendingBanner, pendingAvatarSrc, pendingThemeColors, pendingAccentColor, bannerHeight: importDefault(8972)(), bannerSafeArea }), , ];
2026-07-20 16:05:17 +00:00
if (showProfilePreviewButton) {
2026-07-29 08:29:29 +00:00
obj = { userId: null };
obj[0] = user.id;
showProfilePreviewButton = tmp5(ProfilePreviewButton, obj);
2026-07-20 16:05:17 +00:00
}
items[1] = showProfilePreviewButton;
if (showEditButton) {
2026-07-29 08:29:29 +00:00
obj = { onPress: null, accessibilityLabel: null, disabled: null };
obj[0] = onPressEdit;
obj[1] = editButtonAccessibilityLabel;
obj[2] = editDisabled;
showEditButton = tmp5(EditButton, obj);
2026-07-20 16:05:17 +00:00
}
items[2] = showEditButton;
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return closure_6(View, obj);
};