2016-07-07 23:23:18 +02:00
|
|
|
import React, { Component, PropTypes } from "react";
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
import { Router } from "react-router";
|
2016-07-28 01:22:48 +02:00
|
|
|
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}>
|
2016-07-28 01:22:48 +02:00
|
|
|
<IntlProvider locale={locale} messages={messages} defaultLocale={defaultLocale}>
|
2016-08-03 22:31:11 +02:00
|
|
|
<Router history={history} routes={routes} render={render} />
|
2016-07-28 01:22:48 +02:00
|
|
|
</IntlProvider>
|
2016-07-07 23:23:18 +02:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Root.propTypes = {
|
|
|
|
store: PropTypes.object.isRequired,
|
2016-07-28 01:22:48 +02:00
|
|
|
history: PropTypes.object.isRequired,
|
2016-08-03 22:31:11 +02:00
|
|
|
render: PropTypes.func,
|
2016-07-28 01:22:48 +02:00
|
|
|
locale: PropTypes.string.isRequired,
|
|
|
|
messages: PropTypes.object.isRequired,
|
|
|
|
defaultLocale: PropTypes.string.isRequired
|
2016-07-07 23:23:18 +02:00
|
|
|
};
|