@@ -9,6 +9,7 @@ import styles from '@/styles/Servers.module.css';
99import Marquee from 'react-fast-marquee' ;
1010import { getServerMemberCount , getUsersInServer } from '@/services/server.service' ;
1111import { Channel , Server as ServerType } from '@/types/dbtypes' ;
12+ import { ChannelMediaIcon } from '../icons/ChannelMediaIcon' ;
1213
1314export default function Server ( { server, expanded } : { server : ServerType , expanded : number } ) {
1415 const expand = expanded == server . id ;
@@ -52,7 +53,7 @@ export default function Server({ server, expanded }: { server: ServerType, expan
5253 handleAsync ( ) ;
5354 } , [ server , supabase , onlinePresenceChannel ] ) ;
5455
55- function joinChannel ( e : SyntheticEvent , channelId : number , name : string ) {
56+ function joinTextChannel ( e : SyntheticEvent , channelId : number , name : string ) {
5657 e . stopPropagation ( ) ;
5758 setChatName ( name ) ;
5859 setChannelId ( channelId ) ;
@@ -117,11 +118,20 @@ export default function Server({ server, expanded }: { server: ServerType, expan
117118 className = { `channel flex whitespace-nowrap items-center pt-2 pb-1 px-4 hover:bg-grey-600 hover:cursor-pointer rounded-lg max-w-[192px] ${
118119 idx === 0 ? 'mt-2' : ''
119120 } `}
120- onClick = { ( e ) => joinChannel ( e , channel . channel_id , channel . name ) }
121+ onClick = { ( e ) => {
122+ if ( channel . is_media ) {
123+ // Entrypoint for media channel
124+ return ;
125+ }
126+
127+ else {
128+ joinTextChannel ( e , channel . channel_id , channel . name ) ;
129+ }
130+ } }
121131 key = { channel . channel_id }
122132 >
123133 < div className = "w-4" >
124- < ChannelMessageIcon size = "" />
134+ { channel . is_media ? < ChannelMediaIcon /> : < ChannelMessageIcon /> }
125135 </ div >
126136
127137 < div className = "ml-2 text-sm font-semibold tracking-wide text-grey-200 max-w-[10ch] overflow-hidden hover:overflow-visible" >
0 commit comments