improve downloads section again

This commit is contained in:
SpikeHD
2022-05-11 21:33:23 -07:00
parent cd4fe6b9fb
commit 9f0ade3de8
3 changed files with 18 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ async function TESTDOWNLOAD() {
download(
'https://github.com/Grasscutters/Grasscutter/archive/refs/heads/stable.zip',
'grasscutter.zip',
'S:/Cultivation'
'C:\\Users\\spike\\Documents\\dev\\Cultivation'
)
}

View File

@@ -0,0 +1,12 @@
.DownloadSection span {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: 100%;
}
.DownloadSection {
overflow: hidden;
width: 100%;
}

View File

@@ -14,10 +14,14 @@ export default class MiniDialog extends React.Component<IProps, never> {
super(props)
}
getFilenameFromPath() {
return this.props.downloadName.split('/').pop()
}
render() {
return (
<div className="DownloadSection">
<span>{this.props.downloadName} - {this.props.downloadManager.getDownloadSize(this.props.downloadName)}</span>
<span>{this.getFilenameFromPath()} - {this.props.downloadManager.getDownloadSize(this.props.downloadName)}</span>
<div className="DownloadSectionInner">
<ProgressBar path={this.props.downloadName} downloadManager={this.props.downloadManager} />
</div>