Skip to content

add image check icon #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-image-check-icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ingred-ui": minor
---

feat add image check icon
5 changes: 4 additions & 1 deletion src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import { SortAscIcon } from "./internal/SortAscIcon";
import { SortDescIcon } from "./internal/SortDescIcon";
import { BarChartSearchIcon } from "./internal/BarChartSearchIcon";
import { CheckThinIcon } from "./internal/CheckThinIcon";
import { ImageCheckIcon } from "./internal/ImageCheckIcon";

export type IconName =
| "dashboard"
Expand Down Expand Up @@ -181,7 +182,8 @@ export type IconName =
| "sort_asc"
| "sort_desc"
| "bar_chart_search"
| "check_thin";
| "check_thin"
| "image_check";

type IconType = "fill" | "line";
type IconColor = IconType | "active" | string;
Expand Down Expand Up @@ -289,6 +291,7 @@ export const icons: {
sort_desc: SortDescIcon,
bar_chart_search: BarChartSearchIcon,
check_thin: CheckThinIcon,
image_check: ImageCheckIcon,
};

const iconFactory = (name: IconName) => {
Expand Down
43 changes: 43 additions & 0 deletions src/components/Icon/internal/ImageCheckIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import * as React from "react";
import { IconProps } from "../../Icon";

const ImageCheckIcon: React.FunctionComponent<IconProps> = ({ type, fill }) => {
switch (type) {
case "fill":
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path
d="M23 17.0502L21.5826 15.636L18.039 19.1715L15.9128 17.0502L14.4954 18.4644L18.039 22L23 17.0502Z"
fill={fill}
/>
<path
d="M3 5H19V14H21V3.9934C21 3.44495 20.556 3 20.0082 3H1.9918C1.45531 3 1 3.44476 1 3.9934V20.0066C1 20.5551 1.44405 21 1.9918 21H13V14H17.9916L13.7065 9.70641C13.3159 9.31591 12.6828 9.31595 12.2923 9.70649L3 19V5Z"
fill={fill}
/>
<path
d="M5 9C5 10.1046 5.89543 11 7 11C8.10457 11 9 10.1046 9 9C9 7.89543 8.10457 7 7 7C5.89543 7 5 7.89543 5 9Z"
fill={fill}
/>
</svg>
);
case "line":
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
<path
d="M1 20.0066C1 20.5551 1.44507 21 1.99407 21H13.0192V19H5.83949L13.0275 11.8284L15.1989 13.9948H18.0337L13.0275 9L3.00458 19V5H19.0412V13.9948H21.0458V3.9934C21.0458 3.44495 20.6008 3 20.0518 3H1.99407C1.45635 3 1 3.44476 1 3.9934V20.0066Z"
fill={fill}
/>
<path
d="M5.00917 9C5.00917 10.1046 5.90665 11 7.01375 11C8.12085 11 9.01833 10.1046 9.01833 9C9.01833 7.89543 8.12085 7 7.01375 7C5.90665 7 5.00917 7.89543 5.00917 9Z"
fill={fill}
/>
<path
d="M23 17.0502L21.5826 15.636L18.039 19.1716L15.9128 17.0502L14.4953 18.4645L18.039 22L23 17.0502Z"
fill={fill}
/>
</svg>
);
}
};

export { ImageCheckIcon };