Skip to content

Commit

Permalink
Reduces the size of the requested image assets in news feed
Browse files Browse the repository at this point in the history
  • Loading branch information
comountainclimber committed May 13, 2019
1 parent 8c1ab44 commit 2bd8698
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/containers/News/News.jsx
Expand Up @@ -68,17 +68,19 @@ export default class News extends React.Component<Props, State> {
.find(prop => prop.includes('src'))
// $FlowFixMe
.replace('src=', '')
.replace('.png', '')
.replace('"', '')
.replace('"', '')

const reducedItems = items.slice(0, this.state.currentPage * 15)

return (
<div className={styles.newsItemsContainer}>
{reducedItems.map(item => {
const imgSrc = imageHrefFromImgTags(
const imgSrc = `${imageHrefFromImgTags(
// $FlowFixMe
item.content.match(imgTagRegex)[0],
)
)}-300x169.png`
const { title } = item
const openLink = () => electron.shell.openExternal(item.link)
return (
Expand Down

0 comments on commit 2bd8698

Please sign in to comment.