cuz
Version:
Front-end modular development kit.
43 lines (39 loc) • 1.26 kB
JavaScript
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import reactMixin from 'react-mixin';
import { Provider } from 'react-redux';
import { Router } from 'react-router';
// import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
import NoticeMixin, { NotificationSystem } from 'react-notice';
((state) => state._cuz, {})
.decorate(NoticeMixin)
export default class App extends Component {
static propTypes = {
store: PropTypes.object.isRequired,
routes: PropTypes.object.isRequired,
theme: PropTypes.array,
requests: PropTypes.array,
}
componentDidMount() {
this.setNotice(this.refs.notificationSystem);
}
render() {
return (
<div>
{this.props.requests.length > 0 &&
<div className="loadingbox">加载中...</div>
}
{this.props.theme}
<NotificationSystem ref="notificationSystem" />
<Provider store={this.props.store}>
<Router children={this.props.routes} />
</Provider>
{ // enableDevTools &&
// <DebugPanel top right bottom>
// <DevTools store={store} monitor={LogMonitor} />
// </DebugPanel>
}
</div>
);
}
}