Quellcode durchsuchen

uppy-react: Add most Dashboard plugin options as props.

René Kooi vor 8 Jahren
Ursprung
Commit
24059a1851
2 geänderte Dateien mit 25 neuen und 1 gelöschten Zeilen
  1. 13 1
      src/uppy-react/Dashboard.js
  2. 12 0
      src/uppy-react/DashboardModal.js

+ 13 - 1
src/uppy-react/Dashboard.js

@@ -14,6 +14,13 @@ class Dashboard extends React.Component {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     uppy.use(DashboardPlugin, {
     uppy.use(DashboardPlugin, {
       target: this.container,
       target: this.container,
+      maxWidth: this.props.maxWidth,
+      maxHeight: this.props.maxHeight,
+      semiTransparent: this.props.semiTransparent,
+      showProgressDetails: this.props.showProgressDetails,
+      // TODO Accept a React node here and render it so we can pass a DOM
+      // element to this option.
+      // defaultTabIcon: this.props.defaultTabIcon,
       inline: true
       inline: true
     })
     })
 
 
@@ -30,7 +37,12 @@ class Dashboard extends React.Component {
 }
 }
 
 
 Dashboard.propTypes = {
 Dashboard.propTypes = {
-  uppy: React.PropTypes.instanceOf(UppyCore).isRequired
+  uppy: React.PropTypes.instanceOf(UppyCore).isRequired,
+  maxWidth: React.PropTypes.number,
+  maxHeight: React.PropTypes.number,
+  semiTransparent: React.PropTypes.bool,
+  defaultTabIcon: React.PropTypes.node,
+  showProgressDetails: React.PropTypes.bool
 }
 }
 
 
 module.exports = Dashboard
 module.exports = Dashboard

+ 12 - 0
src/uppy-react/DashboardModal.js

@@ -14,6 +14,13 @@ class DashboardModal extends React.Component {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     uppy.use(ReactDashboardPlugin, {
     uppy.use(ReactDashboardPlugin, {
       target: this.container,
       target: this.container,
+      maxWidth: this.props.maxWidth,
+      maxHeight: this.props.maxHeight,
+      semiTransparent: this.props.semiTransparent,
+      showProgressDetails: this.props.showProgressDetails,
+      // TODO Accept a React node here and render it so we can pass a DOM
+      // element to this option.
+      // defaultTabIcon: this.props.defaultTabIcon,
       onRequestClose: this.props.onRequestClose
       onRequestClose: this.props.onRequestClose
     })
     })
 
 
@@ -42,6 +49,11 @@ class DashboardModal extends React.Component {
 
 
 DashboardModal.propTypes = {
 DashboardModal.propTypes = {
   uppy: React.PropTypes.instanceOf(UppyCore).isRequired,
   uppy: React.PropTypes.instanceOf(UppyCore).isRequired,
+  maxWidth: React.PropTypes.number,
+  maxHeight: React.PropTypes.number,
+  semiTransparent: React.PropTypes.bool,
+  defaultTabIcon: React.PropTypes.node,
+  showProgressDetails: React.PropTypes.bool,
   onRequestClose: React.PropTypes.func
   onRequestClose: React.PropTypes.func
 }
 }