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-07-28 01:22:48 +02:00
|
|
|
const { locale, messages, defaultLocale, store, history } = 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}>
|
|
|
|
<Router history={history} routes={routes} />
|
|
|
|
</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,
|
|
|
|
locale: PropTypes.string.isRequired,
|
|
|
|
messages: PropTypes.object.isRequired,
|
|
|
|
defaultLocale: PropTypes.string.isRequired
|
2016-07-07 23:23:18 +02:00
|
|
|
};
|