make App() class

This commit is contained in:
SpikeHD
2022-05-09 23:30:59 -07:00
parent 635a6a5abb
commit a6d5f3404c
5 changed files with 71 additions and 10 deletions

View File

@@ -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,20 +34,29 @@ async function TESTDOWNLOAD() {
)
}
function App() {
return (
<div className="App">
<Topbar />
class App extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props)
this.state = {
isDownloading: false,
}
}
<button onClick={TESTDOWNLOAD}>download file test</button>
render() {
return (
<div className="App">
<Topbar />
<ServerLaunchSection />
<button onClick={TESTDOWNLOAD}>download file test</button>
<div id="DownloadProgress">
<MainProgressBar downloadManager={downloadHandler} />
<ServerLaunchSection />
<div id="DownloadProgress">
<MainProgressBar downloadManager={downloadHandler} />
</div>
</div>
</div>
)
)
}
}
export default App