<commit_before>import React, { Component } from 'react';
import { DragLayer } from 'react-dnd';

const collectDragLayer = monitor => ({
  item: monitor.getItem(),
  itemType: monitor.getItemType(),
  clientOffset: monitor.getClientOffset(),
  initialClientOffset: monitor.getInitialClientOffset()
});

const getItemPosition = (
  {
    clientOffset,
    item,
    gridRect
  }
) => {
  if (!clientOffset) {
    return {
      display: 'none'
    };
  }
  let x;
  let y;
  if (item.position === 'right') {
    y = 0;
    x = Math.min(Math.max(clientOffset.x - gridRect.left, 0), gridRect.width);
  } else {
    x = 0;
    y = Math.min(Math.max(clientOffset.y - gridRect.top, 0), gridRect.height);
  }

  const transform = `translate(${x}px, ${y}px)`;
  return {
    transform,
    WebkitTransform: transform
  };
};

class CustomDragLayer extends Component {
  render() {
    let height;
    let width;
    if (<commit_msg>Remove buggy checks on grid width and height<commit_after>import React, { Component } from 'react';
import { DragLayer } from 'react-dnd';

const collectDragLayer = monitor => ({
  item: monitor.getItem(),
  itemType: monitor.getItemType(),
  clientOffset: monitor.getClientOffset(),
  initialClientOffset: monitor.getInitialClientOffset()
});

const getItemPosition = (
  {
    clientOffset,
    item,
    gridRect
  }
) => {
  if (!clientOffset) {
    return {
      display: 'none'
    };
  }
  let x;
  let y;
  if (item.position === 'right') {
    y = 0;
    // x = Math.min(Math.max(clientOffset.x - gridRect.left, 0), gridRect.width);
    x = clientOffset.x - gridRect.left;
  } else {
    x = 0;
    // y = Math.min(Math.max(clientOffset.y - gridRect.top, 0), gridRect.height);
    y = clientOffset.y - gridRect.top;
  }

  const transform = `translate(${x}px, ${y}px)`;
  return {
    transform,
    WebkitTransform: transform
  };
};

class CustomDragLayer extends Component {
  render() {
    let height;
    let width;
    if (
{'fraction_non_alphanumeric': 0.145769622833843, 'fraction_numerical': 0.004077471967380225, 'mean_word_length': 3.039094650205761, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3006114', 'n_tokens_mistral': 667, 'n_tokens_neox': 659, 'n_words': 153}