mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-04 09:25:16 +01:00
enable/disable ip input based on grasscutter enabled
This commit is contained in:
@@ -17,6 +17,8 @@ interface IState {
|
|||||||
grasscutterEnabled: boolean;
|
grasscutterEnabled: boolean;
|
||||||
buttonLabel: string;
|
buttonLabel: string;
|
||||||
checkboxLabel: string;
|
checkboxLabel: string;
|
||||||
|
ip: string;
|
||||||
|
port: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ServerLaunchSection extends React.Component<IProps, IState> {
|
export default class ServerLaunchSection extends React.Component<IProps, IState> {
|
||||||
@@ -26,7 +28,9 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
this.state = {
|
this.state = {
|
||||||
grasscutterEnabled: false,
|
grasscutterEnabled: false,
|
||||||
buttonLabel: '',
|
buttonLabel: '',
|
||||||
checkboxLabel: ''
|
checkboxLabel: '',
|
||||||
|
ip: '',
|
||||||
|
port: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
this.toggleGrasscutter = this.toggleGrasscutter.bind(this)
|
this.toggleGrasscutter = this.toggleGrasscutter.bind(this)
|
||||||
@@ -88,6 +92,19 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setIp(text: string) {
|
||||||
|
this.setState({
|
||||||
|
ip: text
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setPort(text: string) {
|
||||||
|
this.setState({
|
||||||
|
port: text
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div id="playButton">
|
<div id="playButton">
|
||||||
@@ -96,12 +113,8 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="ServerConfig">
|
<div className="ServerConfig">
|
||||||
{
|
<TextInput readOnly={this.state.grasscutterEnabled} id="ip" key="ip" placeholder="Server Address..." onChange={this.setIp} />,
|
||||||
this.state.grasscutterEnabled ?
|
<TextInput readOnly={this.state.grasscutterEnabled} id="port" key="port" placeholder="Port..." onChange={this.setPort}/>
|
||||||
[ <TextInput id="ip" key="ip" placeholder="IP Address..." />,
|
|
||||||
<TextInput id="port" key="port" placeholder="Port..." /> ]
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="ServerLaunchButtons">
|
<div className="ServerLaunchButtons">
|
||||||
|
|||||||
Reference in New Issue
Block a user