From 82240a494a3c15e7cb4707435c649469ce71d323 Mon Sep 17 00:00:00 2001 From: Martina Date: Thu, 10 Sep 2020 14:53:26 -0700 Subject: [PATCH] shows individual file status --- components/sidebars/SidebarAddFileToBucket.js | 125 +++++------------- 1 file changed, 34 insertions(+), 91 deletions(-) diff --git a/components/sidebars/SidebarAddFileToBucket.js b/components/sidebars/SidebarAddFileToBucket.js index e2be73f6..e5a0f8b7 100644 --- a/components/sidebars/SidebarAddFileToBucket.js +++ b/components/sidebars/SidebarAddFileToBucket.js @@ -43,42 +43,13 @@ const STYLES_FILE_STATUS = css` align-items: center; `; -const STYLES_FOCUS = css` - font-size: ${Constants.typescale.lvl1}; - font-family: ${Constants.font.medium}; - overflow-wrap: break-word; - width: 100%; - - strong { - font-family: ${Constants.font.semiBold}; - font-weight: 400; - } -`; - -const STYLES_SUBTEXT = css` - margin-top: 8px; - font-size: 12px; -`; - -const STYLES_ITEM = css` - margin-top: 16px; -`; - -const STYLES_IMAGE_PREVIEW = css` - display: block; - width: 100%; +const STYLES_BAR_CONTAINER = css` + background: ${Constants.system.white}; + border-radius: 4px; + padding: 16px; margin-top: 48px; `; -const STYLES_STRONG = css` - display: block; - margin: 16px 0 4px 0; - font-weight: 400; - font-family: ${Constants.font.medium}; - font-size: 0.8rem; - oveflow-wrap: break-word; -`; - const STYLES_PERFORMANCE = css` font-family: ${Constants.font.code}; font-size: 12px; @@ -93,9 +64,6 @@ const STYLES_ICONS = css` margin: 64px 0; `; -const reducerTotal = (total, curr) => total + curr.total; -const reducerLoaded = (total, curr) => total + curr.loaded; - export default class SidebarAddFileToBucket extends React.Component { _handleUpload = async (e) => { e.persist(); @@ -197,7 +165,6 @@ export default class SidebarAddFileToBucket extends React.Component { id="file" onChange={this._handleUpload} /> -
@@ -205,7 +172,6 @@ export default class SidebarAddFileToBucket extends React.Component {
- Click below or drop a file anywhere on the page to upload a file {this.props.data && @@ -223,23 +189,19 @@ export default class SidebarAddFileToBucket extends React.Component { )} . - {/* //change this to allways allow uploads */} - {!this.props.fileLoading ? ( - - Add file - - ) : null} + + Add file +
- {this.props.fileLoading ? ( - +
{Strings.bytesToSize(loaded)} / {Strings.bytesToSize(total)} @@ -250,48 +212,29 @@ export default class SidebarAddFileToBucket extends React.Component { bytes={loaded} maximumBytes={total} /> - +
) : null} - {this.props.fileLoading ? ( - Object.values(this.props.fileLoading).map((file) => ( -
-
{file.name}
-
- {file.loaded === file.total ? ( - - ) : file.failed ? ( - - ) : ( -
- +
+ {this.props.fileLoading + ? Object.values(this.props.fileLoading).map((file) => ( +
+
{file.name}
+
+ {file.loaded === file.total ? ( + + ) : file.failed ? ( + + ) : ( + + )} + {/* maybe send an alert if fails here */}
- )} - {/* maybe send an alert if fails here */} -
-
- )) - ) : ( - -
-
- tokyodriftmp3sfjalsjflkjfasfijaiojmoawejfaokjwfjkhdk -
- - - -
-
-
- tokyodriftmp3sfjalsjflkjfasfijaiojmoawejfaokjwfjkhdk -
-
- -
-
-
- )} +
+ )) + : null} +
); }