Skip to content

Commit b24d62a

Browse files
authored
Refactor React Classes to Functions (#483)
1 parent e541446 commit b24d62a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2341
-2726
lines changed

portal-ui/src/icons/AddIcon.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616

1717
import React from "react";
1818
import { SvgIcon } from "@material-ui/core";
19-
class AddIcon extends React.Component {
20-
render() {
21-
return (
22-
<SvgIcon viewBox="0 0 12 12">
23-
<path
24-
fill="#081c42"
25-
className="a"
26-
d="M-13160.269,1885.114h-3.235v-4.381h-4.382V1877.5h4.382v-4.381h3.235v4.381h4.383v3.238h-4.383v4.38Z"
27-
transform="translate(13167.886 -1873.114)"
28-
/>
29-
</SvgIcon>
30-
);
31-
}
32-
}
19+
const AddIcon = () => {
20+
return (
21+
<SvgIcon viewBox="0 0 12 12">
22+
<path
23+
fill="#081c42"
24+
className="a"
25+
d="M-13160.269,1885.114h-3.235v-4.381h-4.382V1877.5h4.382v-4.381h3.235v4.381h4.383v3.238h-4.383v4.38Z"
26+
transform="translate(13167.886 -1873.114)"
27+
/>
28+
</SvgIcon>
29+
);
30+
};
3331

3432
export default AddIcon;

portal-ui/src/icons/AllBucketsIcon.tsx

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,59 @@
1616

1717
import React from "react";
1818
import { SvgIcon } from "@material-ui/core";
19-
class AllBucketsIcon extends React.Component {
20-
render() {
21-
return (
22-
<SvgIcon viewBox="0 0 15.834 17.375">
23-
<defs>
24-
<linearGradient
25-
id="a"
26-
y1="0.5"
27-
x2="1"
28-
y2="0.5"
29-
gradientUnits="objectBoundingBox"
30-
>
31-
<stop offset="0.044" stopColor="#362585" />
32-
<stop offset="0.301" stopColor="#281b6f" />
33-
<stop offset="1" stopColor="#1e1560" />
34-
</linearGradient>
35-
</defs>
36-
<g transform="translate(0 0.375)">
37-
<circle
38-
style={{ opacity: 0.1, fill: "url(#a)" }}
39-
cx="6.625"
40-
cy="6.625"
41-
r="6.625"
42-
transform="translate(0 3.75)"
19+
20+
const AllBucketsIcon = () => {
21+
return (
22+
<SvgIcon viewBox="0 0 15.834 17.375">
23+
<defs>
24+
<linearGradient
25+
id="a"
26+
y1="0.5"
27+
x2="1"
28+
y2="0.5"
29+
gradientUnits="objectBoundingBox"
30+
>
31+
<stop offset="0.044" stopColor="#362585" />
32+
<stop offset="0.301" stopColor="#281b6f" />
33+
<stop offset="1" stopColor="#1e1560" />
34+
</linearGradient>
35+
</defs>
36+
<g transform="translate(0 0.375)">
37+
<circle
38+
style={{ opacity: 0.1, fill: "url(#a)" }}
39+
cx="6.625"
40+
cy="6.625"
41+
r="6.625"
42+
transform="translate(0 3.75)"
43+
/>
44+
<g transform="translate(3.092)">
45+
<ellipse
46+
style={{
47+
fill: "none",
48+
stroke: "#707070",
49+
strokeMiterlimit: 10,
50+
strokeWidth: "0.75px",
51+
}}
52+
cx="6.183"
53+
cy="1.244"
54+
rx="6.183"
55+
ry="1.244"
56+
transform="translate(0)"
57+
/>
58+
<path
59+
style={{
60+
fill: "none",
61+
stroke: "#707070",
62+
strokeMiterlimit: 10,
63+
strokeWidth: "0.75px",
64+
}}
65+
d="M-3722.174,1225.225l-1.687,10.292a.858.858,0,0,1-.578.669,12.182,12.182,0,0,1-3.918.647,12.187,12.187,0,0,1-3.894-.639.878.878,0,0,1-.6-.678q-.843-5.145-1.687-10.291"
66+
transform="translate(3734.541 -1223.981)"
4367
/>
44-
<g transform="translate(3.092)">
45-
<ellipse
46-
style={{
47-
fill: "none",
48-
stroke: "#707070",
49-
strokeMiterlimit: 10,
50-
strokeWidth: "0.75px",
51-
}}
52-
cx="6.183"
53-
cy="1.244"
54-
rx="6.183"
55-
ry="1.244"
56-
transform="translate(0)"
57-
/>
58-
<path
59-
style={{
60-
fill: "none",
61-
stroke: "#707070",
62-
strokeMiterlimit: 10,
63-
strokeWidth: "0.75px",
64-
}}
65-
d="M-3722.174,1225.225l-1.687,10.292a.858.858,0,0,1-.578.669,12.182,12.182,0,0,1-3.918.647,12.187,12.187,0,0,1-3.894-.639.878.878,0,0,1-.6-.678q-.843-5.145-1.687-10.291"
66-
transform="translate(3734.541 -1223.981)"
67-
/>
68-
</g>
6968
</g>
70-
</SvgIcon>
71-
);
72-
}
73-
}
69+
</g>
70+
</SvgIcon>
71+
);
72+
};
7473

7574
export default AllBucketsIcon;

portal-ui/src/icons/BucketsIcon.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616

1717
import React from "react";
1818
import { SvgIcon } from "@material-ui/core";
19-
class BucketsIcon extends React.Component {
20-
render() {
21-
return (
22-
<SvgIcon>
23-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
24-
<path d="M8.392,10H1.608L0,0H10Z" />
25-
</svg>
26-
</SvgIcon>
27-
);
28-
}
29-
}
19+
20+
const BucketsIcon = () => {
21+
return (
22+
<SvgIcon>
23+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
24+
<path d="M8.392,10H1.608L0,0H10Z" />
25+
</svg>
26+
</SvgIcon>
27+
);
28+
};
3029

3130
export default BucketsIcon;

portal-ui/src/icons/ClustersIcon.tsx

Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -16,108 +16,106 @@
1616

1717
import React from "react";
1818
import { SvgIcon } from "@material-ui/core";
19-
class ClustersIcon extends React.Component {
20-
render() {
21-
return (
22-
<SvgIcon>
23-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 9">
24-
<g transform="translate(79 438.479)">
19+
const ClustersIcon = () => {
20+
return (
21+
<SvgIcon>
22+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 9">
23+
<g transform="translate(79 438.479)">
24+
<g>
2525
<g>
26-
<g>
27-
<rect x="-77.9" y="-434.5" width="7.8" height="1" />
28-
</g>
26+
<rect x="-77.9" y="-434.5" width="7.8" height="1" />
2927
</g>
28+
</g>
29+
<g>
3030
<g>
31-
<g>
32-
<rect
33-
x="-77.9"
34-
y="-434.5"
35-
transform="matrix(0.4999 -0.8661 0.8661 0.4999 338.8698 -281.1237)"
36-
width="7.8"
37-
height="1"
38-
/>
39-
</g>
31+
<rect
32+
x="-77.9"
33+
y="-434.5"
34+
transform="matrix(0.4999 -0.8661 0.8661 0.4999 338.8698 -281.1237)"
35+
width="7.8"
36+
height="1"
37+
/>
4038
</g>
39+
</g>
40+
<g>
4141
<g>
42-
<g>
43-
<rect
44-
x="-74.5"
45-
y="-437.9"
46-
transform="matrix(0.866 -0.5001 0.5001 0.866 207.1129 -95.1668)"
47-
width="1"
48-
height="7.8"
49-
/>
50-
</g>
42+
<rect
43+
x="-74.5"
44+
y="-437.9"
45+
transform="matrix(0.866 -0.5001 0.5001 0.866 207.1129 -95.1668)"
46+
width="1"
47+
height="7.8"
48+
/>
5149
</g>
50+
</g>
51+
<g>
5252
<g>
53-
<g>
54-
<path
55-
d="M-71.8-430.1h-4.5l-2.2-3.9l2.2-3.9h4.5l2.2,3.9L-71.8-430.1z M-75.7-431.1h3.3l1.7-2.9l-1.7-2.9h-3.3
53+
<path
54+
d="M-71.8-430.1h-4.5l-2.2-3.9l2.2-3.9h4.5l2.2,3.9L-71.8-430.1z M-75.7-431.1h3.3l1.7-2.9l-1.7-2.9h-3.3
5655
l-1.7,2.9L-75.7-431.1z"
57-
/>
58-
</g>
56+
/>
5957
</g>
58+
</g>
59+
<g>
6060
<g>
61-
<g>
62-
<path
63-
d="M-72.3-434c0,0.9-0.7,1.7-1.7,1.7c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7
61+
<path
62+
d="M-72.3-434c0,0.9-0.7,1.7-1.7,1.7c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7
6463
C-73.1-435.7-72.3-434.9-72.3-434z"
65-
/>
66-
</g>
64+
/>
6765
</g>
66+
</g>
67+
<g>
6868
<g>
69-
<g>
70-
<path
71-
d="M-76.8-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1
69+
<path
70+
d="M-76.8-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1
7271
c0,0,0,0,0,0C-77.3-435.1-76.8-434.6-76.8-434C-76.8-434-76.8-434-76.8-434z"
73-
/>
74-
</g>
72+
/>
7573
</g>
74+
</g>
75+
<g>
7676
<g>
77-
<g>
78-
<path
79-
d="M-69-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1
77+
<path
78+
d="M-69-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1
8079
c0,0,0,0,0,0C-69.5-435.1-69-434.6-69-434C-69-434-69-434-69-434z"
81-
/>
82-
</g>
80+
/>
8381
</g>
82+
</g>
83+
<g>
8484
<g>
85-
<g>
86-
<path
87-
d="M-75.4-431.6c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5
85+
<path
86+
d="M-75.4-431.6c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5
8887
C-76.6-431.7-75.9-431.9-75.4-431.6C-75.4-431.6-75.4-431.6-75.4-431.6z"
89-
/>
90-
</g>
88+
/>
9189
</g>
90+
</g>
91+
<g>
9292
<g>
93-
<g>
94-
<path
95-
d="M-71.5-438.3c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5
93+
<path
94+
d="M-71.5-438.3c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5
9695
C-72.7-438.5-72-438.6-71.5-438.3C-71.5-438.3-71.5-438.3-71.5-438.3z"
97-
/>
98-
</g>
96+
/>
9997
</g>
98+
</g>
99+
<g>
100100
<g>
101-
<g>
102-
<path
103-
d="M-72.6-431.6c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4
101+
<path
102+
d="M-72.6-431.6c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4
104103
c0,0,0,0,0,0C-73.3-430.6-73.1-431.3-72.6-431.6z"
105-
/>
106-
</g>
104+
/>
107105
</g>
106+
</g>
107+
<g>
108108
<g>
109-
<g>
110-
<path
111-
d="M-76.5-438.3c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4
109+
<path
110+
d="M-76.5-438.3c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4
112111
c0,0,0,0,0,0C-77.2-437.3-77-438-76.5-438.3z"
113-
/>
114-
</g>
112+
/>
115113
</g>
116114
</g>
117-
</svg>
118-
</SvgIcon>
119-
);
120-
}
121-
}
115+
</g>
116+
</svg>
117+
</SvgIcon>
118+
);
119+
};
122120

123121
export default ClustersIcon;

portal-ui/src/icons/ConfigurationsListIcon.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,26 @@
1616

1717
import React from "react";
1818
import { SvgIcon } from "@material-ui/core";
19-
class ConfigurationsListIcon extends React.Component {
20-
render() {
21-
return (
22-
<SvgIcon>
23-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
24-
<rect width="1.433" height="1" />
25-
<rect width="7.828" height="1" transform="translate(2.172)" />
26-
<rect width="1.433" height="1" transform="translate(0 6)" />
27-
<rect width="1.433" height="1" transform="translate(0 3)" />
28-
<rect width="1.433" height="1" transform="translate(0 9)" />
29-
<rect width="1.368" height="0.569" transform="translate(6.316 9)" />
30-
<path d="M5.566,9.569v-.31l-.238-.138-.269.155-.65.375L4.034,9V9H2.172v1H5.566Z" />
31-
<path d="M9.966,9l-.375.65-.65-.375-.269-.155-.238.138V10H10V9H9.967Z" />
32-
<path d="M3.625,6.793l.269-.155V6.362l-.269-.155L3.266,6H2.172V7H3.266Z" />
33-
<path d="M8.434,3.431v.31l.238.138.269-.155.649-.375L9.966,4V4H10V3H8.434Z" />
34-
<path d="M4.034,4l.375-.65.65.375.269.155.238-.138V3H2.172V4H4.033Z" />
35-
<path d="M9.356,5.929,10,5.558,9.316,4.373l-.644.372-.988-.571V3.431H6.316v.743l-.988.571-.644-.372L4,5.558l.644.371V7.071L4,7.442l.684,1.185.644-.372.988.571v.743H7.684V8.826l.988-.571.644.372L10,7.442l-.644-.371ZM7,7.278A.778.778,0,1,1,7.778,6.5.779.779,0,0,1,7,7.278Z" />
36-
</svg>
37-
</SvgIcon>
38-
);
39-
}
40-
}
19+
20+
const ConfigurationsListIcon = () => {
21+
return (
22+
<SvgIcon>
23+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
24+
<rect width="1.433" height="1" />
25+
<rect width="7.828" height="1" transform="translate(2.172)" />
26+
<rect width="1.433" height="1" transform="translate(0 6)" />
27+
<rect width="1.433" height="1" transform="translate(0 3)" />
28+
<rect width="1.433" height="1" transform="translate(0 9)" />
29+
<rect width="1.368" height="0.569" transform="translate(6.316 9)" />
30+
<path d="M5.566,9.569v-.31l-.238-.138-.269.155-.65.375L4.034,9V9H2.172v1H5.566Z" />
31+
<path d="M9.966,9l-.375.65-.65-.375-.269-.155-.238.138V10H10V9H9.967Z" />
32+
<path d="M3.625,6.793l.269-.155V6.362l-.269-.155L3.266,6H2.172V7H3.266Z" />
33+
<path d="M8.434,3.431v.31l.238.138.269-.155.649-.375L9.966,4V4H10V3H8.434Z" />
34+
<path d="M4.034,4l.375-.65.65.375.269.155.238-.138V3H2.172V4H4.033Z" />
35+
<path d="M9.356,5.929,10,5.558,9.316,4.373l-.644.372-.988-.571V3.431H6.316v.743l-.988.571-.644-.372L4,5.558l.644.371V7.071L4,7.442l.684,1.185.644-.372.988.571v.743H7.684V8.826l.988-.571.644.372L10,7.442l-.644-.371ZM7,7.278A.778.778,0,1,1,7.778,6.5.779.779,0,0,1,7,7.278Z" />
36+
</svg>
37+
</SvgIcon>
38+
);
39+
};
4140

4241
export default ConfigurationsListIcon;

0 commit comments

Comments
 (0)