title length limit added

This commit is contained in:
svetlagasheva 2018-11-22 18:12:20 +02:00
parent 3228880826
commit bfaea0c276

View file

@ -5,6 +5,8 @@ import Icon, { dataUrl as iconDataUrl } from 'stremio-icons/dom';
import colors from 'stremio-colors';
import styles from './styles';
const MAX_TITLE_SYMBOLS = 100;
const renderPoster = (poster) => {
if (poster.length === 0) {
return null;
@ -26,7 +28,7 @@ const renderTitle = (number, title) => {
}
return (
<div className={styles['title']}>{number}. {title}</div>
<div className={styles['title']}>{number}. {title.length > MAX_TITLE_SYMBOLS ? title.slice(0, MAX_TITLE_SYMBOLS) + '...' : title}</div>
);
}