File tree 6 files changed +29
-47
lines changed
6 files changed +29
-47
lines changed Original file line number Diff line number Diff line change
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
+ import React from "react" ;
6
+
7
+ const BREAKPOINT_SVG =
8
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 15" width="60" height="15"><path d="M53.07.5H1.5c-.54 0-1 .46-1 1v12c0 .54.46 1 1 1h51.57c.58 0 1.15-.26 1.53-.7l4.7-6.3-4.7-6.3c-.38-.44-.95-.7-1.53-.7z"/></svg>' ;
9
+ const COLUMN_MARKER_SVG =
10
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 13" width="11" height="13"><path d="M5.07.5H1.5c-.54 0-1 .46-1 1v10c0 .54.46 1 1 1h3.57c.58 0 1.15-.26 1.53-.7l3.7-5.3-3.7-5.3C6.22.76 5.65.5 5.07.5z"/></svg>' ;
11
+
12
+ type Props = {
13
+ column : boolean
14
+ } ;
15
+
16
+ export default function BreakpointSvg ( { column } : Props ) {
17
+ const svg = column ? COLUMN_MARKER_SVG : BREAKPOINT_SVG ;
18
+
19
+ /* eslint-disable react/no-danger */
20
+ return < span dangerouslySetInnerHTML = { { __html : svg } } /> ;
21
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 7
7
import React , { PureComponent } from "react" ;
8
8
import ReactDOM from "react-dom" ;
9
9
import classnames from "classnames" ;
10
- import Svg from "../shared/Svg " ;
10
+ import BreakpointSvg from "../shared/BreakpointSvg " ;
11
11
12
12
import { getDocument , toEditorLine } from "../../utils/editor" ;
13
13
import { getSelectedLocation } from "../../utils/source-maps" ;
@@ -20,7 +20,7 @@ import type { EditorItemActions } from "./menus/editor";
20
20
import type { Source , Breakpoint as BreakpointType } from "../../types" ;
21
21
22
22
const breakpointSvg = document . createElement ( "div" ) ;
23
- ReactDOM . render ( < Svg name = "breakpoint" /> , breakpointSvg ) ;
23
+ ReactDOM . render ( < BreakpointSvg column = { false } /> , breakpointSvg ) ;
24
24
25
25
type Props = {
26
26
breakpoint : BreakpointType ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import React, { PureComponent } from "react";
7
7
import ReactDOM from "react-dom" ;
8
8
import classnames from "classnames" ;
9
9
import { getDocument } from "../../utils/editor" ;
10
- import Svg from "../shared/Svg " ;
10
+ import BreakpointSvg from "../shared/BreakpointSvg " ;
11
11
import { showMenu } from "devtools-contextmenu" ;
12
12
import { breakpointItems , createBreakpointItems } from "./menus/breakpoints" ;
13
13
@@ -28,7 +28,7 @@ type Props = {
28
28
} ;
29
29
30
30
const breakpointImg = document . createElement ( "button" ) ;
31
- ReactDOM . render ( < Svg name = { "column-marker" } /> , breakpointImg ) ;
31
+ ReactDOM . render ( < BreakpointSvg column = { true } /> , breakpointImg ) ;
32
32
33
33
function makeBookmark ( { breakpoint } , { onClick, onContextMenu } ) {
34
34
const bp = breakpointImg . cloneNode ( true ) ;
Original file line number Diff line number Diff line change 7
7
* This file maps the SVG React Components in the images directory.
8
8
*/
9
9
10
- import Svg from "../../../images/Svg " ;
10
+ import BreakpointSvg from "../../../images/BreakpointSvg " ;
11
11
12
- export default Svg ;
12
+ export default BreakpointSvg ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import * as reselect from "reselect";
33
33
import classnames from "classnames" ;
34
34
import devtoolsSplitter from "devtools-splitter" ;
35
35
import move from "lodash-move" ;
36
- import Svg from "./components/shared/Svg " ;
36
+ import BreakpointSvg from "./components/shared/BreakpointSvg " ;
37
37
38
38
// We cannot directly export literals containing special characters
39
39
// (eg. "my-module/Test") which is why they are nested in "vendored".
@@ -55,5 +55,5 @@ export const vendored = {
55
55
reselect,
56
56
// Svg is required via relative paths, so the key is not imported path.
57
57
// See .babel/transform-mc.js
58
- Svg
58
+ BreakpointSvg
59
59
} ;
You can’t perform that action at this time.
0 commit comments