Skip to content

Commit

Permalink
feat(ui): Replace new icons with custom new icons + remove new icon d…
Browse files Browse the repository at this point in the history
…ependency
  • Loading branch information
Hypfer committed Dec 24, 2023
1 parent 4e958da commit 5621418
Show file tree
Hide file tree
Showing 23 changed files with 316 additions and 39 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions assets/icons/remixed/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Icons in here have been adapted by combining multiple material design icons into a new one.

Material Design Icons are licensed under Apache-2.0
https://github.com/google/material-design-icons/blob/master/LICENSE
36 changes: 36 additions & 0 deletions assets/icons/remixed/add_cutting_line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions assets/icons/remixed/add_no_go_area.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions assets/icons/remixed/add_no_mop_area.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions assets/icons/remixed/add_virtual_wall.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions assets/icons/util/add-icon-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@emotion/react": "11.11.1",
"@tanstack/react-query": "5.8.7",
"@tanstack/react-query-devtools": "5.8.7",
"@mui-extra/icons": "0.0.65",
"axios": "1.6.2",
"date-fns": "2.30.0",
"notistack": "3.0.1",
Expand Down
39 changes: 37 additions & 2 deletions frontend/src/components/CustomIcons.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

// Taken from https://github.com/Templarian/MaterialDesign/blob/master/svg/fan.svg
import {createSvgIcon} from "@mui/material";
import React from "react";

