Skip to content

Commit 2352349

Browse files
fix: refactor icons to use Sistent constants and remove redundant svg paths
Signed-off-by: ashwanisingh011 <ashwanisingh9737@gmail.com>
1 parent ec48710 commit 2352349

File tree

7 files changed

+40
-60
lines changed

7 files changed

+40
-60
lines changed

src/icons/BuildRounded/BuildRoundedIcon.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_FILL_NONE, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
22
import { IconProps } from '../types';
33

44
export const BuildRoundedIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL_NONE,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="build-rounded-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0V0z" fill="none" />
23-
<path d="m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z" />
20+
<path d="m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z" fill={fill}/>
2421
</svg>
2522
);
2623
};
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL_NONE } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const DirectionsCarIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL_NONE,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="directions-car-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" />
20+
<path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z" fill={fill} />
2421
</svg>
2522
);
2623
};
2724

28-
export default BuildRoundedIcon;
25+
export default DirectionsCarIcon;

src/icons/Explore/ExploreIcon.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL_NONE } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const ExploreIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL_NONE,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="explore-icon-svg"
2018
{...props}
2119
>
2220
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1c.61 0 1.1-.49 1.1-1.1s-.49-1.1-1.1-1.1zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm2.19 12.19L6 18l3.81-8.19L18 6l-3.81 8.19z" />
21+
<path d="M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1c.61 0 1.1-.49 1.1-1.1s-.49-1.1-1.1-1.1zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm2.19 12.19L6 18l3.81-8.19L18 6l-3.81 8.19z" fill={fill} />
2422
</svg>
2523
);
2624
};
2725

28-
export default BuildRoundedIcon;
26+
export default ExploreIcon;
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const FileCopyIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="file-copy-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z" />
20+
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z" fill={fill} />
2421
</svg>
2522
);
2623
};
2724

28-
export default BuildRoundedIcon;
25+
export default FileCopyIcon;

src/icons/ListAlt/ListAltIcon.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const ListAltIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="list-alt-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M19 5v14H5V5h14m1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM11 7h6v2h-6V7zm0 4h6v2h-6v-2zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z" />
20+
<path d="M19 5v14H5V5h14m1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM11 7h6v2h-6V7zm0 4h6v2h-6v-2zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z" fill={fill} />
2421
</svg>
2522
);
2623
};
2724

28-
export default BuildRoundedIcon;
25+
export default ListAltIcon;

src/icons/SimCard/SimCardIcon.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const SimCardIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="sim-card-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M19.99 4c0-1.1-.89-2-1.99-2h-8L4 8v12c0 1.1.9 2 2 2h12.01c1.1 0 1.99-.9 1.99-2l-.01-16zM9 19H7v-2h2v2zm8 0h-2v-2h2v2zm-8-4H7v-4h2v4zm4 4h-2v-4h2v4zm0-6h-2v-2h2v2zm4 2h-2v-4h2v4z" />
20+
<path d="M19.99 4c0-1.1-.89-2-1.99-2h-8L4 8v12c0 1.1.9 2 2 2h12.01c1.1 0 1.99-.9 1.99-2l-.01-16zM9 19H7v-2h2v2zm8 0h-2v-2h2v2zm-8-4H7v-4h2v4zm4 4h-2v-4h2v4zm0-6h-2v-2h2v2zm4 2h-2v-4h2v4z" fill={fill}/>
2421
</svg>
2522
);
2623
};
2724

28-
export default BuildRoundedIcon;
25+
export default SimCardIcon;
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL } from '../../constants/constants';
22
import { IconProps } from '../types';
33

4-
export const BuildRoundedIcon = ({
4+
export const SupervisedUserCircleIcon = ({
55
width = DEFAULT_WIDTH,
66
height = DEFAULT_HEIGHT,
7-
fill = '#455a64',
8-
style,
7+
fill = DEFAULT_FILL,
98
...props
109
}: IconProps): JSX.Element => {
11-
const _finalFill = style?.fill || fill;
1210

1311
return (
1412
<svg
1513
xmlns="http://www.w3.org/2000/svg"
1614
viewBox="0 0 24 24"
1715
width={width}
1816
height={height}
19-
fill={_finalFill}
17+
data-testid="supervised-user-circle-icon-svg"
2018
{...props}
2119
>
22-
<path d="M0 0h24v24H0z" fill="none" />
23-
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8zm4.75 6c-.75 1.5-3.11 1.5-3.88 0-.49-.95.12-2.06 1.16-2.06h1.56c1.04 0 1.65 1.11 1.16 2.06zm1.25-3c-.83 0-1.5-.67-1.5-1.5S13.67 8 14.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" />
20+
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8zm4.75 6c-.75 1.5-3.11 1.5-3.88 0-.49-.95.12-2.06 1.16-2.06h1.56c1.04 0 1.65 1.11 1.16 2.06zm1.25-3c-.83 0-1.5-.67-1.5-1.5S13.67 8 14.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" fill={fill} />
2421
</svg>
2522
);
2623
};
2724

28-
export default BuildRoundedIcon;
25+
export default SupervisedUserCircleIcon;

0 commit comments

Comments
 (0)