1
0

share.js 692 B

12345678910111213141516171819202122232425
  1. import loadPolyfills from '../mastodon/load_polyfills';
  2. import { start } from '../mastodon/common';
  3. start();
  4. function loaded() {
  5. const ComposeContainer = require('../mastodon/containers/compose_container').default;
  6. const React = require('react');
  7. const ReactDOM = require('react-dom');
  8. const mountNode = document.getElementById('mastodon-compose');
  9. if (mountNode !== null) {
  10. const props = JSON.parse(mountNode.getAttribute('data-props'));
  11. ReactDOM.render(<ComposeContainer {...props} />, mountNode);
  12. }
  13. }
  14. function main() {
  15. const ready = require('../mastodon/ready').default;
  16. ready(loaded);
  17. }
  18. loadPolyfills().then(main).catch(error => {
  19. console.error(error);
  20. });