IssueList.js (1300B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const { 8 createFactory, 9 PureComponent, 10 } = require("resource://devtools/client/shared/vendor/react.mjs"); 11 const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 12 const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs"); 13 14 const Types = require("resource://devtools/client/inspector/compatibility/types.js"); 15 16 const IssueItem = createFactory( 17 require("resource://devtools/client/inspector/compatibility/components/IssueItem.js") 18 ); 19 20 class IssueList extends PureComponent { 21 static get propTypes() { 22 return { 23 dispatch: PropTypes.func.isRequired, 24 issues: PropTypes.arrayOf(PropTypes.shape(Types.issue)).isRequired, 25 setSelectedNode: PropTypes.func.isRequired, 26 }; 27 } 28 29 render() { 30 const { dispatch, issues, setSelectedNode } = this.props; 31 32 return dom.ul( 33 { className: "compatibility-issue-list" }, 34 issues.map(issue => 35 IssueItem({ 36 ...issue, 37 dispatch, 38 setSelectedNode, 39 }) 40 ) 41 ); 42 } 43 } 44 45 module.exports = IssueList;