refactor: use Tailwind className for MiniMap node colors instead of CSS variables

This commit is contained in:
lyzno1 2025-09-29 08:09:38 +08:00
parent 973b937ba5
commit 6b677c16ce
1 changed files with 4 additions and 9 deletions

View File

@ -25,14 +25,10 @@ const Operator = ({ handleUndo, handleRedo }: OperatorProps) => {
return Math.max((workflowCanvasWidth - rightPanelWidth), 400)
}, [workflowCanvasWidth, rightPanelWidth])
const getMiniMapNodeColor = useCallback(() => {
return 'var(--color-workflow-minimap-block)'
}, [])
const getMiniMapNodeStrokeColor = useCallback((node: Node) => {
const getMiniMapNodeClassName = useCallback((node: Node) => {
return node.data?.selected
? 'var(--components-option-card-option-selected-border, #296DFF)'
: 'transparent'
? 'bg-workflow-minimap-block border-components-option-card-option-selected-border'
: 'bg-workflow-minimap-block'
}, [])
// update bottom panel height
@ -76,8 +72,7 @@ const Operator = ({ handleUndo, handleRedo }: OperatorProps) => {
height: 72,
}}
maskColor='var(--color-workflow-minimap-bg)'
nodeColor={getMiniMapNodeColor}
nodeStrokeColor={getMiniMapNodeStrokeColor}
nodeClassName={getMiniMapNodeClassName}
nodeStrokeWidth={3}
className='!absolute !bottom-10 z-[9] !m-0 !h-[73px] !w-[103px] !rounded-lg !border-[0.5px]
!border-divider-subtle !bg-background-default-subtle !shadow-md !shadow-shadow-shadow-5'