119 lines
8.3 KiB
TypeScript
119 lines
8.3 KiB
TypeScript
/* Metro module 15325; source: modules/launchpad/native/shared/SimpleGuild.tsx; dependencies: [31, 27, 1422, 5214, 1867, 661, 33, 4501, 6819, 15326, 566, 15327, 15329, 1244, 14421, 6682, 697, 15328, 2] */
|
|
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import GuildReadStateStore from '../../../../stores/GuildReadStateStore.tsx'; /* Metro dependency 5214 */
|
|
import UseSimpleGuildDefaultColors from './useSimpleGuildDefaultColors.tsx'; /* Metro dependency 15326 */
|
|
import UseSimpleGuildSize from './useSimpleGuildSize.tsx'; /* Metro dependency 15329 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as GuildRecordModule from '../../../../records/GuildRecord.tsx'; /* Metro dependency 1422 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as GuildsBarActivityIndicatorModule from '../../../guilds_bar/native/GuildsBarActivityIndicator.tsx'; /* Metro dependency 14421 */
|
|
import * as SimpleGuildContainerModule from './SimpleGuildContainer.tsx'; /* Metro dependency 15327 */
|
|
|
|
function _fun117208(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15522:6, offset: 0x024a8529, size: 286 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_10 = (CreateStylesModule).createStyles({dmsWrapper: {'flex': 1,
|
|
'justifyContent': 'center', 'alignItems': 'center'}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/shared/SimpleGuild.tsx');
|
|
exports.default = SimpleGuild;
|
|
function SimpleGuild({guildIconRef, style, guildId, onPress, onLongPress, onAccessibilityAction, onLayout, backgroundColor, animated, altDefaultBackground, selected, size, iconSize = require(dependencyMap[8]).GuildIconSizes.LARGE, borderRadius, unread, badge}) { // fn#117209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15522:379, offset: 0x024a8647, size: 1128 bytes, params: 2, frame: 47
|
|
var color;
|
|
var CutoutImage;
|
|
var object2;
|
|
var value23;
|
|
var value24;
|
|
var ChatIcon;
|
|
var colors;
|
|
animated = animated === undefined || animated;
|
|
altDefaultBackground = !(altDefaultBackground === undefined) && altDefaultBackground;
|
|
selected = !(selected === undefined) && selected;
|
|
const styles = useStyles();
|
|
const {iconStroke, iconBackground,
|
|
iconBackgroundBrand} = (UseSimpleGuildDefaultColors)();
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
let r17 = guild?.name ?? '';
|
|
const value10 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildReadStateStore],
|
|
function() {
|
|
var object = {};
|
|
var guildReadStateStoreBinding = GuildReadStateStore;
|
|
var guildIdBinding = guildId;
|
|
object.unread = guildReadStateStoreBinding.hasUnread(guildIdBinding);
|
|
object.badge = guildReadStateStoreBinding.getMentionCount(guildIdBinding);
|
|
return object;
|
|
}, [guildId]);
|
|
const unread2 = value10.unread;
|
|
const badge2 = value10.badge;
|
|
const badge22 = badge2;
|
|
const r2 = animated ? SimpleGuildContainerModule.SimpleGuildContainerAnimated : SimpleGuildContainerModule.SimpleGuildContainer;
|
|
const {containerSize, containerSizeStyle,
|
|
containerStyles} = (UseSimpleGuildSize)({size: size,
|
|
style: style});
|
|
const value13 = badge22.useMemo(_fun117212, [r17, unread2, badge2]);
|
|
const value14 = (GuildsBarActivityIndicatorModule).useActivityIndicatorState(guildId);
|
|
let r4 = unread2 || selected;
|
|
r4 = !r4 ? badge2 > 0 : r4;
|
|
r4 = (!r4 ? value14.source != null : r4) && backgroundColor === 'transparent';
|
|
r17 = guild != null ? getGuildIconSource(guild, containerSize, selected && !r4) : undefined;
|
|
const r15 = r17 === null || typeof r17 !== 'object' ? r17 != null : 'uri' in r17 ? r17.uri != null : r17 != null;
|
|
const r2Props = {guildIconRef: guildIconRef, guildId: guild?.id, style: containerStyles,
|
|
backgroundColor: backgroundColor, selected: selected, size: size, borderRadius: borderRadius, onPress: onPress,
|
|
onLongPress: onLongPress, unread: unread ?? unread2, badge: badge ?? badge2, onLayout: onLayout,
|
|
onAccessibilityAction: onAccessibilityAction, accessibilityLabel: value13, usingCutout: r4,
|
|
activityIndicatorState: value14};
|
|
if (guildId === ME) {
|
|
var viewBindingProps = {style: styles.dmsWrapper};
|
|
ChatIcon = (require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon;
|
|
colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
r4 = (
|
|
<View {...viewBindingProps}>
|
|
<ChatIcon color={selected ? colors.WHITE : colors.MOBILE_GUILDBAR_ICON_DEFAULT} />
|
|
</View>
|
|
);
|
|
} else if (r4) {
|
|
CutoutImage = importDefault(15328) /* metro dependency 15328: CutoutImage */;
|
|
object2 = {'cutoutBottomRightSize': null, 'cutoutBottomRightInsetX': 6, 'cutoutBottomRightInsetY': 7,
|
|
'cutoutTopRightSize': null, 'cutoutTopRightInsetX': 8, 'cutoutTopRightInsetY': 8};
|
|
value23 = 0;
|
|
value24 = 13;
|
|
object2.cutoutBottomRightSize = badge2 > value23 ? value24 : unread2 ? 11 : value23;
|
|
object2.cutoutTopRightSize = value14.source != null ? value24 : value23;
|
|
object2.imageSize = containerSize;
|
|
object2.imageSource = r17;
|
|
object2.imageBorderRadius = borderRadius;
|
|
color = r15 ? iconBackground.color : iconBackgroundBrand.color;
|
|
object2.imageBackgroundColor = color;
|
|
object2.clipOuterAmount = selected ? 3 : value23;
|
|
object2.borderStroke = 1;
|
|
color = iconStroke.color;
|
|
object2.borderStrokeColor = color;
|
|
r4 = <CutoutImage {...object2} />;
|
|
} else {
|
|
r4 = ((Component) => <Component guild={guild} size={iconSize} selected={selected} animate={selected} TABS_altDefaultBackground={altDefaultBackground} style={size != null ? containerSizeStyle : null} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */);
|
|
}
|
|
return ((Component) => <Component {...r2Props}>{r4}</Component>)(r2);
|
|
function _fun117212() { // fn#117212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15522:1122, offset: 0x024a8ae1, size: 297 bytes, params: 1, frame: 17
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
return env0_1 === '' ? env0_1 : badge == null ? unread === true ? intl.formatToPlainString(t.lzqe42,
|
|
{guildName: env0_1}) : intl.formatToPlainString(t['/uzRss'], {guildName: env0_1,
|
|
mentions: badge}) : badge > 0 ? intl.formatToPlainString(t['/uzRss'], {guildName: env0_1,
|
|
mentions: badge}) : unread === true ? intl.formatToPlainString(t.lzqe42,
|
|
{guildName: env0_1}) : intl.formatToPlainString(t['/uzRss'], {guildName: env0_1, mentions: badge});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117208, 15325, [31, 27, 1422, 5214, 1867, 661, 33, 4501, 6819, 15326, 566, 15327, 15329, 1244, 14421,
|
|
6682, 697, 15328,
|
|
2]) /* metro module 15325, dependencies: [31, 27, 1422, 5214, 1867, 661, 33, 4501, 6819, 15326, 566, 15327, 15329, 1244, 14421, 6682, 697, 15328, 2] */;
|