mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
enable grasscutter checkbox
This commit is contained in:
@@ -9,6 +9,7 @@ import { getConfig } from '../utils/configuration'
|
|||||||
// Major Components
|
// Major Components
|
||||||
import Topbar from './components/TopBar'
|
import Topbar from './components/TopBar'
|
||||||
import BigButton from './components/common/BigButton'
|
import BigButton from './components/common/BigButton'
|
||||||
|
import Checkbox from './components/common/Checkbox'
|
||||||
|
|
||||||
async function playGame() {
|
async function playGame() {
|
||||||
const config = await getConfig()
|
const config = await getConfig()
|
||||||
@@ -23,7 +24,10 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Topbar />
|
<Topbar />
|
||||||
<div id="playButtons">
|
<div id="playButton">
|
||||||
|
<div id="serverControls">
|
||||||
|
<Checkbox label="Connect via Grasscutter" />
|
||||||
|
</div>
|
||||||
<BigButton text="PLAY DA GAME :D" onClick={playGame} id="officialPlay" />
|
<BigButton text="PLAY DA GAME :D" onClick={playGame} id="officialPlay" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,15 +1,32 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
|
checked: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Checkbox extends React.Component<IProps, IState> {
|
export default class Checkbox extends React.Component<IProps, IState> {
|
||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
checked: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleChange = () => {
|
||||||
|
this.setState({ checked: !this.state.checked })
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="Checkbox">
|
||||||
|
<input type="checkbox" onChange={this.handleChange} />
|
||||||
|
<label>{this.props.label}</label>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,21 @@
|
|||||||
#playButtons {
|
#playButton {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row-reverse;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: left;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 80%;
|
top: 80%;
|
||||||
left: 40%;
|
left: 60%;
|
||||||
|
|
||||||
width: 50%;
|
width: 30%;
|
||||||
height: 10%;
|
height: 12%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#playButtons .BigButton {
|
#playButton .BigButton {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#serverControls {
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user