ampache_react/app/containers/Root.jsx

32 lines
1011 B
React
Raw Permalink Normal View History

/**
* Root component to render, setting locale, messages, Router and Store.
*/
2016-07-07 23:23:18 +02:00
import React, { Component, PropTypes } from "react";
import { Provider } from "react-redux";
import { Router } from "react-router";
import { IntlProvider } from "react-intl";
2016-07-07 23:23:18 +02:00
import routes from "../routes";
export default class Root extends Component {
render() {
2016-08-03 22:31:11 +02:00
const { locale, messages, defaultLocale, store, history, render } = this.props;
2016-07-07 23:23:18 +02:00
return (
<Provider store={store}>
<IntlProvider locale={locale} messages={messages} defaultLocale={defaultLocale}>
2016-08-03 22:31:11 +02:00
<Router history={history} routes={routes} render={render} />
</IntlProvider>
2016-07-07 23:23:18 +02:00
</Provider>
);
}
}
Root.propTypes = {
store: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
2016-08-03 22:31:11 +02:00
render: PropTypes.func,
locale: PropTypes.string.isRequired,
messages: PropTypes.object.isRequired,
defaultLocale: PropTypes.string.isRequired,
2016-07-07 23:23:18 +02:00
};