Browse Source

@uppy/dashboard - made Add More always stick to the right (#1733)

Evgenia Karunus 5 years ago
parent
commit
0b8674a1ce
1 changed files with 23 additions and 21 deletions
  1. 23 21
      packages/@uppy/dashboard/src/components/PickerPanelTopBar.js

+ 23 - 21
packages/@uppy/dashboard/src/components/PickerPanelTopBar.js

@@ -78,33 +78,35 @@ function PanelTopBar (props) {
 
   return (
     <div class="uppy-DashboardContent-bar">
-      {
-        !props.isAllComplete &&
-        <button
-          class="uppy-DashboardContent-back"
-          type="button"
-          onclick={props.cancelAll}
-        >
-          {props.i18n('cancel')}
-        </button>
+      { // always on the left
+        !props.isAllComplete
+          ? <button
+            class="uppy-DashboardContent-back"
+            type="button"
+            onclick={props.cancelAll}
+          >
+            {props.i18n('cancel')}
+          </button>
+          : <div />
       }
 
       <div class="uppy-DashboardContent-title" role="heading" aria-level="h1">
         <UploadStatus {...props} />
       </div>
 
-      {
-        allowNewUpload &&
-        <button
-          class="uppy-DashboardContent-addMore"
-          type="button"
-          aria-label={props.i18n('addMoreFiles')}
-          title={props.i18n('addMoreFiles')}
-          onclick={() => props.toggleAddFilesPanel(true)}
-        >
-          {iconPlus()}
-          <span class="uppy-DashboardContent-addMoreCaption">{props.i18n('addMore')}</span>
-        </button>
+      { // always on the right
+        allowNewUpload
+          ? <button
+            class="uppy-DashboardContent-addMore"
+            type="button"
+            aria-label={props.i18n('addMoreFiles')}
+            title={props.i18n('addMoreFiles')}
+            onclick={() => props.toggleAddFilesPanel(true)}
+          >
+            {iconPlus()}
+            <span class="uppy-DashboardContent-addMoreCaption">{props.i18n('addMore')}</span>
+          </button>
+          : <div />
       }
     </div>
   )