Hide server URL input if set in config or query

Closes: https://todo.sr.ht/~emersion/gamja/52
This commit is contained in:
Simon Ser 2021-05-31 18:13:44 +02:00
parent 04932317f6
commit 8c02cdc094

View file

@ -74,6 +74,17 @@ export default class ConnectForm extends Component {
}
render() {
var serverURL = null;
if (!this.props.params || !this.props.params.url) {
serverURL = html`
<label>
Server URL:<br/>
<input type="text" name="url" value=${this.state.url} disabled=${this.props.disabled} inputmode="url"/>
</label>
<br/><br/>
`;
}
return html`
<form onChange=${this.handleChange} onSubmit=${this.handleSubmit}>
<h2>Connect to IRC</h2>
@ -101,11 +112,7 @@ export default class ConnectForm extends Component {
<br/>
<label>
Server URL:<br/>
<input type="text" name="url" value=${this.state.url} disabled=${this.props.disabled} inputmode="url"/>
</label>
<br/><br/>
${serverURL}
<label>
Username:<br/>