From f509ad70664c360920bfd1bd9b302e4eeb3043df Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 26 Sep 2017 23:00:45 +0200 Subject: Upgrade to React v16.0.0. --- src/web/js/components/MiddlePanel.react.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/web/js/components/MiddlePanel.react.js') diff --git a/src/web/js/components/MiddlePanel.react.js b/src/web/js/components/MiddlePanel.react.js index 2a8ab96e..fc7c763a 100644 --- a/src/web/js/components/MiddlePanel.react.js +++ b/src/web/js/components/MiddlePanel.react.js @@ -1,9 +1,11 @@ var React = require('react'); +var createReactClass = require('create-react-class'); var Row = require('react-bootstrap/lib/Row'); var Button = require('react-bootstrap/lib/Button'); var ButtonGroup = require('react-bootstrap/lib/ButtonGroup'); var Glyphicon = require('react-bootstrap/lib/Glyphicon'); +var PropTypes = require('prop-types'); var MiddlePanelStore = require('../stores/MiddlePanelStore'); var MiddlePanelActions = require('../actions/MiddlePanelActions'); @@ -11,16 +13,16 @@ var RightPanelActions = require('../actions/RightPanelActions'); var JarrTime = require('./time.react'); -var TableLine = React.createClass({ - propTypes: {article_id: React.PropTypes.number.isRequired, - feed_title: React.PropTypes.string.isRequired, - icon_url: React.PropTypes.string, - title: React.PropTypes.string.isRequired, - rel_date: React.PropTypes.string.isRequired, - date: React.PropTypes.string.isRequired, - read: React.PropTypes.bool.isRequired, - selected: React.PropTypes.bool.isRequired, - liked: React.PropTypes.bool.isRequired, +var TableLine = createReactClass({ + propTypes: {article_id: PropTypes.number.isRequired, + feed_title: PropTypes.string.isRequired, + icon_url: PropTypes.string, + title: PropTypes.string.isRequired, + rel_date: PropTypes.string.isRequired, + date: PropTypes.string.isRequired, + read: PropTypes.bool.isRequired, + selected: PropTypes.bool.isRequired, + liked: PropTypes.bool.isRequired, }, getInitialState: function() { return {read: this.props.read, liked: this.props.liked, @@ -86,7 +88,7 @@ var TableLine = React.createClass({ }, }); -var MiddlePanelSearchRow = React.createClass({ +var MiddlePanelSearchRow = createReactClass({ getInitialState: function() { return {query: MiddlePanelStore._datas.query, search_title: MiddlePanelStore._datas.search_title, @@ -143,7 +145,7 @@ var MiddlePanelSearchRow = React.createClass({ }, }); -var MiddlePanelFilter = React.createClass({ +var MiddlePanelFilter = createReactClass({ getInitialState: function() { return {filter: MiddlePanelStore._datas.filter, display_search: MiddlePanelStore._datas.display_search}; @@ -219,7 +221,7 @@ var MiddlePanelFilter = React.createClass({ }, }); -var MiddlePanel = React.createClass({ +var MiddlePanel = createReactClass({ getInitialState: function() { return {filter: MiddlePanelStore._datas.filter, articles: []}; }, -- cgit