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.

30 lines
821 B

  1. import Mastodon from 'mastodon/containers/mastodon';
  2. import React from 'react';
  3. import ReactDOM from 'react-dom';
  4. import Rails from 'rails-ujs';
  5. import 'font-awesome/css/font-awesome.css';
  6. import '../styles/application.scss';
  7. if (!window.Intl) {
  8. require('intl');
  9. require('intl/locale-data/jsonp/en.js');
  10. }
  11. window.Perf = require('react-addons-perf');
  12. Rails.start();
  13. require.context('../images/', true);
  14. const customContext = require.context('../../assets/stylesheets/', false);
  15. if (customContext.keys().indexOf('./custom.scss') !== -1) {
  16. customContext('./custom.scss');
  17. }
  18. document.addEventListener('DOMContentLoaded', () => {
  19. const mountNode = document.getElementById('mastodon');
  20. const props = JSON.parse(mountNode.getAttribute('data-props'));
  21. ReactDOM.render(<Mastodon {...props} />, mountNode);
  22. });