Browse Source

Merge pull request #1129 from craigcbrunner/master

react: Allow Dashboard props width and height to accept a string for 100%
Renée Kooi 6 years ago
parent
commit
714a2373e8
1 changed files with 8 additions and 2 deletions
  1. 8 2
      packages/@uppy/react/src/propTypes.js

+ 8 - 2
packages/@uppy/react/src/propTypes.js

@@ -21,13 +21,19 @@ const metaField = PropTypes.shape({
 })
 const metaFields = PropTypes.arrayOf(metaField)
 
+// A size in pixels (number) or with some other unit (string).
+const cssSize = PropTypes.oneOfType([
+  PropTypes.string,
+  PropTypes.number
+])
+
 // Common props for dashboardy components (Dashboard and DashboardModal).
 const dashboard = {
   uppy,
   inline: PropTypes.bool,
   plugins,
-  width: PropTypes.number,
-  height: PropTypes.number,
+  width: cssSize,
+  height: cssSize,
   showProgressDetails: PropTypes.bool,
   hideUploadButton: PropTypes.bool,
   hideProgressAfterFinish: PropTypes.bool,