|
|
@ -23,12 +23,14 @@ const ConnectForm: FC<Props> = ({ socket }) => { |
|
|
const isSocketClosed = socket.state === SocketState.Closed; |
|
|
const isSocketClosed = socket.state === SocketState.Closed; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<div id="connect-form"> |
|
|
|
|
|
<h2>Connect to a solstice client</h2> |
|
|
|
|
|
|
|
|
<div class="text-center bg-white py-5 px-10 rounded-xl shadow"> |
|
|
|
|
|
<h2 class="text-3xl font-bold mb-2 text-yellow-600"> |
|
|
|
|
|
Connect to a solstice client |
|
|
|
|
|
</h2> |
|
|
<Form |
|
|
<Form |
|
|
onSubmit={onSubmit} |
|
|
onSubmit={onSubmit} |
|
|
render={({ handleSubmit, submitting }) => ( |
|
|
render={({ handleSubmit, submitting }) => ( |
|
|
<form onSubmit={handleSubmit}> |
|
|
|
|
|
|
|
|
<form onSubmit={handleSubmit} class="my-2"> |
|
|
<Field |
|
|
<Field |
|
|
name="url" |
|
|
name="url" |
|
|
component="input" |
|
|
component="input" |
|
|
@ -36,8 +38,17 @@ const ConnectForm: FC<Props> = ({ socket }) => { |
|
|
defaultValue="ws://localhost:2244" |
|
|
defaultValue="ws://localhost:2244" |
|
|
required |
|
|
required |
|
|
pattern="wss?://.+" |
|
|
pattern="wss?://.+" |
|
|
|
|
|
class="border border-gray-400 rounded px-1 mx-1" |
|
|
/> |
|
|
/> |
|
|
<button type="submit" disabled={submitting || !isSocketClosed}> |
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
type="submit" |
|
|
|
|
|
disabled={submitting || !isSocketClosed} |
|
|
|
|
|
class={ |
|
|
|
|
|
"border border-gray-500 rounded px-1 " + |
|
|
|
|
|
"bg-yellow-200 focus:bg-red " + |
|
|
|
|
|
"disabled:bg-gray-300 disabled:text-gray-500" |
|
|
|
|
|
} |
|
|
|
|
|
> |
|
|
Connect |
|
|
Connect |
|
|
</button> |
|
|
</button> |
|
|
</form> |
|
|
</form> |
|
|
|