闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
692 B

  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. });