Skip to content

Commit 6c90f42

Browse files
authored
feat: add font icon (#342)
* feat: add font icon * docs: update notes * chore: cleanup the uncessary change
1 parent 72e5224 commit 6c90f42

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Information about release notes of Coco Server is provided here.
1414
### Features
1515

1616
- Linux support for application search #330
17-
1817
- Add shortcuts to most icon buttons #334
18+
- Add font icon for search list #342
1919

2020
### Bug fix
2121

public/assets/fonts/icons/iconfont.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Common/Icons/ItemIcon.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import IconWrapper from "./IconWrapper";
55
import ThemedIcon from "./ThemedIcon";
66
import { useFindConnectorIcon } from "@/hooks/useFindConnectorIcon";
77
import { useAppStore } from "@/stores/appStore";
8+
import FontIcon from "./FontIcon";
89

910
interface ItemIconProps {
1011
item: any;
@@ -23,6 +24,12 @@ const ItemIcon = React.memo(function ItemIcon({
2324
// console.log("connectorSource", connectorSource);
2425
const icons = connectorSource?.assets?.icons || {};
2526

27+
if (item?.icon?.startsWith("font_")) {
28+
return (
29+
<FontIcon name={item?.icon} className={className} />
30+
);
31+
}
32+
2633
// If the icon is a valid base64-encoded image
2734
const isBase64 = item?.icon?.startsWith("data:image/");
2835
if (isBase64) {

0 commit comments

Comments
 (0)