闭社主体 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.

35 lines
1017 B

  1. // allow override variables here
  2. require.context('../../assets/stylesheets/', false, /variables.*\.scss$/);
  3. // import default stylesheet with variables
  4. require('font-awesome/css/font-awesome.css');
  5. require('../styles/application.scss');
  6. function onDomContentLoaded(callback) {
  7. if (document.readyState !== 'loading') {
  8. callback();
  9. } else {
  10. document.addEventListener('DOMContentLoaded', callback);
  11. }
  12. }
  13. function main() {
  14. const Mastodon = require('mastodon/containers/mastodon').default;
  15. const React = require('react');
  16. const ReactDOM = require('react-dom');
  17. window.Perf = require('react-addons-perf');
  18. require.context('../images/', true);
  19. // import customization styles
  20. require.context('../../assets/stylesheets/', false, /custom.*\.scss$/);
  21. onDomContentLoaded(() => {
  22. const mountNode = document.getElementById('mastodon');
  23. const props = JSON.parse(mountNode.getAttribute('data-props'));
  24. ReactDOM.render(<Mastodon {...props} />, mountNode);
  25. });
  26. }
  27. export default main;