PopupCreateContainer.jsx 1.4KB

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