| | |
| | | import Card from './card' |
| | | import './index.scss' |
| | | |
| | | const Container = ({list, handleList, handleMenu, deleteMenu }) => { |
| | | const [cards, setCards] = useState(list) |
| | | const Container = ({cardObj, handleList, handleMenu, deleteMenu }) => { |
| | | const [cards, setCards] = useState(cardObj.details) |
| | | const moveCard = (id, atIndex) => { |
| | | const { card, index } = findCard(id) |
| | | const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) |
| | |
| | | handleList(_cards) |
| | | } |
| | | |
| | | if (!is(fromJS(cards), fromJS(list))) { |
| | | setCards(list) |
| | | if (!is(fromJS(cards), fromJS(cardObj.details))) { |
| | | setCards(cardObj.details) |
| | | } |
| | | |
| | | const findCard = id => { |
| | |
| | | accept: 'detail' |
| | | }) |
| | | |
| | | let marginLeft = 0 |
| | | if (cardObj.subelement.includes('avatar')) { |
| | | marginLeft = 48 |
| | | } |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-card-meta-detail" style={{marginLeft: 48}}> |
| | | <div ref={drop} className="ant-card-meta-detail" style={{marginLeft: marginLeft}}> |
| | | {cards.map(card => ( |
| | | <Card |
| | | key={card.uuid} |