// Taken from https://github.com/Templarian/MaterialDesign/blob/master/svg/fan.svg
export const FanSpeedIcon = createSvgIcon(
<path d="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z" />,
"fanSpeed"
Expand Down Expand Up @@ -33,3 +32,39 @@ export const RobotMonochromeIcon = createSvgIcon(
<path d="m11.276 23.995c-0.0466-0.0052-0.22091-0.02108-0.38734-0.03518-0.83761-0.07102-1.8157-0.2757-2.6638-0.55746-0.99337-0.33-2.0568-0.85274-2.9284-1.4395-1.0958-0.73769-2.133-1.7267-2.9179-2.7823-2.9783-4.0056-3.1762-9.413-0.49864-13.627 0.35679-0.56156 0.87047-1.2299 1.2841-1.6706 0.089202-0.09505 0.20504-0.22008 0.25743-0.27784 0.052382-0.05776 0.2424-0.23938 0.42225-0.40359 1.3391-1.2226 2.7611-2.0579 4.4435-2.6102 1.9327-0.63444 4.0413-0.76202 6.0392-0.36539 2.0143 0.3999 3.8194 1.2658 5.4239 2.6019 0.36962 0.30779 1.0918 1.0271 1.4083 1.4028 0.63425 0.75277 1.1109 1.473 1.5542 2.3483 0.67626 1.3353 1.0646 2.6464 1.2416 4.1921 0.06671 0.58251 0.0594 1.9845-0.01355 2.5846-0.36085 2.9717-1.7049 5.5833-3.8955 7.5692-1.4391 1.3046-3.2226 2.2537-5.1295 2.7296-0.99296 0.2478-1.6763 0.33244-2.7683 0.34288-0.43274 0.0042-0.82492 0.0033-0.87152-2e-3zm1.8036-2.5389c1.8044-0.21732 3.4498-0.90148 4.866-2.0232 0.40107-0.31769 1.1639-1.0808 1.4876-1.4881 1.3561-1.7066 2.0832-3.7948 2.0832-5.9832v-0.39593h-6.1032l-0.02699 0.07868c-0.01484 0.04328-0.08526 0.19307-0.15648 0.33287-0.45518 0.89359-1.2836 1.5814-2.2295 1.8512-0.66429 0.18945-1.3948 0.19028-2.0434 0.0023-1.0497-0.30419-1.9323-1.0917-2.3553-2.1017l-0.068451-0.16341h-6.0159l-0.017211 0.17137c-0.020569 0.20481 0.00257 0.77456 0.050785 1.2499 0.13047 1.2866 0.54474 2.5818 1.1908 3.7231 0.060303 0.10651 0.22142 0.36253 0.35805 0.56891 1.5419 2.3291 4.0632 3.8657 6.8494 4.1743 0.51174 0.05666 0.53503 0.05764 1.1983 0.04883 0.35506-0.0047 0.75103-0.02429 0.93204-0.04609zm-0.73157-8.9338c0.71565-0.1248 1.3101-0.56708 1.6271-1.2106 0.17846-0.36228 0.21736-0.53994 0.21736-0.99264 0-0.32911-0.0082-0.41569-0.05429-0.5759-0.1882-0.65366-0.62305-1.1666-1.2305-1.4516-1.095-0.51369-2.4068-0.04253-2.9383 1.0554-0.137 0.28296-0.18935 0.46815-0.21565 0.76289-0.037379 0.41886 0.027773 0.78742 0.20603 1.1655 0.32423 0.68766 0.94668 1.1441 1.7278 1.267 0.14627 0.02302 0.4702 0.01324 0.66045-0.01995zm-3.8558-3.3108c0.07934-0.27474 0.35375-0.80932 0.54858-1.0687 0.56521-0.75242 1.3949-1.2637 2.3042-1.42 0.33569-0.0577 0.88574-0.06298 1.2027-0.01153 0.79729 0.12931 1.4938 0.49626 2.0623 1.0865 0.38396 0.39864 0.68007 0.89011 0.8445 1.4017l0.06809 0.21183h5.6316l-0.01606-0.06657c-0.0089-0.03661-0.06992-0.22338-0.13573-0.41503-0.38829-1.1306-0.95495-2.1324-1.7336-3.0651-0.28272-0.33863-0.92631-0.9668-1.2869-1.2561-0.87974-0.70577-1.8343-1.2312-2.9045-1.5989-1.0022-0.34431-1.9727-0.50441-3.063-0.50533-0.95648-8.08e-4 -1.7867 0.11516-2.6669 0.37253-2.6501 0.77486-4.8616 2.6858-5.9872 5.1734-0.15714 0.3473-0.35036 0.85231-0.44433 1.1613l-0.060735 0.19972h5.5793z" strokeWidth=".024209"/>,
"robot"
);

// "form-textbox" material design icon
export const RenameIcon = createSvgIcon(
<path d="M17,7H22V17H17V19A1,1 0 0,0 18,20H20V22H17.5C16.95,22 16,21.55 16,21C16,21.55 15.05,22 14.5,22H12V20H14A1,1 0 0,0 15,19V5A1,1 0 0,0 14,4H12V2H14.5C15.05,2 16,2.45 16,3C16,2.45 16.95,2 17.5,2H20V4H18A1,1 0 0,0 17,5V7M2,7H13V9H4V15H13V17H2V7M20,15V9H17V15H20Z" />,
"rename"
);

// "strategy" material design icon
export const VirtualRestrictionsIcon = createSvgIcon(
<path d="M6.91 5.5L9.21 7.79L7.79 9.21L5.5 6.91L3.21 9.21L1.79 7.79L4.09 5.5L1.79 3.21L3.21 1.79L5.5 4.09L7.79 1.79L9.21 3.21M22.21 16.21L20.79 14.79L18.5 17.09L16.21 14.79L14.79 16.21L17.09 18.5L14.79 20.79L16.21 22.21L18.5 19.91L20.79 22.21L22.21 20.79L19.91 18.5M20.4 6.83L17.18 11L15.6 9.73L16.77 8.23A9.08 9.08 0 0 0 10.11 13.85A4.5 4.5 0 1 1 7.5 13A4 4 0 0 1 8.28 13.08A11.27 11.27 0 0 1 16.43 6.26L15 5.18L16.27 3.6M10 17.5A2.5 2.5 0 1 0 7.5 20A2.5 2.5 0 0 0 10 17.5Z" />,
"virtualRestrictions"
);

// Remixed from the "wall" material design icon
export const AddVirtualWallIcon = createSvgIcon(
<path d="M 3 4 L 3 9 L 11 9 L 11 4 L 3 4 z M 12 4 L 12 9 L 21 9 L 21 4 L 12 4 z M 2 10 L 2 15 L 8 15 L 8 10 L 2 10 z M 9 10 L 9 15 L 14.535156 15 A 6 6 0 0 1 15 14.535156 L 15 10 L 9 10 z M 16 10 L 16 13.820312 A 6 6 0 0 1 19 13 A 6 6 0 0 1 22 13.806641 L 22 10 L 16 10 z M 18 15 L 18 18 L 15 18 L 15 20 L 18 20 L 18 23 L 20 23 L 20 20 L 23 20 L 23 18 L 20 18 L 20 15 L 18 15 z M 3 16 L 3 21 L 12 21 L 12 16 L 3 16 z M 13 16 L 13 19 A 6 6 0 0 1 13.820312 16 L 13 16 z M 13 19 L 13 21 L 13.359375 21 A 6 6 0 0 1 13 19 z " />,
"addVirtualWall"
);

// Remixed from the "water-off" material design icon
export const AddNoMopAreaIcon = createSvgIcon(
<path d="M 2.390625 1.7304688 L 1.109375 3 L 7.5507812 9.4394531 C 6.670783 11.02945 6 12.670002 6 14 C 6 17.309994 8.6900066 20 12 20 C 12.366247 20 12.723417 19.965245 13.070312 19.902344 A 6 6 0 0 1 13 19 A 6 6 0 0 1 15.097656 14.445312 L 2.390625 1.7304688 z M 12 3.25 C 12 3.25 10.840779 4.549613 9.5507812 6.3496094 L 16.677734 13.478516 A 6 6 0 0 1 17.912109 13.111328 C 17.178313 9.0769678 12 3.25 12 3.25 z M 18 15 L 18 18 L 15 18 L 15 20 L 18 20 L 18 23 L 20 23 L 20 20 L 23 20 L 23 18 L 20 18 L 20 15 L 18 15 z " />,
"addNoMopArea"
);

// Remixed from the "minus-circle" material design icon
export const AddNoGoAreaIcon = createSvgIcon(
<path d="M 12 2 C 6.4771635 2 2 6.4771635 2 12 C 2 17.522835 6.4771635 22 12 22 C 12.592362 22 13.17226 21.946433 13.736328 21.847656 A 6 6 0 0 1 13 19 A 6 6 0 0 1 16.623047 13.5 L 3.3457031 13.5 L 3.3457031 10.5 L 20.650391 10.503906 L 20.650391 13.232422 A 6 6 0 0 1 21.849609 13.720703 C 21.946622 13.161509 22 12.586934 22 12 C 22 6.4771635 17.522835 2 12 2 z M 18 15 L 18 18 L 15 18 L 15 20 L 18 20 L 18 23 L 20 23 L 20 20 L 23 20 L 23 18 L 20 18 L 20 15 L 18 15 z " />,
"adNoGoArea"
);

// Remixed from the "content-cut" material design icon
export const AddCuttingLineIcon = createSvgIcon(
<path d="M 6 2 A 4 4 0 0 0 2 6 A 4 4 0 0 0 6 10 C 6.5899988 10 7.140626 9.8706246 7.640625 9.640625 L 10 12 L 7.640625 14.359375 C 7.140626 14.129375 6.5899988 14 6 14 A 4 4 0 0 0 2 18 A 4 4 0 0 0 6 22 A 4 4 0 0 0 10 18 C 10 17.410002 9.8706246 16.859375 9.640625 16.359375 L 12 14 L 13.882812 15.882812 A 6 6 0 0 1 15.882812 13.882812 L 9.640625 7.640625 C 9.8706246 7.140626 10 6.5899988 10 6 A 4 4 0 0 0 6 2 z M 19 3 L 13 9 L 15 11 L 22 4 L 22 3 L 19 3 z M 6 4 A 2 2 0 0 1 8 6 C 8 7.1099978 7.0999978 8 6 8 A 2 2 0 0 1 4 6 C 4 4.8900022 4.9000022 4 6 4 z M 12 11.5 A 0.5 0.5 0 0 1 12.5 12 A 0.5 0.5 0 0 1 12 12.5 A 0.5 0.5 0 0 1 11.5 12 A 0.5 0.5 0 0 1 12 11.5 z M 18 15 L 18 18 L 15 18 L 15 20 L 18 20 L 18 23 L 20 23 L 20 20 L 23 20 L 23 18 L 20 18 L 20 15 L 18 15 z M 6 16 A 2 2 0 0 1 8 18 C 8 19.109998 7.0999978 20 6 20 A 2 2 0 0 1 4 18 C 4 16.890002 4.9000022 16 6 16 z "/>,
"addCuttingLine"
);
7 changes: 7 additions & 0 deletions frontend/src/map/EditMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,13 @@ class EditMap extends Map<EditMapProps, EditMapState> {
this.updateVirtualRestrictionClientStructures(true);
this.updateVirtualRestrictionClientStructures(false);

this.updateState();
this.draw();
}}
onClear={() => {
this.updateVirtualRestrictionClientStructures(true);

this.updateState();
this.draw();
}}
onSave={() => {
Expand Down
Loading

0 comments on commit 5621418

Please sign in to comment.