aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/components
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-21 13:48:06 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-26 23:47:08 +0100
commit41aea41aaff0886fd6c211f03db2b54863a97165 (patch)
tree8d67b31febf78b5c40d60dc8ea3cb613fa4a65f2 /src/web/js/components
parentbootstraping react (diff)
downloadnewspipe-41aea41aaff0886fd6c211f03db2b54863a97165.tar.gz
newspipe-41aea41aaff0886fd6c211f03db2b54863a97165.tar.bz2
newspipe-41aea41aaff0886fd6c211f03db2b54863a97165.zip
filters are working !
Diffstat (limited to 'src/web/js/components')
-rw-r--r--src/web/js/components/MiddlePanel.react.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/web/js/components/MiddlePanel.react.js b/src/web/js/components/MiddlePanel.react.js
index 51d582c0..c5a9c3f9 100644
--- a/src/web/js/components/MiddlePanel.react.js
+++ b/src/web/js/components/MiddlePanel.react.js
@@ -50,10 +50,8 @@ var TableLine = React.createClass({
});
var TableBody = React.createClass({
- propTypes: {articles: React.PropTypes.array.isRequired,
- },
getInitialState: function() {
- return {articles: this.props.articles,
+ return {articles: [],
};
},
render: function() {
@@ -73,19 +71,6 @@ var TableBody = React.createClass({
</table>
</div>
);
- }
-});
-
-var MiddlePanel = React.createClass({
- getInitialState: function() {
- return {articles: []};
- },
- render: function() {
- var body = null;
- if(this.state.articles.length) {
- body = (<TableBody articles={this.state.articles} />);
- }
- return (<div className="col-md-offset-2 col-md-10 main">{body}</div>);
},
componentDidMount: function() {
MiddlePanelActions.reload();
@@ -95,8 +80,16 @@ var MiddlePanel = React.createClass({
MiddlePanelStore.removeChangeListener(this._onChange);
},
_onChange: function() {
- var datas = MiddlePanelStore.getAll();
- this.setState({articles: datas.articles});
+ this.setState({articles: MiddlePanelStore.getArticles()});
+ },
+});
+
+var MiddlePanel = React.createClass({
+ render: function() {
+ return (<div className="col-md-offset-2 col-md-10 main">
+ <TableBody />
+ </div>
+ );
},
});
bgstack15