mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
make App() class
This commit is contained in:
@@ -11,6 +11,14 @@ import ServerLaunchSection from './components/ServerLaunchSection'
|
||||
import ProgressBar from './components/common/ProgressBar'
|
||||
import MainProgressBar from './components/common/MainProgressBar'
|
||||
|
||||
interface IProps {
|
||||
[key: string]: never
|
||||
}
|
||||
|
||||
interface IState {
|
||||
isDownloading: boolean
|
||||
}
|
||||
|
||||
const downloadHandler = new DownloadHandler()
|
||||
|
||||
async function download(url: string, filename: string, path: string) {
|
||||
@@ -26,7 +34,15 @@ async function TESTDOWNLOAD() {
|
||||
)
|
||||
}
|
||||
|
||||
function App() {
|
||||
class App extends React.Component<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
this.state = {
|
||||
isDownloading: false,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
<Topbar />
|
||||
@@ -41,5 +57,6 @@ function App() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default App
|
||||
|
||||
0
src/ui/components/menu/Menu.css
Normal file
0
src/ui/components/menu/Menu.css
Normal file
22
src/ui/components/menu/Menu.tsx
Normal file
22
src/ui/components/menu/Menu.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react'
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode[] | React.ReactNode;
|
||||
className?: string;
|
||||
heading: string;
|
||||
}
|
||||
|
||||
export default class Menu extends React.Component<IProps, never> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={'Menu ' + this.props.className}>
|
||||
<div className="MenuHeading">{this.props.heading}</div>
|
||||
{this.props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
0
src/ui/components/menu/Options.css
Normal file
0
src/ui/components/menu/Options.css
Normal file
22
src/ui/components/menu/Options.tsx
Normal file
22
src/ui/components/menu/Options.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react'
|
||||
import Menu from './Menu'
|
||||
import './Options.css'
|
||||
|
||||
export default class Options extends React.Component<{}, never> {
|
||||
constructor(props: Record<string, never>) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Menu className="Options" heading="Options">
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>Test Option</div>
|
||||
<div className='OptionValue'>
|
||||
<input type="checkbox" />
|
||||
</div>
|
||||
</div>
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user