1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
var React = require('react');
var RightPanelStore = require('../stores/RightPanelStore');
var RightPanelActions = require('../actions/RightPanelActions');
var Article = React.createClass({
render: function() {
return (<div />);
},
});
var Feed = React.createClass({
render: function() {
return (<div />);
},
});
var Category = React.createClass({
render: function() {
return (<div />);
},
});
var RightPanelMenu = React.createClass({
getInitialState: function() {
return {};
},
render: function() {
return (<div />);
},
componentDidMount: function() {
RightPanelStore.addChangeListener(this._onChange);
},
componentWillUnmount: function() {
RightPanelStore.removeChangeListener(this._onChange);
},
_onChange: function() {
},
});
var RightPanel = React.createClass({
getInitialState: function() {
return {obj_type: null, obj_id: null};
},
render: function() {
if (this.state.obj_type == 'article') {
return <Article />;
} else if (this.state.obj_type == 'feed') {
return <Feed />;
} else if (this.state.obj_type == 'category') {
return <Category />;
}
return <div />;
},
componentDidMount: function() {
RightPanelActions.reload();
RightPanelStore.addChangeListener(this._onChange);
},
componentWillUnmount: function() {
RightPanelStore.removeChangeListener(this._onChange);
},
_onChange: function() {
},
});
module.exports = {RightPanelMenu: RightPanelMenu, RightPanel: RightPanel};
|