ManifestEmpty.js (2056B)
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 { openDocLink } = require("resource://devtools/client/shared/link.js"); 8 9 const { 10 createFactory, 11 PureComponent, 12 } = require("resource://devtools/client/shared/vendor/react.mjs"); 13 const { 14 a, 15 article, 16 aside, 17 div, 18 h1, 19 img, 20 p, 21 } = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 22 23 const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); 24 const Localized = createFactory(FluentReact.Localized); 25 26 const { getMdnLinkParams } = ChromeUtils.importESModule( 27 "resource://devtools/shared/mdn.mjs" 28 ); 29 const DOC_URL = 30 "https://developer.mozilla.org/docs/Web/Progressive_web_apps/Manifest?" + 31 getMdnLinkParams("sw-panel-blank"); 32 33 /** 34 * This component displays help information when no manifest is found for the 35 * current target. 36 */ 37 class ManifestEmpty extends PureComponent { 38 openDocumentation() { 39 openDocLink(DOC_URL); 40 } 41 42 render() { 43 return article( 44 { className: "app-page__icon-container js-manifest-empty" }, 45 aside( 46 {}, 47 Localized( 48 { 49 id: "sidebar-item-manifest", 50 attrs: { 51 alt: true, 52 }, 53 }, 54 img({ 55 className: "app-page__icon", 56 src: "chrome://devtools/skin/images/application-manifest.svg", 57 }) 58 ) 59 ), 60 div( 61 {}, 62 Localized( 63 { 64 id: "manifest-empty-intro2", 65 }, 66 h1({ className: "app-page__title" }) 67 ), 68 p( 69 {}, 70 Localized( 71 { id: "manifest-empty-intro-link" }, 72 a({ 73 onClick: () => this.openDocumentation(), 74 }) 75 ) 76 ), 77 Localized({ id: "manifest-non-existing" }, p({})) 78 ) 79 ); 80 } 81 } 82 83 // Exports 84 module.exports = ManifestEmpty;