90 lines
6.1 KiB
TypeScript
90 lines
6.1 KiB
TypeScript
/* Metro module 15337; source: modules/launchpad/native/shared/renderChannelContent.tsx; dependencies: [31, 27, 10980, 4865, 33, 4501, 477, 15332, 5107, 15338, 4573, 6705, 8129, 14538, 2] */
|
|
function _fun117266(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15534:6, offset: 0x024abf7b, size: 446 bytes, params: 8, frame: 26
|
|
var object4;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = 0;
|
|
const env0_3 = importAll(dependencyMap[value]);
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const value2 = 2;
|
|
const SUBTITLE_OPACITY_NORMAL = require(dependencyMap[value2]).SUBTITLE_OPACITY_NORMAL;
|
|
const env0_6 = (require(4865) /* metro dependency 4865: ReadStateConstants */).UnreadSetting;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value3.jsx;
|
|
const env0_8 = value3.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object4 = {};
|
|
const object5 = {flex: 1};
|
|
object5.marginTop = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() ? value2 : -1;
|
|
object4.channelContent = object5;
|
|
object4.channelContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'space-between'};
|
|
object4.leftBox = {'flexDirection': 'column', 'alignItems': 'flex-start', 'flexShrink': 1};
|
|
object4.rightBox = {'flexDirection': 'column', 'alignItems': 'flex-end'};
|
|
object4.rightContentAbsolute = {'position': 'absolute', 'right': 0, 'top': 0};
|
|
object4.channelTraits = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
const object6 = {opacity: SUBTITLE_OPACITY_NORMAL, marginRight: 4};
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
object6.marginTop = platformUtilsModule.isAndroid() ? value2 : value;
|
|
object4.channelTraitIcon = object6;
|
|
const env0_9 = Reflect.apply(createStyles, createStylesModule, [object4]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/launchpad/native/shared/renderChannelContent.tsx');
|
|
exports.default = renderChannelContent_117268;
|
|
}
|
|
|
|
function ChannelContent({name, subtitle, unread, resolvedUnreadSetting, locked, muted, lastMessageTimestampString, channel, channelCategoryName, connected, mentionCount, mentionBadge, isSubscriptionGated, needSubscriptionToAccess}) { // fn#117267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15534:723, offset: 0x024ac139, size: 1190 bytes, params: 2, frame: 49
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
var object10;
|
|
var items4;
|
|
const styles = useStyles();
|
|
const value3 = (importDefault(15332) /* metro dependency 15332: getLayoutStyles */)();
|
|
let r34 = channel != null && (locked || (importDefault(5107) /* metro dependency 5107: isRoleRequired */)(channel));
|
|
let r33 = channel?.isNSFW();
|
|
const isValidElement2 = env0_3.isValidElement(subtitle);
|
|
const value7 = lastMessageTimestampString != null;
|
|
let r12 = value7 && mentionBadge == null;
|
|
const items3 = [styles.leftBox];
|
|
items3[1] = {justifyContent: isValidElement2 ? 'space-between' : 'center'};
|
|
const object = {'flexDirection': 'row', 'paddingRight': null, 'alignItems': 'center'};
|
|
object.paddingRight = r12 ? 30 : 0;
|
|
const items2 = [((Component) => <Component title={name} muted={muted} unread={unread} resolvedUnreadSetting={resolvedUnreadSetting ?? UnreadSetting.ONLY_MENTIONS} connected={connected} />)(importDefault(15338) /* metro dependency 15338: ChannelTitle */)];
|
|
items2[1] = channelCategoryName != null ? <Text variant="text-xs/bold" color="text-muted" style={{marginRight: 4}}>{channelCategoryName}</Text> : null;
|
|
let r24 = r34 || r33;
|
|
if (r24) {
|
|
var viewProps = {style: [styles.channelTraits, {maxWidth: 14 * (r34 && r33 ? 2 : 1)}]};
|
|
r34 = r34 && ((LockIcon) => <LockIcon size="xxs" color="icon-muted" style={styles.channelTraitIcon} />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon);
|
|
items4 = [r34];
|
|
r33 = r33 && ((WarningIcon) => <WarningIcon size="xxs" color="icon-muted" style={styles.channelTraitIcon} />)((require(8129) /* metro dependency 8129: WarningIcon */).WarningIcon);
|
|
items4[1] = r33;
|
|
items4[2] = isSubscriptionGated && ((Component) => <Component locked={needSubscriptionToAccess} isInMainTabsExperiment />)(importDefault(14538) /* metro dependency 14538: GuildRoleSubscriptionGatedChannelIcon */);
|
|
r24 = <View {...viewProps}>{items4}</View>;
|
|
}
|
|
items2[2] = r24;
|
|
const view = <View style={items3}><View style={object}>{items2}</View>{isValidElement2 ? <View style={[{paddingRight: (mentionCount ?? 0) > 0 ? 20 : 0},
|
|
{marginTop: value3.messagePreview.margin.marginTop}]}>{subtitle}</View> : null}</View>;
|
|
const r11 = r12 ? styles.rightContentAbsolute : styles.rightBox;
|
|
const items8 = [value7 && <Text variant="text-xs/medium" color="text-muted" style={{marginLeft: 'auto',
|
|
opacity: muted ? 1 : SUBTITLE_OPACITY_NORMAL}} maxFontSizeMultiplier={1.75}>{lastMessageTimestampString}</Text>];
|
|
items8[1] = <View style={[{'alignItems': 'center', 'paddingLeft': 4},
|
|
value7 && ({marginTop: 5})]}>{mentionBadge}</View>;
|
|
r12 = r12 && <View style={{flex: 1}} />;
|
|
items8[2] = r12;
|
|
return (
|
|
<View style={styles.channelContent}>
|
|
<View style={styles.channelContainer}>
|
|
{view}
|
|
<View style={r11}>
|
|
{items8}
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function renderChannelContent_117268(a0) { // fn#117268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15534:2368, offset: 0x024ac5df, size: 33 bytes, params: 2, frame: 13
|
|
return <ChannelContent {...a0} />;
|
|
}
|
|
|