Dashboard.js 638 B

12345678910111213141516171819202122232425262728293031
  1. const React = require('react')
  2. const UppyCore = require('../core/Core').Uppy
  3. const DashboardPlugin = require('../plugins/Dashboard')
  4. const h = React.createElement
  5. class Dashboard extends React.Component {
  6. componentDidMount () {
  7. const uppy = this.props.uppy
  8. uppy.use(DashboardPlugin, {
  9. target: this.container,
  10. inline: true
  11. })
  12. this.plugin = uppy.getPlugin('DashboardUI')
  13. }
  14. render () {
  15. return h('div', {
  16. ref: (container) => {
  17. this.container = container
  18. }
  19. })
  20. }
  21. }
  22. Dashboard.propTypes = {
  23. uppy: React.PropTypes.instanceOf(UppyCore).isRequired
  24. }
  25. module.exports = Dashboard