Procházet zdrojové kódy

add `note` options to write restriction instructions in (or smth else)

Artur Paikin před 7 roky
rodič
revize
d2c39bbb27

+ 1 - 0
src/plugins/Dashboard/Dashboard.js

@@ -101,6 +101,7 @@ module.exports = function Dashboard (props) {
             totalProgress: props.totalProgress,
             totalProgress: props.totalProgress,
             totalFileCount: props.totalFileCount,
             totalFileCount: props.totalFileCount,
             info: props.info,
             info: props.info,
+            note: props.note,
             i18n: props.i18n,
             i18n: props.i18n,
             log: props.log,
             log: props.log,
             removeFile: props.removeFile,
             removeFile: props.removeFile,

+ 4 - 0
src/plugins/Dashboard/FileList.js

@@ -16,6 +16,10 @@ module.exports = (props) => {
               i18n: props.i18n
               i18n: props.i18n
             })}
             })}
           </h3>
           </h3>
+          ${props.note
+            ? html`<p class="UppyDashboard-note">${props.note}</p>`
+            : ''
+          }
           <input class="UppyDashboard-input" type="file" name="files[]" multiple="true"
           <input class="UppyDashboard-input" type="file" name="files[]" multiple="true"
                  onchange=${props.handleInputChange} />
                  onchange=${props.handleInputChange} />
          </div>`
          </div>`

+ 2 - 0
src/plugins/Dashboard/index.js

@@ -48,6 +48,7 @@ module.exports = class DashboardUI extends Plugin {
       semiTransparent: false,
       semiTransparent: false,
       defaultTabIcon: defaultTabIcon(),
       defaultTabIcon: defaultTabIcon(),
       showProgressDetails: false,
       showProgressDetails: false,
+      note: false,
       locale: defaultLocale
       locale: defaultLocale
     }
     }
 
 
@@ -367,6 +368,7 @@ module.exports = class DashboardUI extends Plugin {
       addFile: addFile,
       addFile: addFile,
       removeFile: removeFile,
       removeFile: removeFile,
       info: info,
       info: info,
+      note: this.opts.note,
       metaFields: state.metaFields,
       metaFields: state.metaFields,
       resumableUploads: resumableUploads,
       resumableUploads: resumableUploads,
       startUpload: startUpload,
       startUpload: startUpload,

+ 12 - 1
src/scss/_dashboard.scss

@@ -417,6 +417,18 @@
   }
   }
 }
 }
 
 
+.UppyDashboard-note {
+  font-size: 12px;
+  line-height: 1.2;
+  text-align: center;
+  margin-top: 20px;
+  color: $color-asphalt-gray;
+
+  .UppyDashboard--wide & {
+    font-size: 13px;
+  }
+}
+
 .UppyDashboardItem {
 .UppyDashboardItem {
   list-style: none;
   list-style: none;
   margin: 10px 0;
   margin: 10px 0;
@@ -550,7 +562,6 @@
     border-bottom-right-radius: 6px;
     border-bottom-right-radius: 6px;
     border: 1px solid rgba($color-gray, 0.2);
     border: 1px solid rgba($color-gray, 0.2);
     border-top: 0;
     border-top: 0;
-    // height: 60px;
   }
   }
 }
 }