diff options
author | kibigo! <marrus-sh@users.noreply.github.com> | 2017-11-20 22:13:37 -0800 |
---|---|---|
committer | kibigo! <marrus-sh@users.noreply.github.com> | 2017-11-20 22:13:37 -0800 |
commit | bdbbd06dad298dc3e1a5f568f4a3ff3635b48f22 (patch) | |
tree | 1a475460389053b41f293d27f7c915f0d545d4ad /app/javascript/packs/about.js | |
parent | 321fa41930f8a11356939a1684ff153f2f46443b (diff) |
Finalized theme loading and stuff
Diffstat (limited to 'app/javascript/packs/about.js')
-rw-r--r-- | app/javascript/packs/about.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/javascript/packs/about.js b/app/javascript/packs/about.js new file mode 100644 index 000000000..63e12da42 --- /dev/null +++ b/app/javascript/packs/about.js @@ -0,0 +1,22 @@ +import loadPolyfills from '../mastodon/load_polyfills'; + +function loaded() { + const TimelineContainer = require('../mastodon/containers/timeline_container').default; + const React = require('react'); + const ReactDOM = require('react-dom'); + const mountNode = document.getElementById('mastodon-timeline'); + + if (mountNode !== null) { + const props = JSON.parse(mountNode.getAttribute('data-props')); + ReactDOM.render(<TimelineContainer {...props} />, mountNode); + } +} + +function main() { + const ready = require('../mastodon/ready').default; + ready(loaded); +} + +loadPolyfills().then(main).catch(error => { + console.error(error); +}); |