PopupCreateContainer.jsx 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React from 'react'
  2. import PropTypes from 'prop-types'
  3. import CardPopup from '../common/CardPopup/CardPopup.jsx'
  4. import GenericContent from './ContentType/GenericContent.jsx'
  5. import FileContent from './ContentType/FileContent.jsx'
  6. import WsContent from './ContentType/WsContent.jsx'
  7. require('./PopupCreateContainer.styl')
  8. const PopupCreateContainer = props => {
  9. const FormCreateContent = (() => {
  10. switch (props.type) {
  11. case 'Workspace':
  12. return <WsContent />
  13. case 'File':
  14. return <FileContent />
  15. case 'folder':
  16. return <GenericContent />
  17. default:
  18. return <GenericContent />
  19. }
  20. })()
  21. // return (
  22. // <div className='popupcontent'>
  23. // <div className='popupcontent__container card'>
  24. // <div className='popupcontent__container__header' />
  25. // <div className='card-body nopadding'>
  26. // { FormCreateContent }
  27. // </div>
  28. // </div>
  29. // </div>
  30. // )
  31. return (
  32. <CardPopup customClass='popupCreateContent' onClose={props.onClose}>
  33. { FormCreateContent }
  34. </CardPopup>
  35. )
  36. }
  37. export default PopupCreateContainer
  38. PopupCreateContainer.propTypes = {
  39. type: PropTypes.string.isRequired,
  40. folder: PropTypes.object,
  41. onClose: PropTypes.func.isRequired
  42. }