Skip to content

Commit

Permalink
Use the ListGroupItem directly as a draggable.
Browse files Browse the repository at this point in the history
Fixes some styling issues.

react-dnd/react-dnd#347
  • Loading branch information
DanLipsitt committed Dec 29, 2015
1 parent f08a2b6 commit c88f9b3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions client/components/FileItem.jsx
@@ -1,4 +1,5 @@
import React, {Component, PropTypes} from 'react';
import {findDOMNode} from 'react-dom';
import {DragSource} from 'react-dnd';
import {ListGroupItem} from 'react-bootstrap';
import Time from 'react-time';
Expand Down Expand Up @@ -32,18 +33,19 @@ class FileItem extends Component {
};

render() {
const { isDragging, connectDragSource } = this.props;
const {isDragging, connectDragSource,
filename, createdAt,
...rest} = this.props;
const opacity = isDragging ? 0.4 : 1;
const {filename, createdAt} = this.props;

return (
connectDragSource(
<div>
<ListGroupItem header={filename}>
<b>uploaded</b> <Time value={createdAt} relative />
</ListGroupItem>
</div>
)
<ListGroupItem
header={filename}
ref={el => connectDragSource(findDOMNode(el))}
{...rest}
>
<b>uploaded</b> <Time value={createdAt} relative />
</ListGroupItem>
);
}
};
Expand Down

0 comments on commit c88f9b3

Please sign in to comment.