Skip to content

Commit d971035

Browse files
iansujasonLaster
authored andcommitted
Replace function SVG with unicode character in Outline pane (firefox-devtools#5293)
1 parent 7943833 commit d971035

File tree

7 files changed

+23
-29
lines changed

7 files changed

+23
-29
lines changed

assets/images/Svg.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const svg = {
1818
domain: require("./domain.svg"),
1919
file: require("./file.svg"),
2020
folder: require("./folder.svg"),
21-
function: require("./function.svg"),
2221
globe: require("./globe.svg"),
2322
javascript: require("./javascript.svg"),
2423
jquery: require("./jquery.svg"),

assets/images/function.svg

-15
This file was deleted.

src/components/PrimaryPanes/Outline.css

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
white-space: nowrap;
4444
}
4545

46+
.outline-list__element-icon {
47+
padding-right: 0.4rem;
48+
padding-left: 1rem;
49+
}
50+
4651
.outline-list__element:hover {
4752
background: var(--theme-toolbar-background-hover);
4853
}

src/components/PrimaryPanes/Outline.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { bindActionCreators } from "redux";
99
import { connect } from "react-redux";
1010
import actions from "../../actions";
1111
import { getSelectedSource, getSymbols } from "../../selectors";
12-
import Svg from "../shared/Svg";
1312

1413
import "./Outline.css";
1514
import PreviewFunction from "../shared/PreviewFunction";
@@ -55,7 +54,7 @@ export class Outline extends Component<Props> {
5554
className="outline-list__element"
5655
onClick={() => this.selectItem(location)}
5756
>
58-
<Svg name="function" />
57+
<span className="outline-list__element-icon">λ</span>
5958
<PreviewFunction func={{ name, parameterNames }} />
6059
</li>
6160
);

src/components/tests/__snapshots__/Outline.spec.js.snap

+15-9
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ exports[`Outline should render a list of functions when properties change 1`] =
1212
key="my_example_function1:21:undefined"
1313
onClick={[Function]}
1414
>
15-
<Svg
16-
name="function"
17-
/>
15+
<span
16+
className="outline-list__element-icon"
17+
>
18+
λ
19+
</span>
1820
<PreviewFunction
1921
func={
2022
Object {
@@ -29,9 +31,11 @@ exports[`Outline should render a list of functions when properties change 1`] =
2931
key="my_example_function2:22:undefined"
3032
onClick={[Function]}
3133
>
32-
<Svg
33-
name="function"
34-
/>
34+
<span
35+
className="outline-list__element-icon"
36+
>
37+
λ
38+
</span>
3539
<PreviewFunction
3640
func={
3741
Object {
@@ -57,9 +61,11 @@ exports[`Outline should render ignore anonimous functions 1`] = `
5761
key="my_example_function1:21:undefined"
5862
onClick={[Function]}
5963
>
60-
<Svg
61-
name="function"
62-
/>
64+
<span
65+
className="outline-list__element-icon"
66+
>
67+
λ
68+
</span>
6369
<PreviewFunction
6470
func={
6571
Object {

src/test/mochitest/head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ const selectors = {
962962
fileMatch: ".managed-tree .result",
963963
popup: ".popover",
964964
tooltip: ".tooltip",
965-
outlineItem: i => `.outline-list__element:nth-child(${i})`,
965+
outlineItem: i => `.outline-list__element:nth-child(${i}) .function-signature`,
966966
outlineItems: ".outline-list__element"
967967
};
968968

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -3743,7 +3743,7 @@ eslint-plugin-jest@^21.5.0:
37433743
version "21.7.0"
37443744
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.7.0.tgz#651f1c6ce999af3ac59ab8bf8a376d742fd0fc23"
37453745

3746-
3746+
eslint-plugin-mozilla@^0.7.0:
37473747
version "0.7.0"
37483748
resolved "https://registry.yarnpkg.com/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.7.0.tgz#679bbdc16e669d5213373578d7c5764e21234188"
37493749
dependencies:

0 commit comments

Comments
 (0)