<commit_before>import styled from "styled-components";
import badgeSizes from "../constants/badgeSizes";
import thumbnailSizes from "../constants/thumbnailSizes";
import { colors as colorConstants } from "@crave/farmblocks-theme";

const size = props => props.size;

const borderRadius = props => (props.badge ? "100%" : "4px");

const borderWidth = props => {
  const sizeLimit = props.badge ? badgeSizes.MEDIUM : thumbnailSizes.LARGE;
  return props.size < sizeLimit ? "1px" : "2px";
};

const borderColor = colorConstants.GREY_16;

const backgroundImage = props => window.encodeURI(props.src);
const backgroundSize = props => props.fit;

const StyledImage = styled.div`
  background-origin: border-box;
  background-repeat: no-repeat;
  box-sizing: border-box;
  width: ${size}px;
  height: ${size}px;
  overflow: hidden;
  border: solid ${borderWidth} ${borderColor};
  border-radius: ${borderRadius};
  background-image: url(${backgroundImage});
  background-size: ${backgroundSize};
  background-position: center;
`;

export default StyledImage;<commit_msg>fix(image): fix div dimensions on Image component<commit_after>import styled from "styled-components";
import badgeSizes from "../constants/badgeSizes";
import thumbnailSizes from "../constants/thumbnailSizes";
import { colors as colorConstants } from "@crave/farmblocks-theme";

const size = props => props.size;

const borderRadius = props => (props.badge ? "100%" : "4px");

const borderWidth = props => {
  const sizeLimit = props.badge ? badgeSizes.MEDIUM : thumbnailSizes.LARGE;
  return props.size < sizeLimit ? "1px" : "2px";
};

const borderColor = colorConstants.GREY_16;

const backgroundImage = props => window.encodeURI(props.src);
const backgroundSize = props => props.fit;

const StyledImage = styled.div`
  background-origin: border-box;
  background-repeat: no-repeat;
  box-sizing: border-box;
  min-width: ${size}px;
  min-height: ${size}px;
  width: ${size}px;
  height: ${size}px;
  overflow: hidden;
  border: solid ${borderWidth} ${borderColor};
  border-radius: ${borderRadius};
  background-image: url(${backgroundImage});
  background-size: ${backgroundSize};
  background-position: center;
`;

export default StyledImage;
{'fraction_non_alphanumeric': 0.13975576662143827, 'fraction_numerical': 0.007236544549977386, 'mean_word_length': 5.161559888579387, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6097660', 'n_tokens_mistral': 692, 'n_tokens_neox': 690, 'n_words': 173}