pagraphcontrol/renderer.js
2018-11-08 20:39:54 +03:00

30 lines
638 B
JavaScript

/* global document */
const React = require('react');
const r = require('r-dom');
const { render } = require('react-dom');
const { Provider } = require('react-redux');
const createStore = require('./store');
const Graph = require('./components/graph');
const Preferences = require('./components/preferences');
const theme = require('./utils/theme');
const Root = () => r(Provider, {
store: createStore(),
}, r(React.Fragment, [
r(Graph),
r(Preferences),
]));
Object.entries(theme.colors).forEach(([ key, value ]) => {
document.body.style.setProperty('--' + key, value);
});
render(r(Root), document.getElementById('root'));