54 lines
2.2 KiB
TypeScript
54 lines
2.2 KiB
TypeScript
// Metro module 15115 (f15116).
|
|
import { memo } from "react";
|
|
import { View } from "react-native";
|
|
import { CutoutDirection, SummarizedIconRow, OverflowTextSmall, CutoutableAvatarImage, AvatarSizes } from "../../../design/void/native";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import useIsUsingClientTheme from "../../client_themes/native/useIsUsingClientTheme";
|
|
import { useClientThemesOverride } from "../../client_themes/native/ClientThemesOverrides";
|
|
import { StageIcon } from "../../../design/components/Icon/native/redesign/generated/StageIcon";
|
|
import { VoiceNormalIcon } from "../../../design/components/Icon/native/redesign/generated/VoiceNormalIcon";
|
|
const cutout = Object.freeze({
|
|
direction: CutoutDirection.RIGHT,
|
|
inset: -2
|
|
});
|
|
const useStyles = createStyles({
|
|
container: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
paddingHorizontal: 16,
|
|
height: 40
|
|
},
|
|
containerNoPadding: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
height: 40
|
|
},
|
|
iconContainer: {
|
|
height: 40
|
|
},
|
|
redesignChannelIcon: {
|
|
marginRight: 4
|
|
},
|
|
overflow: {
|
|
height: 20,
|
|
paddingHorizontal: 4,
|
|
paddingVertical: 0,
|
|
display: "flex",
|
|
flexDirection: "row",
|
|
alignItems: "center"
|
|
},
|
|
transparentBorder: {
|
|
borderColor: "transparent"
|
|
}
|
|
});
|
|
const r44 = memo(function({ users, max, guildId, renderIcon, noPadding, stageIcon }) {
|
|
const styles = useStyles();
|
|
const r14 = useIsUsingClientTheme() ? styles.transparentBorder : null;
|
|
return <View style={[noPadding ? styles.containerNoPadding : styles.container, useClientThemesOverride()]}>
|
|
{renderIcon && stageIcon ? <StageIcon size="sm" color="channel-icon" style={styles.redesignChannelIcon} /> : <VoiceNormalIcon size="sm" color="channel-icon" style={styles.redesignChannelIcon} />}
|
|
<SummarizedIconRow offsetAmount={-6} style={styles.iconContainer} overflowStyle={[styles.overflow, r14]} overflowComponent={OverflowTextSmall} items={users} max={max} renderItem={(info, a1) => <CutoutableAvatarImage user={info} guildId={guildId} size={AvatarSizes.XSMALL_20} cutout={a1 ? void 0 : cutout} />} />
|
|
</View>;
|
|
});
|
|
export default r44;
|
|
export const VOICE_USER_SUMMARY_HEIGHT = 40;
|