1
0

about.js 725 B

12345678910111213141516171819202122232425
  1. import loadPolyfills from '../mastodon/load_polyfills';
  2. import { start } from '../mastodon/common';
  3. start();
  4. function loaded() {
  5. const TimelineContainer = require('../mastodon/containers/timeline_container').default;
  6. const React = require('react');
  7. const ReactDOM = require('react-dom');
  8. const mountNode = document.getElementById('mastodon-timeline');
  9. if (mountNode !== null) {
  10. const props = JSON.parse(mountNode.getAttribute('data-props'));
  11. ReactDOM.render(<TimelineContainer {...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. });