File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
app/components/random_chat_components Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,12 @@ const SidebarList = ({
23
23
return string ?. slice ( 0 , 1 ) . toUpperCase ( ) + string ?. slice ( 1 , string . length ) ;
24
24
}
25
25
26
- const handleRemoveFriend = ( ) => {
26
+ const handleRemoveFriend = (
27
+ event : React . MouseEvent < SVGElement , MouseEvent >
28
+ ) => {
29
+ event . stopPropagation ( ) ;
27
30
if ( typeof window !== undefined ) {
28
31
const userId = localStorage . getItem ( "userId" ) ;
29
- console . log ( userId , userData . friends ) ;
30
- // todo
31
32
fetch (
32
33
`http://${ IP_ADDRESS } /v1.0/voyager/user_friends/${ userId } /${ userData . friends } ` ,
33
34
{
@@ -58,8 +59,8 @@ const SidebarList = ({
58
59
return (
59
60
< div className = "flex justify-between items-center my-1 px-3 py-2 text-white bg-[#393646] hover:bg-[#4e516d] rounded" >
60
61
< li
61
- className = "list-none font-medium text-lg"
62
- onClick = { ( ) => router . push ( " /voyager/random_chat/randomUserId" ) }
62
+ className = "list-none font-medium text-lg w-full "
63
+ onClick = { ( ) => router . push ( ` /voyager/random_chat/${ userData . friends } ` ) }
63
64
>
64
65
{ capitaliseFirstLetter ( userData . friendsName ) }
65
66
</ li >
You can’t perform that action at this time.
0 commit comments