mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
download sections and progess bars
This commit is contained in:
0
src/ui/components/common/DownloadList.css
Normal file
0
src/ui/components/common/DownloadList.css
Normal file
29
src/ui/components/common/DownloadList.tsx
Normal file
29
src/ui/components/common/DownloadList.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import DownloadSection from './DownloadSection'
|
||||
|
||||
import './DownloadList.css'
|
||||
|
||||
interface IProps {
|
||||
downloadManager: DownloadHandler;
|
||||
}
|
||||
|
||||
export default class DownloadList extends React.Component<IProps, never> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="DownloadList">
|
||||
{
|
||||
this.props.downloadManager.getDownloads().map((download) => {
|
||||
return (
|
||||
<DownloadSection key={download.path} downloadName={download.path} downloadManager={this.props.downloadManager} />
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
0
src/ui/components/common/DownloadSection.css
Normal file
0
src/ui/components/common/DownloadSection.css
Normal file
27
src/ui/components/common/DownloadSection.tsx
Normal file
27
src/ui/components/common/DownloadSection.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react'
|
||||
import DownloadHandler from '../../../utils/download'
|
||||
import ProgressBar from './ProgressBar'
|
||||
|
||||
import './DownloadSection.css'
|
||||
|
||||
interface IProps {
|
||||
downloadManager: DownloadHandler;
|
||||
downloadName: string;
|
||||
}
|
||||
|
||||
export default class MiniDialog extends React.Component<IProps, never> {
|
||||
constructor(props: IProps) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="DownloadSection">
|
||||
<span>{this.props.downloadName}</span>
|
||||
<div className="DownloadSectionInner">
|
||||
<ProgressBar path={this.props.downloadName} downloadManager={this.props.downloadManager} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
color: #fff;
|
||||
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.InnerProgress {
|
||||
|
||||
Reference in New Issue
Block a user