Skip to content

Commit 2246b25

Browse files
authored
fix: styling (#138)
Co-authored-by: Daniel N <[email protected]>
1 parent f6a399d commit 2246b25

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

js-peer/src/pages/index.tsx

+18-8
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ export default function Home() {
113113
[setMultiaddr],
114114
)
115115

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+
)
119122

120123
return (
121124
<>
@@ -192,12 +195,19 @@ export default function Home() {
192195
Connected peers ({getFormattedConnections(peerStats.connections).length}) 👇
193196
</h3>
194197

195-
<ul className="divide-y divide-gray-100">
198+
<ul className="divide-y divide-gray-200">
196199
{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>
201211
</button>
202212
</li>
203213
))}

0 commit comments

Comments
 (0)