| | |
| | | const [, drop] = useDrop({ |
| | | accept: ItemTypes[type], |
| | | drop(item) { |
| | | if (item.hasOwnProperty('originalIndex') && groupId) { |
| | | const { card } = findCard(item.id) |
| | | |
| | | if (!card) { |
| | | handleList(type, cards, null, groupId, item.id) |
| | | } |
| | | } |
| | | |
| | | if (item.hasOwnProperty('originalIndex')) { |
| | | return |
| | | } |
| | |
| | | |
| | | const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) |
| | | setCards(_cards) |
| | | handleList(type, _cards, newcard) |
| | | handleList(type, _cards, newcard, groupId) |
| | | target = null |
| | | } |
| | | }) |
| | |
| | | {type === 'action' && cards.map(card => ( |
| | | <Card |
| | | key={card.uuid} |
| | | id={`${card.uuid}`} |
| | | id={card.uuid} |
| | | type={type} |
| | | card={card} |
| | | moveCard={moveCard} |
| | |
| | | {type === 'search' && cards.map(card => ( |
| | | <Col key={card.uuid} span={24 / setting.cols}> |
| | | <Card |
| | | id={`${card.uuid}`} |
| | | id={card.uuid} |
| | | key={card.uuid} |
| | | type={type} |
| | | card={card} |
| | | moveCard={moveCard} |