Feat(Menu): Add tool menu via drag and drop

Drag and drop a tool card to add tool menu
This commit is contained in:
2024-04-30 13:42:36 +08:00
parent 843f47346a
commit 7b61a5fdb3
30 changed files with 785 additions and 298 deletions

View File

@@ -0,0 +1,27 @@
import { HandleContextInst } from '@/components/dnd/HandleContext'
import Icon from '@ant-design/icons'
import '@/assets/css/components/dnd/drag-handle.scss'
interface DragHandleProps {
padding?: string | number
}
const DragHandle = ({ padding }: DragHandleProps) => {
// eslint-disable-next-line @typescript-eslint/unbound-method
const { attributes, listeners, ref } = useContext(HandleContextInst)
return (
<button
data-component={'component-drag-handle'}
style={{ padding }}
ref={ref}
className={'drag-handle'}
{...attributes}
{...listeners}
>
<Icon component={IconOxygenHandle} />
</button>
)
}
export default DragHandle