App.js (1361B)
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 PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs"); 8 const { 9 createFactory, 10 PureComponent, 11 } = require("resource://devtools/client/shared/vendor/react.mjs"); 12 const { 13 main, 14 } = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 15 16 const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); 17 const LocalizationProvider = createFactory(FluentReact.LocalizationProvider); 18 19 const PageSwitcher = createFactory( 20 require("resource://devtools/client/application/src/components/routing/PageSwitcher.js") 21 ); 22 const Sidebar = createFactory( 23 require("resource://devtools/client/application/src/components/routing/Sidebar.js") 24 ); 25 26 /** 27 * This is the main component for the application panel. 28 */ 29 class App extends PureComponent { 30 static get propTypes() { 31 return { 32 fluentBundles: PropTypes.array.isRequired, 33 }; 34 } 35 36 render() { 37 const { fluentBundles } = this.props; 38 39 return LocalizationProvider( 40 { bundles: fluentBundles }, 41 main({ className: `app` }, Sidebar({}), PageSwitcher({})) 42 ); 43 } 44 } 45 46 module.exports = App;