Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/ThumbnailImage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import lodashClamp from 'lodash/clamp';
import React, {PureComponent} from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -36,7 +37,8 @@ class ThumbnailImage extends PureComponent {
updateImageSize({width, height}) {
// Width of the thumbnail works better as a constant than it does
// a percentage of the screen width since it is relative to each screen
const thumbnailScreenWidth = 250;
// Note: Clamp minimum width 40px to support touch device
const thumbnailScreenWidth = lodashClamp(width, 40, 250);
const scaleFactor = width / thumbnailScreenWidth;
const imageHeight = height / scaleFactor;
this.setState({thumbnailWidth: thumbnailScreenWidth, thumbnailHeight: imageHeight});
Expand Down