index.js 1012B

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react'
  2. import ReactDOM from 'react-dom'
  3. import HtmlDocument from './container/HtmlDocument.jsx'
  4. import PopupCreateHtmlDocument from './container/PopupCreateHtmlDocument.jsx'
  5. // @TODO make a file that contains all events implemented by this App.
  6. // @todo add this file to appInterface
  7. // @todo app shall make it's customReducer from the events of this app
  8. // so it will be testable by tracim_frontend
  9. require('./css/index.styl')
  10. const appInterface = {
  11. name: 'html-document',
  12. isRendered: false,
  13. renderAppFeature: data => {
  14. return ReactDOM.render(
  15. <HtmlDocument data={data} />
  16. , document.getElementById(data.config.domContainer)
  17. )
  18. },
  19. unmountApp: domId => {
  20. return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
  21. },
  22. renderAppPopupCreation: data => {
  23. return ReactDOM.render(
  24. <PopupCreateHtmlDocument data={data} />
  25. , document.getElementById(data.config.domContainer)
  26. )
  27. }
  28. }
  29. module.exports = appInterface