File tree 1 file changed +18
-8
lines changed
1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,12 @@ export default function Home() {
113
113
[ setMultiaddr ] ,
114
114
)
115
115
116
- const handleDisconnectPeer = useCallback ( ( peerId : PeerId ) => {
117
- libp2p . hangUp ( peerId )
118
- } , [ libp2p ] )
116
+ const handleDisconnectPeer = useCallback (
117
+ ( peerId : PeerId ) => {
118
+ libp2p . hangUp ( peerId )
119
+ } ,
120
+ [ libp2p ] ,
121
+ )
119
122
120
123
return (
121
124
< >
@@ -192,12 +195,19 @@ export default function Home() {
192
195
Connected peers ({ getFormattedConnections ( peerStats . connections ) . length } ) 👇
193
196
</ h3 >
194
197
195
- < ul className = "divide-y divide-gray-100 " >
198
+ < ul className = "divide-y divide-gray-200 " >
196
199
{ getFormattedConnections ( peerStats . connections ) . map ( ( pair ) => (
197
- < li key = { pair . peerId . toString ( ) } className = "py-1 flex justify-between items-center" >
198
- < span > { `${ pair . peerId } (${ pair . protocols . join ( ', ' ) } )` } </ span >
199
- < button onClick = { ( ) => handleDisconnectPeer ( pair . peerId ) } className = "bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded flex flex-row" >
200
- < XCircleIcon className = "w-6 h-6" /> Disconnect
200
+ < li
201
+ key = { pair . peerId . toString ( ) }
202
+ className = "py-1 flex flex-wrap justify-between items-center break-all"
203
+ >
204
+ < span > { `${ pair . peerId . toString ( ) } (${ pair . protocols . join ( ', ' ) } )` } </ span >
205
+ < button
206
+ onClick = { ( ) => handleDisconnectPeer ( pair . peerId ) }
207
+ className = "bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded flex flex-row"
208
+ >
209
+ < XCircleIcon className = "w-6 h-6" />
210
+ < span className = "pl-1" > Disconnect</ span >
201
211
</ button >
202
212
</ li >
203
213
) ) }
You can’t perform that action at this time.
0 commit comments