mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-26 12:39:12 +00:00
24 lines
531 B
JavaScript
24 lines
531 B
JavaScript
import React, { Component } from 'react'
|
|
import { DragSource } from 'react-dnd'
|
|
import Role from './index'
|
|
|
|
const dragSource = DragSource(
|
|
Symbol.for('dnd: role'),
|
|
{
|
|
beginDrag({ role, categoryId }) {
|
|
return { role, category: categoryId }
|
|
},
|
|
},
|
|
(connect, monitor) => ({
|
|
connectDragSource: connect.dragSource(),
|
|
isDragging: monitor.isDragging(),
|
|
})
|
|
)
|
|
|
|
class DraggableRole extends Component {
|
|
render() {
|
|
return <Role {...this.props} type="drag" />
|
|
}
|
|
}
|
|
|
|
export default dragSource(DraggableRole)
|