Phyks (Lucas Verney)
fffe9c4cd3
Major code review, cleaning the code and adding a lot of comments. Also implements a separate store to keep entities with a reference count and garbage collection. This closes #15. Known issues at the moment are: * Webplayer is no longer working, it has to be refactored. * AlbumPage is to be implemented.
32 lines
1010 B
JavaScript
32 lines
1010 B
JavaScript
/**
|
|
* Root component to render, setting locale, messages, Router and Store.
|
|
*/
|
|
import React, { Component, PropTypes } from "react";
|
|
import { Provider } from "react-redux";
|
|
import { Router } from "react-router";
|
|
import { IntlProvider } from "react-intl";
|
|
|
|
import routes from "../routes";
|
|
|
|
export default class Root extends Component {
|
|
render() {
|
|
const { locale, messages, defaultLocale, store, history, render } = this.props;
|
|
return (
|
|
<Provider store={store}>
|
|
<IntlProvider locale={locale} messages={messages} defaultLocale={defaultLocale}>
|
|
<Router history={history} routes={routes} render={render} />
|
|
</IntlProvider>
|
|
</Provider>
|
|
);
|
|
}
|
|
}
|
|
|
|
Root.propTypes = {
|
|
store: PropTypes.object.isRequired,
|
|
history: PropTypes.object.isRequired,
|
|
render: PropTypes.func,
|
|
locale: PropTypes.string.isRequired,
|
|
messages: PropTypes.object.isRequired,
|
|
defaultLocale: PropTypes.string.isRequired
|
|
};
|