@@ -37,7 +37,7 @@ export function RoomListComponent(
37
37
className = "relative flex w-full cursor-pointer"
38
38
>
39
39
< div
40
- className = { ' flex flex-row hover-color w-full ' + (
40
+ className = { 'flex flex-row hover-color w-full overflow-clip ' + (
41
41
ID === room ?. ID ?
42
42
' bg-gray-451 dark:bg-gray-450 dark:hover:bg-gray-450 ' :
43
43
mentions > 0 || unread > 0 ?
@@ -51,9 +51,8 @@ export function RoomListComponent(
51
51
< span className = "rounded-full bg-white text-white text-xs p-1 h-1 w-1 absolute top-1/2 transform -translate-x-1/2 -translate-y-1/2" />
52
52
) :
53
53
null }
54
- { /** Room name */ }
55
54
< button
56
- className = { 'rounded p-1 flex flex-row basis-full items-center h-auto mr-2 ml-2 ' }
55
+ className = { 'rounded p-1 flex flex-row basis-full items-center truncate h-auto mr-2 ml-2 ' }
57
56
onClick = { ( ) => {
58
57
notificationsEngine . askPermission ( ) ;
59
58
setRoom ( ID ) ;
@@ -75,20 +74,20 @@ export function RoomListComponent(
75
74
</ button >
76
75
{
77
76
/* Should display closing button?*/
78
- ( room ?. ID === ID && room ?. ID !== 'home' ) ?
79
- < ClosingButton room = { room . ID } /> :
77
+ ( ID !== 'home' ) ?
78
+ < ClosingButton room = { ID } current = { ID === room ? .ID } /> :
80
79
''
81
80
}
82
81
</ div >
83
82
</ div >
84
83
) ;
85
84
}
86
85
87
- function ClosingButton ( { room } : Readonly < { room : string } > ) {
86
+ function ClosingButton ( { room, current } : Readonly < { room : string , current : boolean } > ) {
88
87
const { client } = useClientContext ( ) ;
89
88
return (
90
89
< button className = "p-1" onClick = { ( ) => client . leaveRoom ( room ) } >
91
- < AiOutlineClose className = 'hover:text-red-600' opacity = { 0.4 } />
90
+ < AiOutlineClose className = 'hover:text-red-600 hover:opacity-100 ' opacity = { current ? 0.8 : 0.2 } />
92
91
</ button >
93
92
) ;
94
93
}
0 commit comments