From 92a761f6404c918224a2fa84c184273de873c7b6 Mon Sep 17 00:00:00 2001 From: Rajveer Singh Anand Date: Wed, 16 Oct 2024 23:09:50 -0400 Subject: [PATCH] Attribute section removed from interface --- client/src/components/UMLInterfaceNode.tsx | 24 +--------------------- client/src/pages/Editor.tsx | 2 -- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/client/src/components/UMLInterfaceNode.tsx b/client/src/components/UMLInterfaceNode.tsx index 3d0f79b..78a1245 100644 --- a/client/src/components/UMLInterfaceNode.tsx +++ b/client/src/components/UMLInterfaceNode.tsx @@ -4,7 +4,6 @@ import { Handle, Position, NodeProps } from '@xyflow/react'; // Define types for the node data and props interface UMLNodeData { label?: string; - attributes?: string[]; methods?: string[]; color?: string; removeNode?: (id: string) => void; @@ -16,23 +15,17 @@ interface UMLNodeProps extends NodeProps {} const UMLInterfaceNode: React.FC = ({ data, id }) => { const [label, setLabel] = useState(data.label || 'Interface'); - const [attributes, setAttributes] = useState(data.attributes?.join('\n') || ''); const [methods, setMethods] = useState(data.methods?.join('\n') || ''); const headerColor = data.color || '#FFEE93'; - const attributesRef = useRef(null); const methodsRef = useRef(null); useEffect(() => { - if (attributesRef.current) { - attributesRef.current.style.height = 'auto'; - attributesRef.current.style.height = `${attributesRef.current.scrollHeight}px`; - } if (methodsRef.current) { methodsRef.current.style.height = 'auto'; methodsRef.current.style.height = `${methodsRef.current.scrollHeight}px`; } - }, [attributes, methods]); + }, [methods]); const handleLabelChange = (e) => { const newLabel = e.target.value; @@ -40,12 +33,6 @@ const UMLInterfaceNode: React.FC = ({ data, id }) => { data.updateNodeData?.(id, { label: newLabel }); }; - const handleAttributesChange = (e) => { - const newAttributes = e.target.value; - setAttributes(newAttributes); - data.updateNodeData?.(id, { attributes: newAttributes.split('\n') }); - }; - const handleMethodsChange = (e) => { const newMethods = e.target.value; setMethods(newMethods); @@ -95,15 +82,6 @@ const UMLInterfaceNode: React.FC = ({ data, id }) => { X -
-