decord/source/modules/guild/native/GuildIconUploader.tsx

136 lines
6.3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11358
// Function ID: 11359
2026-07-29 08:29:29 +00:00
// Name: renderIcon
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 1302, 21, 4380, 712, 4108, 1363, 11359, 11360, 4376, 1236, 11361, 11362, 4949, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 11358 (renderIcon)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import AccessibilityAnnouncer from "AccessibilityAnnouncer" /* 1363 */;
2026-08-25 06:04:03 +00:00
import Text from "Text" /* 4376 */;
import PressableBase from "PressableBase" /* 4949 */;
import registerAssetDefault from "registerAsset" /* 11361 */;
import registerAssetDefault2 from "registerAsset" /* 11362 */;
2026-08-24 06:08:38 +00:00
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import closure_5 from "handleThemeChange" /* 1302 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ View: c3, Image: c4 } = get_ActivityIndicator);
({ jsx: closure_6, jsxs: error } = jsxProd);
createCacheKey = { container: { width: 82, height: 82, marginTop: 4 }, guildPlaceholder: null, guildIcon: null, iconWrapperBorder: null, filledIconWrapper: null, emptyIconWrapper: null, emptyGuildIcon: null, emptyGuildIconText: null, uploadIcon: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH };
2026-07-29 08:29:29 +00:00
createCacheKey[1] = createCacheKey;
createCacheKey[2] = { width: 82, height: 82, borderRadius: 41 };
createCacheKey[3] = { position: "absolute", top: -8, right: -8, width: 40, height: 40, borderRadius: 20, justifyContent: "center", alignItems: "center" };
2026-08-24 06:08:38 +00:00
createCacheKey[4] = { width: 32, height: 32, borderRadius: ThemesDefault.radii.lg, justifyContent: "center", alignItems: "center", backgroundColor: ThemesDefault.colors.INTERACTIVE_TEXT_ACTIVE };
let obj1 = { width: 32, height: 32, borderRadius: ThemesDefault.radii.lg, justifyContent: "center", alignItems: "center", backgroundColor: ThemesDefault.colors.INTERACTIVE_TEXT_ACTIVE };
createCacheKey[5] = { position: "absolute", top: -4, right: -4, width: 32, height: 32, borderRadius: ThemesDefault.radii.lg, backgroundColor: ThemesDefault.colors.BACKGROUND_BRAND, justifyContent: "center", alignItems: "center" };
let obj2 = { position: "absolute", top: -4, right: -4, width: 32, height: 32, borderRadius: ThemesDefault.radii.lg, backgroundColor: ThemesDefault.colors.BACKGROUND_BRAND, justifyContent: "center", alignItems: "center" };
createCacheKey[6] = { borderWidth: 2, borderStyle: "dashed", justifyContent: "center", alignItems: "center", borderColor: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
2026-07-29 08:29:29 +00:00
createCacheKey[7] = { textAlign: "center", lineHeight: 16, paddingTop: 4 };
createCacheKey[8] = { height: 16, width: 16 };
2026-08-24 06:08:38 +00:00
let closure_8 = createCacheKey.createLegacyClassComponentStyles(createCacheKey);
2026-07-29 08:29:29 +00:00
const PureComponent = importAllResult.PureComponent;
class GuildIconUploader extends PureComponent {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = GuildIconUploader.prototype;
prototype["renderIcon"] = function renderIcon() {
2026-08-24 06:08:38 +00:00
const tmp = callback3(this.context);
2026-07-29 08:29:29 +00:00
const icon = this.props.icon;
if (null != icon) {
let obj = { style: null, source: null };
const items = [, ];
({ guildIcon: arr2[0], guildPlaceholder: arr2[1] } = tmp);
obj[0] = items;
obj = { uri: null };
obj[0] = icon;
obj[1] = obj;
let tmp6Result = callback(closure_4, obj);
} else {
2026-08-24 06:08:38 +00:00
obj1 = { style: null, children: null };
2026-07-29 08:29:29 +00:00
const items1 = [, ];
({ guildIcon: arr3[0], emptyGuildIcon: arr3[1] } = tmp);
obj1[0] = items1;
if (obj6.isThemeDark(theme.theme)) {
2026-08-25 06:04:03 +00:00
let tmp13Result = tmp13(11359);
2026-07-29 08:29:29 +00:00
} else {
2026-08-25 06:04:03 +00:00
tmp13Result = tmp13(11360);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { source: null };
obj[0] = tmp13Result;
const items2 = [callback(closure_4, obj), ];
const obj2 = { style: null, variant: "text-xs/bold", color: "text-default", children: null };
obj2[0] = tmp.emptyGuildIconText;
const intl = tmp10(1236).intl;
2026-08-24 06:08:38 +00:00
obj6 = AccessibilityAnnouncer;
2026-07-29 08:29:29 +00:00
const tmp6 = closure_7;
const tmp7 = closure_3;
const tmp9 = closure_4;
2026-08-24 06:08:38 +00:00
obj2[3] = intl.string(getSystemLocale.t["3UB9ad"]).toUpperCase();
items2[1] = callback(Text.Text, obj2);
2026-07-29 08:29:29 +00:00
obj1[1] = items2;
tmp6Result = tmp6(tmp7, obj1);
2026-08-24 06:08:38 +00:00
const str = intl.string(getSystemLocale.t["3UB9ad"]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6Result;
};
prototype["renderUpload"] = function renderUpload() {
2026-08-24 06:08:38 +00:00
const tmp = callback3(this.context);
2026-07-29 08:29:29 +00:00
const props = this.props;
const iconBackgroundColor = props.iconBackgroundColor;
if (null != props.icon) {
let obj = { style: null, children: null };
const items = [tmp.iconWrapperBorder, ];
obj = { backgroundColor: null };
obj[0] = iconBackgroundColor;
items[1] = obj;
obj[0] = items;
2026-08-24 06:08:38 +00:00
obj1 = { style: null, children: null };
2026-07-29 08:29:29 +00:00
obj1[0] = tmp.filledIconWrapper;
const obj2 = { style: null, source: null };
const items1 = [tmp.uploadIcon, ];
const obj3 = { tintColor: null };
obj3[0] = iconBackgroundColor;
items1[1] = obj3;
obj2[0] = items1;
2026-08-24 06:08:38 +00:00
obj2[1] = registerAssetDefault;
2026-07-29 08:29:29 +00:00
obj1[1] = tmp2(closure_4, obj2);
obj[1] = tmp2(tmp3, obj1);
} else {
obj = { style: null, children: null };
obj[0] = tmp.emptyIconWrapper;
const obj4 = { source: null };
2026-08-24 06:08:38 +00:00
obj4[0] = registerAssetDefault2;
2026-07-29 08:29:29 +00:00
obj[1] = tmp2(closure_4, obj4);
}
return closure_6(closure_3, obj);
};
prototype["render"] = function render() {
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = callback3(this.context);
2026-07-29 08:29:29 +00:00
({ style, onPress, icon } = this.props);
if (null != icon) {
const intl2 = tmp3(1236).intl;
let stringResult = intl2.string(tmp3(1236).t.VATxfe);
} else {
const intl = tmp3(1236).intl;
stringResult = intl.string(tmp3(1236).t["MsUY/S"]);
}
let obj = { accessibilityRole: "button", accessibilityLabel: stringResult, onPress, children: null };
obj = { style: items, children: null };
items = [tmp.container, style];
obj = { style: tmp.guildIcon, children: self.renderIcon() };
const items1 = [closure_6(closure_3, obj), self.renderUpload()];
obj[1] = items1;
obj[3] = callback2(closure_3, obj);
2026-08-24 06:08:38 +00:00
return closure_6(PressableBase.PressableOpacity, obj);
2026-07-29 08:29:29 +00:00
};
GuildIconUploader.contextType = require("ManaContext").ThemeContext;
2026-08-24 06:08:38 +00:00
let obj3 = { borderWidth: 2, borderStyle: "dashed", justifyContent: "center", alignItems: "center", borderColor: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
const result = require("set").fileFinishedImporting("modules/guild/native/GuildIconUploader.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default GuildIconUploader;