ampache_react/app/containers/Root.jsx

29 lines
929 B
React
Raw Normal View History

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
};