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

145 lines
5.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 11312
// Function ID: 11313
// Name: GuildIconUploader
2026-10-09 10:00:15 +00:00
// Dependencies: [19, 17, 1205, 21, 5091, 587, 4788, 6163, 4930, 11313, 11314, 5087, 1126, 11315, 11316, 6191, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 11312 (GuildIconUploader)
import react_native from "react-native" /* 17 */;
2026-10-03 08:58:59 +00:00
import nativeDefault from "native" /* 587 */;
import intl3 from "intl" /* 1126 */;
2026-10-09 10:00:15 +00:00
import native from "native" /* 4788 */;
import shared from "shared" /* 4930 */;
import FastImageDefault from "FastImage" /* 6163 */;
import Pressables from "Pressables" /* 6191 */;
import AssetRegistryDefault from "AssetRegistry" /* 11315 */;
import AssetRegistryDefault2 from "AssetRegistry" /* 11316 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
2026-10-08 09:57:35 +00:00
import ThemeStore from "ThemeStore" /* 1205 */;
2026-10-03 08:58:59 +00:00
import Fragment from "Fragment" /* 21 */;
2026-10-09 10:00:15 +00:00
import createStyles from "createStyles" /* 5091 */;
2026-10-03 08:58:59 +00:00
import size_mod from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-09 10:00:15 +00:00
let hasOwnProperty;
2026-10-03 08:58:59 +00:00
let metroRequire;
let obj2;
let obj3;
let size;
let size1;
2026-10-09 10:00:15 +00:00
const View = react_native.View;
({ jsx: hasOwnProperty, jsxs: metroRequire } = Fragment);
2026-10-03 08:58:59 +00:00
let obj = { container: { width: 82, height: 82, marginTop: 4 }, guildPlaceholder: obj2, guildIcon: { width: 82, height: 82, borderRadius: 41 }, iconWrapperBorder: { position: "absolute", top: -8, right: -8, width: 40, height: 40, borderRadius: 20, justifyContent: "center", alignItems: "center" }, filledIconWrapper: size, emptyIconWrapper: size1, emptyGuildIcon: obj3, emptyGuildIconText: { textAlign: "center", lineHeight: 16, paddingTop: 4 }, uploadIcon: { height: 16, width: 16 } };
obj2 = { backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
const createLegacyClassComponentStyles = createStyles.createLegacyClassComponentStyles;
size = { width: 32, height: 32, borderRadius: nativeDefault.radii.lg, justifyContent: "center", alignItems: "center", backgroundColor: nativeDefault.colors.INTERACTIVE_TEXT_ACTIVE };
size1 = { position: "absolute", top: -4, right: -4, width: 32, height: 32, borderRadius: nativeDefault.radii.lg, backgroundColor: nativeDefault.colors.BACKGROUND_BRAND, justifyContent: "center", alignItems: "center" };
obj3 = { borderWidth: 2, borderStyle: "dashed", justifyContent: "center", alignItems: "center", borderColor: nativeDefault.colors.INTERACTIVE_TEXT_DEFAULT };
2026-10-09 10:00:15 +00:00
const metroImportDefault = createLegacyClassComponentStyles(obj);
2026-10-03 08:58:59 +00:00
const PureComponent = react.PureComponent;
2026-07-29 08:29:29 +00:00
class GuildIconUploader extends PureComponent {
2026-10-03 08:58:59 +00:00
renderIcon() {
let items;
let items1;
let items2;
let obj3;
let str;
2026-10-08 09:57:35 +00:00
let tmp7Result;
2026-10-09 10:00:15 +00:00
const tmp = closure_7(this.context);
2026-10-03 08:58:59 +00:00
const icon = this.props.icon;
if (null != icon) {
const obj2 = { style: items, source: obj3 };
items = [, ];
({ guildIcon: arr2[0], guildPlaceholder: arr2[1] } = tmp);
obj3 = { uri: icon };
2026-10-09 10:00:15 +00:00
tmp7Result = hasOwnProperty(FastImageDefault, obj2);
2026-07-29 08:29:29 +00:00
} else {
2026-10-09 10:00:15 +00:00
let tmp10Result;
2026-10-03 08:58:59 +00:00
const obj4 = { style: items1, children: items2 };
items1 = [, ];
({ guildIcon: arr3[0], emptyGuildIcon: arr3[1] } = tmp);
2026-10-09 10:00:15 +00:00
const tmp12 = FastImageDefault;
2026-10-03 08:58:59 +00:00
const obj6 = shared;
2026-10-09 10:00:15 +00:00
const tmp7 = metroRequire;
const tmp8 = View;
2026-10-03 08:58:59 +00:00
if (obj6.isThemeDark(ThemeStore.theme)) {
2026-10-09 10:00:15 +00:00
tmp10Result = tmp10(11313);
2026-10-03 08:58:59 +00:00
} else {
2026-10-09 10:00:15 +00:00
tmp10Result = tmp10(11314);
2026-10-03 08:58:59 +00:00
}
2026-10-09 10:00:15 +00:00
const obj = { source: tmp10Result };
items2 = [hasOwnProperty(tmp12, obj), ];
2026-10-03 08:58:59 +00:00
const obj5 = { style: tmp.emptyGuildIconText, variant: "text-xs/bold", color: "text-default", children: str.toUpperCase() };
2026-10-09 10:00:15 +00:00
const Text = tmp13(5087).Text;
const intl = tmp13(1126).intl;
2026-10-03 08:58:59 +00:00
str = intl.string(intl3.t["3UB9ad"]);
2026-10-09 10:00:15 +00:00
items2[1] = hasOwnProperty(Text, obj5);
2026-10-08 09:57:35 +00:00
tmp7Result = tmp7(tmp8, obj4);
2026-07-20 16:05:17 +00:00
}
2026-10-08 09:57:35 +00:00
return tmp7Result;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
renderUpload() {
let items;
let items1;
let obj;
let obj4;
let obj5;
let obj7;
2026-10-09 10:00:15 +00:00
let tmp6;
let tmp9;
const tmp = closure_7(this.context);
2026-10-03 08:58:59 +00:00
const props = this.props;
const iconBackgroundColor = props.iconBackgroundColor;
if (null != props.icon) {
2026-10-09 10:00:15 +00:00
const obj2 = { style: items, children: hasOwnProperty(View, obj4) };
2026-10-03 08:58:59 +00:00
items = [tmp.iconWrapperBorder, ];
const obj3 = { backgroundColor: iconBackgroundColor };
items[1] = obj3;
2026-10-09 10:00:15 +00:00
obj4 = { style: tmp.filledIconWrapper, children: hasOwnProperty(tmp9, obj5) };
2026-10-03 08:58:59 +00:00
obj5 = { style: items1, source: AssetRegistryDefault };
items1 = [tmp.uploadIcon, ];
const obj6 = { tintColor: iconBackgroundColor };
items1[1] = obj6;
obj = obj2;
2026-10-09 10:00:15 +00:00
tmp9 = FastImageDefault;
2026-10-03 08:58:59 +00:00
} else {
2026-10-09 10:00:15 +00:00
obj = { style: tmp.emptyIconWrapper, children: hasOwnProperty(tmp6, obj7) };
2026-10-03 08:58:59 +00:00
obj7 = { source: AssetRegistryDefault2 };
2026-10-09 10:00:15 +00:00
tmp6 = FastImageDefault;
2026-10-03 08:58:59 +00:00
}
2026-10-09 10:00:15 +00:00
return hasOwnProperty(View, obj);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
render() {
let icon;
let items;
let items1;
let obj2;
let onPress;
let stringResult;
let style;
const self = this;
2026-10-09 10:00:15 +00:00
const tmp = closure_7(this.context);
2026-10-03 08:58:59 +00:00
({ style, onPress, icon } = this.props);
const PressableOpacity = Pressables.PressableOpacity;
if (null != icon) {
const intl2 = tmp3(1126).intl;
stringResult = intl2.string(tmp3(1126).t.VATxfe);
} else {
const intl = tmp3(1126).intl;
stringResult = intl.string(tmp3(1126).t["MsUY/S"]);
}
2026-10-09 10:00:15 +00:00
const obj = { accessibilityRole: "button", accessibilityLabel: stringResult, onPress, children: metroRequire(View, obj2) };
2026-10-03 08:58:59 +00:00
obj2 = { style: items, children: items1 };
items = [tmp.container, style];
items1 = [, ];
const obj3 = { style: tmp.guildIcon, children: self.renderIcon() };
2026-10-09 10:00:15 +00:00
items1[0] = hasOwnProperty(View, obj3);
2026-10-03 08:58:59 +00:00
items1[1] = self.renderUpload();
2026-10-09 10:00:15 +00:00
return hasOwnProperty(PressableOpacity, obj);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
}
const prototype = GuildIconUploader.prototype;
GuildIconUploader.contextType = native.ThemeContext;
size = size_mod;
const result = size.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;