enable grasscutter checkbox

This commit is contained in:
SpikeHD
2022-05-08 22:02:18 -07:00
parent aa8979d165
commit ba304fa3ea
3 changed files with 35 additions and 10 deletions

View File

@@ -9,6 +9,7 @@ import { getConfig } from '../utils/configuration'
// Major Components
import Topbar from './components/TopBar'
import BigButton from './components/common/BigButton'
import Checkbox from './components/common/Checkbox'
async function playGame() {
const config = await getConfig()
@@ -23,7 +24,10 @@ function App() {
return (
<div className="App">
<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" />
</div>
</div>

View File

@@ -1,15 +1,32 @@
import React from 'react'
interface IProps {
label: string
}
interface IState {
checked: boolean
}
export default class Checkbox extends React.Component<IProps, IState> {
constructor(props: IProps) {
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>
)
}
}

View File

@@ -1,17 +1,21 @@
#playButtons {
#playButton {
display: flex;
flex-direction: row-reverse;
align-items: center;
flex-direction: column;
align-items: left;
justify-content: space-between;
position: absolute;
top: 80%;
left: 40%;
left: 60%;
width: 50%;
height: 10%;
width: 30%;
height: 12%;
}
#playButtons .BigButton {
#playButton .BigButton {
height: 100%;
}
#serverControls {
color: white;
}