ConnectSteps.js (1351B)
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 PureComponent, 9 createFactory, 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 FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); 15 const Localized = createFactory(FluentReact.Localized); 16 17 class ConnectSteps extends PureComponent { 18 static get propTypes() { 19 return { 20 steps: PropTypes.arrayOf( 21 PropTypes.shape({ 22 localizationId: PropTypes.string.isRequired, 23 }).isRequired 24 ), 25 }; 26 } 27 28 render() { 29 return dom.ul( 30 { 31 className: "connect-page__step-list", 32 }, 33 ...this.props.steps.map(step => 34 Localized( 35 { 36 id: step.localizationId, 37 }, 38 dom.li( 39 { 40 className: "connect-page__step", 41 key: step.localizationId, 42 }, 43 step.localizationId 44 ) 45 ) 46 ) 47 ); 48 } 49 } 50 51 module.exports = ConnectSteps;