king
2019-11-19 233709a44a2f5cfff9b8fb955ebcdc6889c0d40b
src/components/sidemenu/comtableconfig/dragelement/card.jsx
@@ -5,7 +5,7 @@
import ItemTypes from './itemtypes'
import './index.scss'
const Card = ({ id, type, card, moveCard, findCard, editCard, hasDrop }) => {
const Card = ({ id, type, card, moveCard, findCard, editCard, copyCard, hasDrop }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: ItemTypes[type], id, originalIndex },
@@ -34,6 +34,11 @@
  const edit = () => {
    editCard(id)
  }
  const copy = () => {
    copyCard(id)
  }
  return (
    <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}>
      <div ref={node => drag(drop(node))}>
@@ -77,6 +82,7 @@
        }
      </div>
      <Icon className="edit" type="edit" onClick={edit} />
      {type === 'action' && <Icon className="edit copy" type="copy" onClick={copy} />}
    </div>
  )
}