fix: removed gradient from icon when component is tool mode (#7929)
removed gradient from tool mode components
This commit is contained in:
parent
8cabedae55
commit
4f36583601
2 changed files with 3 additions and 16 deletions
|
|
@ -1,10 +1,5 @@
|
||||||
import { useTypesStore } from "@/stores/typesStore";
|
import { useTypesStore } from "@/stores/typesStore";
|
||||||
import {
|
import { iconExists, nodeColors } from "@/utils/styleUtils";
|
||||||
BG_NOISE,
|
|
||||||
iconExists,
|
|
||||||
nodeColors,
|
|
||||||
toolModeGradient,
|
|
||||||
} from "@/utils/styleUtils";
|
|
||||||
import emojiRegex from "emoji-regex";
|
import emojiRegex from "emoji-regex";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
|
@ -18,13 +13,11 @@ export function NodeIcon({
|
||||||
dataType,
|
dataType,
|
||||||
showNode,
|
showNode,
|
||||||
isGroup,
|
isGroup,
|
||||||
hasToolMode,
|
|
||||||
}: {
|
}: {
|
||||||
icon?: string;
|
icon?: string;
|
||||||
dataType: string;
|
dataType: string;
|
||||||
showNode: boolean;
|
showNode: boolean;
|
||||||
isGroup?: boolean;
|
isGroup?: boolean;
|
||||||
hasToolMode: boolean;
|
|
||||||
}) {
|
}) {
|
||||||
const types = useTypesStore((state) => state.types);
|
const types = useTypesStore((state) => state.types);
|
||||||
const [name, setName] = useState(types[dataType]);
|
const [name, setName] = useState(types[dataType]);
|
||||||
|
|
@ -46,8 +39,6 @@ export function NodeIcon({
|
||||||
isLucideIcon ? "lucide-icon" : "integration-icon",
|
isLucideIcon ? "lucide-icon" : "integration-icon",
|
||||||
);
|
);
|
||||||
|
|
||||||
const bgToolMode = BG_NOISE + "," + toolModeGradient;
|
|
||||||
|
|
||||||
const renderIcon = () => {
|
const renderIcon = () => {
|
||||||
if (icon && isEmoji) {
|
if (icon && isEmoji) {
|
||||||
return <span className="text-lg">{icon}</span>;
|
return <span className="text-lg">{icon}</span>;
|
||||||
|
|
@ -57,13 +48,10 @@ export function NodeIcon({
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
hasToolMode ? "text-white" : "text-foreground",
|
"text-white",
|
||||||
!showNode && "flex min-h-8 min-w-8 items-center justify-center",
|
!showNode && "flex min-h-8 min-w-8 items-center justify-center",
|
||||||
"bg-lucide-icon",
|
"bg-lucide-icon",
|
||||||
)}
|
)}
|
||||||
style={{
|
|
||||||
backgroundImage: hasToolMode ? bgToolMode : "",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
strokeWidth={ICON_STROKE_WIDTH}
|
strokeWidth={ICON_STROKE_WIDTH}
|
||||||
|
|
|
||||||
|
|
@ -361,10 +361,9 @@ function GenericNode({
|
||||||
showNode={showNode}
|
showNode={showNode}
|
||||||
icon={data.node?.icon}
|
icon={data.node?.icon}
|
||||||
isGroup={!!data.node?.flow}
|
isGroup={!!data.node?.flow}
|
||||||
hasToolMode={hasToolMode ?? false}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}, [data.type, showNode, data.node?.icon, data.node?.flow, hasToolMode]);
|
}, [data.type, showNode, data.node?.icon, data.node?.flow]);
|
||||||
|
|
||||||
const renderNodeName = useCallback(() => {
|
const renderNodeName = useCallback(() => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue