135 lines
7.6 KiB
TypeScript
135 lines
7.6 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] */
|
|
import GetLayoutStyles from './getLayoutStyles.tsx'; /* Metro dependency 15332 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ReadStateConstantsModule from '../../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = 0;
|
|
const env0_3 = importAll(dependencyMap[value]);
|
|
const value2 = 2;
|
|
const SUBTITLE_OPACITY_NORMAL = require(dependencyMap[value2]).SUBTITLE_OPACITY_NORMAL;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {flex: 1};
|
|
object2.marginTop = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() ? value2 : -1;
|
|
object.channelContent = object2;
|
|
object.channelContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'space-between'};
|
|
object.leftBox = {'flexDirection': 'column', 'alignItems': 'flex-start', 'flexShrink': 1};
|
|
object.rightBox = {'flexDirection': 'column', 'alignItems': 'flex-end'};
|
|
object.rightContentAbsolute = {'position': 'absolute', 'right': 0, 'top': 0};
|
|
object.channelTraits = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
const object3 = {opacity: SUBTITLE_OPACITY_NORMAL, marginRight: 4};
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
object3.marginTop = platformUtilsModule.isAndroid() ? value2 : value;
|
|
object.channelTraitIcon = object3;
|
|
const env0_9 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
(FileImportTrackerModule).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 = (TextModule).Text;
|
|
var object;
|
|
var items4;
|
|
const styles = useStyles();
|
|
const value3 = (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 object3 = {'flexDirection': 'row', 'paddingRight': null, 'alignItems': 'center'};
|
|
object3.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={object3}>
|
|
{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} />;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117266, 15337, [31, 27, 10980, 4865, 33, 4501, 477, 15332, 5107, 15338, 4573, 6705, 8129, 14538,
|
|
2]) /* metro module 15337, dependencies: [31, 27, 10980, 4865, 33, 4501, 477, 15332, 5107, 15338, 4573, 6705, 8129, 14538, 2] */;
|