Browse Source

don’t render close button in inline mode

Artur Paikin 6 years ago
parent
commit
933bd77658

+ 11 - 7
packages/@uppy/dashboard/src/components/Dashboard.js

@@ -53,13 +53,17 @@ module.exports = function Dashboard (props) {
           width: props.inline && props.width ? props.width : '',
           height: props.inline && props.height ? props.height : ''
         }}>
-        <button class="uppy-Dashboard-close"
-          type="button"
-          aria-label={props.i18n('closeModal')}
-          title={props.i18n('closeModal')}
-          onclick={props.closeModal}>
-          <span aria-hidden="true">&times;</span>
-        </button>
+
+        {!props.inline
+          ? <button class="uppy-u-reset uppy-Dashboard-close"
+            type="button"
+            aria-label={props.i18n('closeModal')}
+            title={props.i18n('closeModal')}
+            onclick={props.closeModal}>
+            <span aria-hidden="true">&times;</span>
+          </button>
+            : null
+          }
 
         <div class="uppy-Dashboard-innerWrap">
           { (!noFiles && props.showSelectedFiles) && <PanelTopBar {...props} /> }

+ 2 - 7
packages/@uppy/dashboard/src/style.scss

@@ -162,25 +162,20 @@
 }
 
 .uppy-Dashboard-close {
-  @include reset-button;
-  display: none;
+  display: block;
   position: absolute;
   top: -33px;
   right: -2px;
   cursor: pointer;
   color: rgba($color-white, 0.9);
   font-size: 27px;
+  z-index: $zIndex-5;
 
   @media #{$screen-medium} {
     font-size: 35px;
     top: -10px;
     right: -35px;
   }
-
-  .uppy-Dashboard--modal & {
-    z-index: $zIndex-5;
-    display: block;
-  }
 }
 
 .uppy-DashboarAddFiles {