share.js 676 B

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