From 2b1b2d6949bb3a42c8f2ebb1c5fa49c690291332 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Mon, 27 Nov 2017 10:11:01 -0500 Subject: [PATCH] =?UTF-8?q?StatusBar=20refinements:=20move=20Upload=20butt?= =?UTF-8?q?on=20here,=20show=20upload=20+=201=20when=20in=20progress,=20re?= =?UTF-8?q?try=20button=20(with=20Alex=E2=80=99s=20suggestions=20and=20moc?= =?UTF-8?q?kups)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/StatusBar/StatusBar.js | 74 +++++++++++++++--------- src/plugins/StatusBar/index.js | 16 +++++- src/scss/_statusbar.scss | 91 ++++++++++++++++++++++++------ 3 files changed, 135 insertions(+), 46 deletions(-) diff --git a/src/plugins/StatusBar/StatusBar.js b/src/plugins/StatusBar/StatusBar.js index 57e62ff11..7e6f1891a 100644 --- a/src/plugins/StatusBar/StatusBar.js +++ b/src/plugins/StatusBar/StatusBar.js @@ -106,24 +106,58 @@ module.exports = (props) => { } const width = typeof progressValue === 'number' ? progressValue : 100 + const isHidden = uploadState === STATE_WAITING && !props.newFiles > 0 return html`
- + aria-hidden="${isHidden}">
+ style="width: ${width}%" + role="progressbar" + aria-valuemin="0" + aria-valuemax="100" + aria-valuenow="${progressValue}">
${progressBarContent} +
+ ${props.newFiles ? UploadBtn(props) : ''} + ${props.error ? RetryBtn(props) : ''} +
` } +const UploadBtn = (props) => { + return html`` +} + +const RetryBtn = (props) => { + return html`` +} + const ProgressBarProcessing = (props) => { + const value = Math.round(props.value * 100) return html`
- ${props.mode === 'determinate' ? `${Math.round(props.value * 100)}%・` : ''} - ${props.message} +
+ ${props.mode === 'determinate' ? `${value}%・` : ''} + ${props.message} +
` } @@ -136,16 +170,16 @@ const ProgressBarUploading = (props) => { ? html`
${pauseResumeButtons(props)} Uploading... ${throttledProgressDetails(props)}
` : html`
${pauseResumeButtons(props)} Paused・${props.totalProgress}%
` : null - } + } ` } const ProgressBarComplete = ({ totalProgress, i18n }) => { return html` -
+