Bug 1479411 - Rename RuntimeItem to SidebarItem;r=daisuke
MozReview-Commit-ID: AWo7uiZFSQT
--- a/devtools/client/aboutdebugging-new/aboutdebugging.css
+++ b/devtools/client/aboutdebugging-new/aboutdebugging.css
@@ -1,20 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import "resource://devtools/client/themes/variables.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/App.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/Sidebar.css";
-@import "resource://devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.css";
+@import "resource://devtools/client/aboutdebugging-new/src/components/SidebarItem.css";
:root {
- --runtime-item-icon-color: var(--grey-30);
- --runtime-item-selected-color: var(--blue-55);
+ --sidebar-item-icon-color: var(--grey-30);
+ --sidebar-item-selected-color: var(--blue-55);
}
html, body {
margin: 0;
padding: 0;
}
ul {
--- a/devtools/client/aboutdebugging-new/src/components/Sidebar.js
+++ b/devtools/client/aboutdebugging-new/src/components/Sidebar.js
@@ -6,17 +6,17 @@
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const ThisFirefox = require("../runtimes/this-firefox");
const Runtime = require("../runtimes/runtime");
-const RuntimeItem = createFactory(require("./runtime/RuntimeItem"));
+const SidebarItem = createFactory(require("./SidebarItem"));
class Sidebar extends PureComponent {
static get propTypes() {
return {
selectedRuntime: PropTypes.instanceOf(Runtime),
thisFirefox: PropTypes.instanceOf(ThisFirefox).isRequired,
};
}
@@ -25,17 +25,17 @@ class Sidebar extends PureComponent {
const { selectedRuntime, thisFirefox } = this.props;
return dom.section(
{
className: "sidebar",
},
dom.ul(
{},
- RuntimeItem({
+ SidebarItem({
icon: thisFirefox.getIcon(),
isSelected: thisFirefox === selectedRuntime,
name: thisFirefox.getName(),
})
)
);
}
}
rename from devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.css
rename to devtools/client/aboutdebugging-new/src/components/SidebarItem.css
--- a/devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.css
+++ b/devtools/client/aboutdebugging-new/src/components/SidebarItem.css
@@ -1,26 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-.runtime-item {
+.sidebar-item {
align-items: center;
display: flex;
font-size: 20px;
margin-inline-start: 24px;
}
-.runtime-item__icon {
- fill: var(--runtime-item-icon-color);
+.sidebar-item__icon {
+ fill: var(--sidebar-item-icon-color);
height: 24px;
margin-inline-end: 9px;
width: 24px;
-moz-context-properties: fill;
}
-.runtime-item--selected {
- color: var(--runtime-item-selected-color);
+.sidebar-item--selected {
+ color: var(--sidebar-item-selected-color);
}
-.runtime-item__icon--selected {
- fill: var(--runtime-item-selected-color);
+.sidebar-item__icon--selected {
+ fill: var(--sidebar-item-selected-color);
}
rename from devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.js
rename to devtools/client/aboutdebugging-new/src/components/SidebarItem.js
--- a/devtools/client/aboutdebugging-new/src/components/runtime/RuntimeItem.js
+++ b/devtools/client/aboutdebugging-new/src/components/SidebarItem.js
@@ -4,37 +4,37 @@
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
/**
- * This component shows the runtime as item in RuntimesPane.
+ * This component displays an item of the Sidebar component.
*/
-class RuntimeItem extends PureComponent {
+class SidebarItem extends PureComponent {
static get propTypes() {
return {
icon: PropTypes.string.isRequired,
isSelected: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
};
}
render() {
const { icon, isSelected, name } = this.props;
return dom.li(
{
- className: "runtime-item" + (isSelected ? " runtime-item--selected" : ""),
+ className: "sidebar-item" + (isSelected ? " sidebar-item--selected" : ""),
},
dom.img({
- className: "runtime-item__icon" +
- (isSelected ? " runtime-item__icon--selected" : ""),
+ className: "sidebar-item__icon" +
+ (isSelected ? " sidebar-item__icon--selected" : ""),
src: icon,
}),
name
);
}
}
-module.exports = RuntimeItem;
+module.exports = SidebarItem;
--- a/devtools/client/aboutdebugging-new/src/components/moz.build
+++ b/devtools/client/aboutdebugging-new/src/components/moz.build
@@ -1,14 +1,12 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-DIRS += [
- 'runtime',
-]
-
DevToolsModules(
'App.css',
'App.js',
'Sidebar.css',
- 'Sidebar.js'
+ 'Sidebar.js',
+ 'SidebarItem.css',
+ 'SidebarItem.js',
)
deleted file mode 100644
--- a/devtools/client/aboutdebugging-new/src/components/runtime/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DevToolsModules(
- 'RuntimeItem.css',
- 'RuntimeItem.js',
-)