Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ed1a759

Browse files
committed
Removed manually created SVG JSX. Inlined some SVGs as data URIs.
1 parent d3a1243 commit ed1a759

File tree

11 files changed

+51
-226
lines changed

11 files changed

+51
-226
lines changed

babel.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = function (api) {
4646
// "module-resolver",
4747
// {
4848
// alias: {
49+
// assets: "./src/assets",
4950
// styles: "./src/styles",
5051
// components: "./src/components",
5152
// hooks: "./src/hooks",

package-lock.json

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"single-spa-react": "^2.14.0",
9595
"style-loader": "^2.0.0",
9696
"systemjs-webpack-interop": "^2.1.2",
97+
"url-loader": "^4.1.1",
9798
"webpack": "^4.41.2",
9899
"webpack-cli": "^3.3.10",
99100
"webpack-config-single-spa-react": "^1.0.3",

src/components/Icons/ArrowDown/index.jsx

+5-26
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,24 @@ import React from "react";
22
import PT from "prop-types";
33
import cn from "classnames";
44
import IconWrapper from "components/IconWrapper";
5+
import IconArrowDown from "../../../assets/images/icon-arrow-down.svg";
56
import styles from "./styles.module.scss";
67

78
/**
9+
* Displays a wide dark green arrow pointing down.
810
*
911
* @param {Object} props component props
1012
* @param {string} [props.className] class name added to root element
1113
* @returns {JSX.Element}
1214
*/
1315
const ArrowDown = ({ className }) => (
14-
<IconWrapper className={cn(styles.arrow, className)}>{jsx}</IconWrapper>
16+
<IconWrapper className={cn(styles.arrow, className)}>
17+
<IconArrowDown />
18+
</IconWrapper>
1519
);
1620

1721
ArrowDown.propTypes = {
1822
className: PT.string,
1923
};
2024

2125
export default ArrowDown;
22-
23-
// This JSX will never change so it's alright to create it only once.
24-
const jsx = (
25-
<svg
26-
version="1.1"
27-
xmlns="http://www.w3.org/2000/svg"
28-
xmlnsXlink="http://www.w3.org/1999/xlink"
29-
x="0px"
30-
y="0px"
31-
viewBox="0 0 15 9"
32-
enableBackground="new 0 0 15 9"
33-
xmlSpace="preserve"
34-
>
35-
<path
36-
fillRule="evenodd"
37-
clipRule="evenodd"
38-
fill="#137D60"
39-
d="M6.7914,8.2883L0.7067,2.1772
40-
C0.312,1.7808,0.3011,1.1434,0.6818,0.7337C1.044,0.3439,1.6537,0.3216,2.0434,0.6838c0.0091,0.0085,0.0181,0.0171,0.0269,0.026
41-
L7.5,6.163l0,0l5.4297-5.4533c0.3754-0.3771,0.9855-0.3784,1.3625-0.003c0.0088,0.0088,0.0175,0.0178,0.026,0.0269
42-
c0.3808,0.4097,0.3698,1.0471-0.0249,1.4435L8.2086,8.2883C7.819,8.6797,7.1858,8.681,6.7944,8.2913
43-
C6.7934,8.2903,6.7924,8.2893,6.7914,8.2883z"
44-
/>
45-
</svg>
46-
);

src/components/Icons/ArrowLeft/index.jsx

+5-23
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,24 @@ import React from "react";
22
import PT from "prop-types";
33
import cn from "classnames";
44
import IconWrapper from "components/IconWrapper";
5+
import IconArrowLeft from "../../../assets/images/icon-arrow-left.svg";
56
import styles from "./styles.module.scss";
67

78
/**
9+
* Displays a green arrow pointing to the left.
810
*
911
* @param {Object} props component props
1012
* @param {string} [props.className] class name added to root element
1113
* @returns {JSX.Element}
1214
*/
1315
const ArrowLeft = ({ className }) => (
14-
<IconWrapper className={cn(styles.arrow, className)}>{jsx}</IconWrapper>
16+
<IconWrapper className={cn(styles.arrow, className)}>
17+
<IconArrowLeft />
18+
</IconWrapper>
1519
);
1620

1721
ArrowLeft.propTypes = {
1822
className: PT.string,
1923
};
2024

2125
export default ArrowLeft;
22-
23-
// This JSX will never change so it's alright to create it only once.
24-
const jsx = (
25-
<svg
26-
version="1.1"
27-
xmlns="http://www.w3.org/2000/svg"
28-
xmlnsXlink="http://www.w3.org/1999/xlink"
29-
x="0px"
30-
y="0px"
31-
viewBox="0 0 8 12"
32-
enableBackground="new 0 0 8 12"
33-
xmlSpace="preserve"
34-
>
35-
<polygon
36-
fillRule="evenodd"
37-
clipRule="evenodd"
38-
fill="#137D60"
39-
points="6.325,11.775 7.45,10.725 2.725,6
40-
7.45,1.275 6.325,0.225 0.55,6 "
41-
/>
42-
</svg>
43-
);

src/components/Icons/ArrowRight/index.jsx

+5-23
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,24 @@ import React from "react";
22
import PT from "prop-types";
33
import cn from "classnames";
44
import IconWrapper from "components/IconWrapper";
5+
import IconArrowRight from "../../../assets/images/icon-arrow-right.svg";
56
import styles from "./styles.module.scss";
67

78
/**
9+
* Displays a green arrow pointing to the right.
810
*
911
* @param {Object} props component props
1012
* @param {string} [props.className] class name added to root element
1113
* @returns {JSX.Element}
1214
*/
1315
const ArrowRight = ({ className }) => (
14-
<IconWrapper className={cn(styles.arrow, className)}>{jsx}</IconWrapper>
16+
<IconWrapper className={cn(styles.arrow, className)}>
17+
<IconArrowRight />
18+
</IconWrapper>
1519
);
1620

1721
ArrowRight.propTypes = {
1822
className: PT.string,
1923
};
2024

2125
export default ArrowRight;
22-
23-
// This JSX will never change so it's alright to create it only once.
24-
const jsx = (
25-
<svg
26-
version="1.1"
27-
xmlns="http://www.w3.org/2000/svg"
28-
xmlnsXlink="http://www.w3.org/1999/xlink"
29-
x="0px"
30-
y="0px"
31-
viewBox="0 0 8 12"
32-
enableBackground="new 0 0 8 12"
33-
xmlSpace="preserve"
34-
>
35-
<polygon
36-
fillRule="evenodd"
37-
clipRule="evenodd"
38-
fill="#137D60"
39-
points="1.675,11.775 0.55,10.725 5.275,6
40-
0.55,1.275 1.675,0.225 7.45,6 "
41-
/>
42-
</svg>
43-
);

src/components/Icons/ArrowSmall/index.jsx

+3-23
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import React from "react";
22
import PT from "prop-types";
33
import cn from "classnames";
44
import IconWrapper from "components/IconWrapper";
5+
import IconArrowDownSmall from "../../../assets/images/icon-arrow-down-small.svg";
56
import styles from "./styles.module.scss";
67

78
/**
8-
* Displays small down-arrow.
9+
* Displays a small narrow arrow pointing down or up.
910
*
1011
* @param {Object} props component props
1112
* @param {string} [props.className] class name added to root element
@@ -21,7 +22,7 @@ const ArrowSmall = ({ className, onClick, isActive, direction = "down" }) => (
2122
[styles.isActive]: isActive,
2223
})}
2324
>
24-
{jsx}
25+
<IconArrowDownSmall />
2526
</IconWrapper>
2627
);
2728

@@ -33,24 +34,3 @@ ArrowSmall.propTypes = {
3334
};
3435

3536
export default ArrowSmall;
36-
37-
const jsx = (
38-
<svg
39-
version="1.1"
40-
xmlns="http://www.w3.org/2000/svg"
41-
xmlnsXlink="http://www.w3.org/1999/xlink"
42-
x="0px"
43-
y="0px"
44-
viewBox="0 0 11 7"
45-
enableBackground="new 0 0 11 7"
46-
xmlSpace="preserve"
47-
>
48-
<polygon
49-
fillRule="evenodd"
50-
clipRule="evenodd"
51-
fill="#FFFFFF"
52-
points="5.5,6.9 0.1,1.5 1.5,0.1 5.5,4.1 9.5,0.1
53-
10.9,1.5 "
54-
/>
55-
</svg>
56-
);

src/components/Icons/ArrowSmall/styles.module.scss

+3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
svg {
55
display: block;
66
width: 100%;
7+
height: auto;
78

9+
path,
810
polygon {
911
fill: #aaa;
1012
}
1113
}
1214

1315
&.isActive {
1416
svg {
17+
path,
1518
polygon {
1619
fill: #000;
1720
}

src/components/Icons/Freelancers/index.jsx

+3-53
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import React from "react";
22
import PT from "prop-types";
33
import cn from "classnames";
44
import IconWrapper from "components/IconWrapper";
5+
import IconFreelancers from "../../../assets/images/icon-menu-item-feelancers.svg";
56
import styles from "./styles.module.scss";
67

78
/**
9+
* Displays a "people" icon used in navigation menu.
810
*
911
* @param {Object} props component props
1012
* @param {string} [props.className] class name added to root element
@@ -15,7 +17,7 @@ const Freelancers = ({ className, isActive = false }) => (
1517
<IconWrapper
1618
className={cn(styles.container, className, { [styles.isActive]: isActive })}
1719
>
18-
{jsx}
20+
<IconFreelancers />
1921
</IconWrapper>
2022
);
2123

@@ -25,55 +27,3 @@ Freelancers.propTypes = {
2527
};
2628

2729
export default Freelancers;
28-
29-
// This JSX will never change so it's alright to create it only once.
30-
const jsx = (
31-
<svg
32-
version="1.1"
33-
xmlns="http://www.w3.org/2000/svg"
34-
xmlnsXlink="http://www.w3.org/1999/xlink"
35-
x="0px"
36-
y="0px"
37-
viewBox="0 0 24 24"
38-
enableBackground="new 0 0 24 24"
39-
xmlSpace="preserve"
40-
>
41-
<path
42-
fill="#555555"
43-
d="M4.5,9c-1.6569,0-3-1.3431-3-3s1.3431-3,3-3s3,1.3431,3,3c0,0.7956-0.3161,1.5587-0.8787,2.1213
44-
C6.0587,8.6839,5.2956,9,4.5,9z M4.5,4.5C3.6716,4.5,3,5.1716,3,6s0.6716,1.5,1.5,1.5S6,6.8284,6,6S5.3284,4.5,4.5,4.5z"
45-
/>
46-
<path
47-
fill="#555555"
48-
d="M3,22.5c-0.378-0.0006-0.6967-0.282-0.744-0.657L1.588,16.5H0.75C0.3358,16.5,0,16.1642,0,15.75
49-
V13.5C0.0028,11.0159,2.0159,9.0028,4.5,9c0.4142,0,0.75,0.3358,0.75,0.75S4.9142,10.5,4.5,10.5c-1.6569,0-3,1.3431-3,3V15h0.75
50-
c0.378,0.0006,0.6967,0.282,0.744,0.657L3.662,21H6c0.4142,0,0.75,0.3358,0.75,0.75S6.4142,22.5,6,22.5H3z"
51-
/>
52-
<path
53-
fill="#555555"
54-
d="M19.5,9c-1.6569,0-3-1.3431-3-3s1.3431-3,3-3s3,1.3431,3,3
55-
c0,0.7956-0.3161,1.5587-0.8787,2.1213C21.0587,8.6839,20.2956,9,19.5,9z M19.5,4.5C18.6716,4.5,18,5.1716,18,6s0.6716,1.5,1.5,1.5
56-
S21,6.8284,21,6S20.3284,4.5,19.5,4.5z"
57-
/>
58-
<path
59-
fill="#555555"
60-
d="M18,22.5c-0.4142,0-0.75-0.3358-0.75-0.75S17.5858,21,18,21h2.338l0.668-5.343
61-
c0.0473-0.375,0.366-0.6564,0.744-0.657h0.75v-1.5c0-1.6569-1.3431-3-3-3c-0.4142,0-0.75-0.3358-0.75-0.75S19.0858,9,19.5,9
62-
c2.4841,0.0028,4.4972,2.0159,4.5,4.5v2.25c0,0.4142-0.3358,0.75-0.75,0.75h-0.838l-0.668,5.343
63-
C21.6967,22.218,21.378,22.4994,21,22.5H18z"
64-
/>
65-
<path
66-
fill="#555555"
67-
d="M12,7.5c-2.0711,0-3.75-1.6789-3.75-3.75S9.9289,0,12,0s3.75,1.6789,3.75,3.75
68-
C15.7478,5.8202,14.0702,7.4978,12,7.5L12,7.5z M12,1.5c-1.2426,0-2.25,1.0074-2.25,2.25S10.7574,6,12,6s2.25-1.0074,2.25-2.25
69-
C14.2489,2.5078,13.2422,1.5011,12,1.5L12,1.5z"
70-
/>
71-
<path
72-
fill="#555555"
73-
d="M9.75,24C9.3629,24.0034,9.0373,23.7104,9,23.325L8.321,16.5H6.75
74-
C6.3358,16.5,6,16.1642,6,15.75V13.5c0-3.3137,2.6863-6,6-6s6,2.6863,6,6v2.25c0,0.4142-0.3358,0.75-0.75,0.75h-1.571L15,23.325
75-
c-0.0373,0.3854-0.3629,0.6784-0.75,0.675H9.75z M13.571,22.5l0.683-6.825C14.2912,15.2912,14.6144,14.9987,15,15h1.5v-1.5
76-
c0-2.4853-2.0147-4.5-4.5-4.5s-4.5,2.0147-4.5,4.5V15H9c0.3856-0.0013,0.7088,0.2912,0.746,0.675l0.682,6.825H13.571z"
77-
/>
78-
</svg>
79-
);

0 commit comments

Comments
 (0)