From 9f0ade3de880045d70840cf67e54168fce1c0b70 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Wed, 11 May 2022 21:33:23 -0700 Subject: [PATCH] improve downloads section again --- src/ui/App.tsx | 2 +- src/ui/components/common/DownloadSection.css | 12 ++++++++++++ src/ui/components/common/DownloadSection.tsx | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index c2b6064..ecdac51 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -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' ) } diff --git a/src/ui/components/common/DownloadSection.css b/src/ui/components/common/DownloadSection.css index e69de29..12fc82a 100644 --- a/src/ui/components/common/DownloadSection.css +++ b/src/ui/components/common/DownloadSection.css @@ -0,0 +1,12 @@ +.DownloadSection span { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + + width: 100%; +} + +.DownloadSection { + overflow: hidden; + width: 100%; +} \ No newline at end of file diff --git a/src/ui/components/common/DownloadSection.tsx b/src/ui/components/common/DownloadSection.tsx index cd4bd6e..37e5fc4 100644 --- a/src/ui/components/common/DownloadSection.tsx +++ b/src/ui/components/common/DownloadSection.tsx @@ -14,10 +14,14 @@ export default class MiniDialog extends React.Component { super(props) } + getFilenameFromPath() { + return this.props.downloadName.split('/').pop() + } + render() { return (
- {this.props.downloadName} - {this.props.downloadManager.getDownloadSize(this.props.downloadName)} + {this.getFilenameFromPath()} - {this.props.downloadManager.getDownloadSize(this.props.downloadName)}