<commit_before>import React, { Component, PropTypes } from 'react';
import { DragSource as dragSource } from 'react-dnd';
import { CardModel } from 'redux/modules/card';
import { Card } from 'components';

export class DraggableCard extends Component {
  static propTypes = {
    connectDragSource: PropTypes.func.isRequired,
    index: PropTypes.number.isRequired,
    card: PropTypes.instanceOf(CardModel).isRequired,
    cardsLength: PropTypes.number.isRequired,
  }

  render() {
    const { connectDragSource, card, index, cardsLength } = this.props;

    return connectDragSource(
      <div>
        <Card card={card} index={index} cardsLength={cardsLength} />
      </div>
    );
  }
}

const cardSource = {
  beginDrag(props) {
    return {
      card: props.card,
      handIndex: props.index,
    };
  },
};

function collect(connect) {
  return {
    connectDragSource: connect.dragSource(),
  };
}

export default dragSource('CARD', cardSource, collect)(DraggableCard);
<commit_msg>Remove default dragPreview from DraggableCard<commit_after>import React, { Component, PropTypes } from 'react';
import { getEmptyImage } from 'react-dnd-html5-backend';
import { DragSource as dragSource } from 'react-dnd';
import { CardModel } from 'redux/modules/card';
import { Card } from 'components';

export class DraggableCard extends Component {
  static propTypes = {
    connectDragSource: PropTypes.func.isRequired,
    connectDragPreview: PropTypes.func.isRequired,
    index: PropTypes.number.isRequired,
    card: PropTypes.instanceOf(CardModel).isRequired,
    cardsLength: PropTypes.number.isRequired,
    isDragging: PropTypes.bool.isRequired,
  }

  componentDidMount() {
    const { connectDragPreview } = this.props;
    connectDragPreview(getEmptyImage());
  }

  render() {
    const { connectDragSource, isDragging, card, index, cardsLength } = this.props;

    return connectDragSource(
      <div style={{ display: isDragging ? 'none' : undefined }}>
        <Card card={card} index={index} cardsLength={cardsLength} />
      </div>
    );
  }
}

const cardSource = {
  beginDrag(props) {
    return {
      card: props.card,
      handIndex: props.index,
    };
  },
};

function collect(connect, monitor) {
  return {
    connectDragSource: connect.dragSource(),
    connectDragPreview: connect.dragPreview(),
    isDragging: monitor.isDragging(),
  };
}

export default dragSource('CARD', cardSource, collect)(DraggableCard);

{'fraction_non_alphanumeric': 0.12086565945283789, 'fraction_numerical': 0.0004083299305839118, 'mean_word_length': 3.9196787148594376, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2131496', 'n_tokens_mistral': 723, 'n_tokens_neox': 730, 'n_words': 164}