mirror of
https://github.com/Nezumi-2711/websocket-demo.git
synced 2026-09-22 13:48:31 +00:00
update the style
This commit is contained in:
@@ -32,7 +32,7 @@ export default function WebSocketDemo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setConnectionStatus('Connecting...');
|
setConnectionStatus('Connecting...');
|
||||||
ws.current = new WebSocket('ws://localhost:8080');
|
ws.current = new WebSocket('ws://fat-cobra-50.deno.dev');
|
||||||
|
|
||||||
ws.current.onopen = () => {
|
ws.current.onopen = () => {
|
||||||
setIsConnected(true);
|
setIsConnected(true);
|
||||||
@@ -148,7 +148,7 @@ export default function WebSocketDemo() {
|
|||||||
placeholder="Enter your name (optional)"
|
placeholder="Enter your name (optional)"
|
||||||
value={senderName}
|
value={senderName}
|
||||||
onChange={(e) => setSenderName(e.target.value)}
|
onChange={(e) => setSenderName(e.target.value)}
|
||||||
className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
className="w-full p-3 border border-gray-300 text-black rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ export default function WebSocketDemo() {
|
|||||||
disabled={!isConnected}
|
disabled={!isConnected}
|
||||||
className={`flex-1 p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
className={`flex-1 p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
!isConnected ? 'bg-gray-100 cursor-not-allowed' : ''
|
!isConnected ? 'bg-gray-100 cursor-not-allowed' : ''
|
||||||
}`}
|
} text-black`}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={sendMessage}
|
onClick={sendMessage}
|
||||||
|
|||||||
Reference in New Issue
Block a user