decord/source/modules/guild/native/GuildIconUploader.tsx
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

124 lines
5.6 KiB
TypeScript

// Module ID: 11929
// Function ID: 11930
// Name: GuildIconUploader
// Dependencies: [19, 17, 1181, 21, 4636, 576, 4347, 4488, 11930, 11931, 4632, 1114, 11932, 11933, 5204, 2]
// Module 11929 (GuildIconUploader)
import nativeDefault from "native" /* 576 */;
import util from "util" /* 1114 */;
import shared from "shared" /* 4488 */;
import Text_Text from "Text/Text" /* 4632 */;
import Pressables from "Pressables" /* 5204 */;
import _modDef11932 from "module_11932" /* 11932 */;
import _modDef11933 from "module_11933" /* 11933 */;
import noop from "module_19" /* 19 */;
import ThemeStore from "ThemeStore" /* 1181 */;
require = fn;
get_ActivityIndicator = fn(17);
({ View: c3, Image: closure_4 } = get_ActivityIndicator);
const jsxProd = fn(21);
({ jsx: metroRequire, jsxs: closure_7 } = jsxProd);
const createStyles = fn(4636);
let obj2 = { container: { width: 82, height: 82, marginTop: 4 }, guildPlaceholder: { backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH }, 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: null, emptyIconWrapper: null, emptyGuildIcon: null, emptyGuildIconText: null, uploadIcon: null };
let size = { width: 32, height: 32, borderRadius: nativeDefault.radii.lg, justifyContent: "center", alignItems: "center", backgroundColor: nativeDefault.colors.INTERACTIVE_TEXT_ACTIVE };
obj2.filledIconWrapper = size;
const size1 = { position: "absolute", top: -4, right: -4, width: 32, height: 32, borderRadius: nativeDefault.radii.lg, backgroundColor: nativeDefault.colors.BACKGROUND_BRAND, justifyContent: "center", alignItems: "center" };
obj2.emptyIconWrapper = size1;
let obj3 = { backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH };
obj2.emptyGuildIcon = { borderWidth: 2, borderStyle: "dashed", justifyContent: "center", alignItems: "center", borderColor: nativeDefault.colors.INTERACTIVE_TEXT_DEFAULT };
obj2.emptyGuildIconText = { textAlign: "center", lineHeight: 16, paddingTop: 4 };
obj2.uploadIcon = { height: 16, width: 16 };
let closure_8 = createStyles.createLegacyClassComponentStyles(obj2);
const PureComponent = noop.PureComponent;
class GuildIconUploader extends PureComponent {
}
const prototype = GuildIconUploader.prototype;
prototype["renderIcon"] = function renderIcon() {
const tmp = closure_8(this.context);
const icon = this.props.icon;
if (null != icon) {
const obj2 = { style: null, source: null };
const items = [, ];
({ guildIcon: arr2[0], guildPlaceholder: arr2[1] } = tmp);
obj2.style = items;
const obj3 = { uri: icon };
obj2.source = obj3;
let tmp6Result = timestampProducer(React4, obj2);
} else {
const obj4 = { style: null, children: null };
const items1 = [, ];
({ guildIcon: arr3[0], emptyGuildIcon: arr3[1] } = tmp);
obj4.style = items1;
if (obj6.isThemeDark(ThemeStore.theme)) {
let tmp13Result = tmp13(11930);
} else {
tmp13Result = tmp13(11931);
}
const obj = { source: tmp13Result };
const items2 = [timestampProducer(React4, obj), ];
const obj5 = { style: tmp.emptyGuildIconText, variant: "text-xs/bold", color: "text-default", children: null };
const intl = tmp10(1114).intl;
obj6 = shared;
const tmp6 = React5;
const tmp7 = React3;
obj5.children = intl.string(util.t["3UB9ad"]).toUpperCase();
items2[1] = timestampProducer(Text_Text.Text, obj5);
obj4.children = items2;
tmp6Result = tmp6(tmp7, obj4);
const str = intl.string(util.t["3UB9ad"]);
}
return tmp6Result;
};
prototype["renderUpload"] = function renderUpload() {
const tmp = closure_8(this.context);
const props = this.props;
const iconBackgroundColor = props.iconBackgroundColor;
if (null != props.icon) {
const obj2 = { style: null, children: null };
const items = [tmp.iconWrapperBorder, ];
const obj3 = { backgroundColor: iconBackgroundColor };
items[1] = obj3;
obj2.style = items;
const obj4 = { style: tmp.filledIconWrapper, children: null };
const obj5 = { style: null, source: null };
const items1 = [tmp.uploadIcon, ];
const obj6 = { tintColor: iconBackgroundColor };
items1[1] = obj6;
obj5.style = items1;
obj5.source = _modDef11932;
obj4.children = tmp2(React4, obj5);
obj2.children = tmp2(tmp3, obj4);
let obj = obj2;
} else {
obj = { style: tmp.emptyIconWrapper, children: null };
const obj7 = { source: _modDef11933 };
obj.children = tmp2(React4, obj7);
}
return timestampProducer(React3, obj);
};
prototype["render"] = function render() {
const self = this;
const tmp = closure_8(this.context);
({ style, onPress, icon } = this.props);
if (null != icon) {
const intl2 = tmp3(1114).intl;
let stringResult = intl2.string(tmp3(1114).t.VATxfe);
} else {
const intl = tmp3(1114).intl;
stringResult = intl.string(tmp3(1114).t["MsUY/S"]);
}
const obj = { accessibilityRole: "button", accessibilityLabel: stringResult, onPress, children: null };
const obj2 = { style: null, children: null };
const items = [tmp.container, style];
obj2.style = items;
const items1 = [timestampProducer(React3, { style: tmp.guildIcon, children: self.renderIcon() }), self.renderUpload()];
obj2.children = items1;
obj.children = React5(React3, obj2);
return timestampProducer(Pressables.PressableOpacity, obj);
};
GuildIconUploader.contextType = fn(4347).ThemeContext;
size = fn(2);
const result = size.fileFinishedImporting("modules/guild/native/GuildIconUploader.tsx");
export default GuildIconUploader;