Skip to content

Commit 411909d

Browse files
committed
chore(web-ts-results): move icons to separate files
1 parent 1b8f49b commit 411909d

File tree

3 files changed

+68
-45
lines changed

3 files changed

+68
-45
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from "react";
2+
3+
const CopyIcon = () => {
4+
return (
5+
<>
6+
{/* svg from https://ionic.io/ionicons */}
7+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
8+
<rect
9+
x="128"
10+
y="128"
11+
width="336"
12+
height="336"
13+
rx="57"
14+
ry="57"
15+
fill="none"
16+
stroke="currentColor"
17+
strokeLinejoin="round"
18+
strokeWidth="32"
19+
/>
20+
<path
21+
d="M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"
22+
fill="none"
23+
stroke="currentColor"
24+
strokeLinecap="round"
25+
strokeLinejoin="round"
26+
strokeWidth="32"
27+
/>
28+
</svg>
29+
</>
30+
);
31+
};
32+
33+
export default CopyIcon;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from "react";
2+
3+
const PasteIcon = () => {
4+
return (
5+
<>
6+
{/* svg from https://ionic.io/ionicons */}
7+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
8+
<path
9+
d="M336 64h32a48 48 0 0148 48v320a48 48 0 01-48 48H144a48 48 0 01-48-48V112a48 48 0 0148-48h32"
10+
fill="none"
11+
stroke="currentColor"
12+
strokeLinejoin="round"
13+
strokeWidth="32"
14+
/>
15+
<rect
16+
x="176"
17+
y="32"
18+
width="160"
19+
height="64"
20+
rx="26.13"
21+
ry="26.13"
22+
fill="none"
23+
stroke="currentColor"
24+
strokeLinejoin="round"
25+
strokeWidth="32"
26+
/>
27+
</svg>
28+
</>
29+
);
30+
};
31+
export default PasteIcon;

webdriver-ts-results/src/components/selection/CopyPasteSelection.tsx

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { useCallback } from "react";
33
import { useEffect } from "react";
44
import { useDispatch, useSelector } from "react-redux";
55
import { setStateFromClipboard, State } from "../../reducer";
6+
import PasteIcon from "../../assets/icons/PasteIcon";
7+
import CopyIcon from "../../assets/icons/CopyIcon";
68

79
const CopyPasteSelection = () => {
810
console.log("CopyPasteSelection");
@@ -85,57 +87,14 @@ const CopyPasteSelection = () => {
8587
onClick={copy}
8688
aria-label="Copy selected frameworks and benchmarks"
8789
>
88-
{/* svg from https://ionic.io/ionicons */}
89-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
90-
<rect
91-
x="128"
92-
y="128"
93-
width="336"
94-
height="336"
95-
rx="57"
96-
ry="57"
97-
fill="none"
98-
stroke="currentColor"
99-
strokeLinejoin="round"
100-
strokeWidth="32"
101-
/>
102-
<path
103-
d="M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"
104-
fill="none"
105-
stroke="currentColor"
106-
strokeLinecap="round"
107-
strokeLinejoin="round"
108-
strokeWidth="32"
109-
/>
110-
</svg>
90+
<CopyIcon></CopyIcon>
11191
</button>
11292
<button
11393
className="iconbutton"
11494
onClick={handlePasteFromClipboard}
11595
aria-label="Paste selected items (or use ctrl/cmd + v for firefox)"
11696
>
117-
{/* svg from https://ionic.io/ionicons */}
118-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
119-
<path
120-
d="M336 64h32a48 48 0 0148 48v320a48 48 0 01-48 48H144a48 48 0 01-48-48V112a48 48 0 0148-48h32"
121-
fill="none"
122-
stroke="currentColor"
123-
strokeLinejoin="round"
124-
strokeWidth="32"
125-
/>
126-
<rect
127-
x="176"
128-
y="32"
129-
width="160"
130-
height="64"
131-
rx="26.13"
132-
ry="26.13"
133-
fill="none"
134-
stroke="currentColor"
135-
strokeLinejoin="round"
136-
strokeWidth="32"
137-
/>
138-
</svg>
97+
<PasteIcon></PasteIcon>
13998
</button>
14099
</>
141100
);

0 commit comments

Comments
 (0)