Browse Source

status-bar: Use indeterminate mode during upload if progress is not supported

Renée Kooi 6 years ago
parent
commit
2cbe54194a

+ 5 - 0
packages/@uppy/status-bar/src/StatusBar.js

@@ -80,6 +80,11 @@ module.exports = (props) => {
   } else if (uploadState === statusBarStates.STATE_COMPLETE) {
     progressBarContent = ProgressBarComplete(props)
   } else if (uploadState === statusBarStates.STATE_UPLOADING) {
+    if (!props.supportsUploadProgress) {
+      progressMode = 'indeterminate'
+      progressValue = null
+    }
+
     progressBarContent = ProgressBarUploading(props)
   } else if (uploadState === statusBarStates.STATE_ERROR) {
     progressValue = undefined

+ 1 - 2
packages/@uppy/status-bar/src/style.scss

@@ -64,8 +64,7 @@
   transition: background-color, width .3s ease-out;
 
   &.is-indeterminate {
-    background-color: $color-orange;
-    $stripe-color: darken($color-orange, 10%);
+    $stripe-color: rgba(0, 0, 0, 0.3);
     background-size: 64px 64px;
     background-image: linear-gradient(45deg, $stripe-color 25%, transparent 25%, transparent 50%, $stripe-color 50%, $stripe-color 75%, transparent 75%, transparent);
     animation: uppy-StatusBar-ProgressStripes 1s linear infinite;