index.js 743B

1234567891011121314151617181920212223242526272829
  1. import React from 'react'
  2. import ReactDOM from 'react-dom'
  3. import Thread from './container/Thread.jsx'
  4. import PopupCreateThread from './container/PopupCreateThread.jsx'
  5. require('./css/index.styl')
  6. const appInterface = {
  7. name: 'thread',
  8. isRendered: false,
  9. renderAppFeature: data => {
  10. return ReactDOM.render(
  11. <Thread data={data} />
  12. , document.getElementById(data.config.domContainer)
  13. )
  14. },
  15. unmountApp: domId => {
  16. return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
  17. },
  18. renderAppPopupCreation: data => {
  19. return ReactDOM.render(
  20. <PopupCreateThread data={data} />
  21. , document.getElementById(data.config.domContainer)
  22. )
  23. }
  24. }
  25. module.exports = appInterface