import React from 'react'
import {Link} from 'react-router-dom'

function setArticleLink(title) {
  return encodeURIComponent(title)
}

const ArticleCard = ({channel, article}) => {
  return (
    <div className="card">
      <Link to={`/newsfeed/${channel.source_id}/${setArticleLink(article.title)}`} className="article-link">
        <h3>{article.title}</h3>
        <img src={article.urlToImage} className="image"/>
      </Link>
    </div>
  )
}

export default ArticleCard

import React from 'react'
import {Link} from 'react-router-dom'

function setArticleLink(title) {
  return encodeURIComponent(title)
}

const ArticleCard = ({channel, article}) => {
  return (
    <Link to={`/newsfeed/${channel.source_id}/${setArticleLink(article.title)}`} className="article-link">
      <div className="card">
        <h3>{article.title}</h3>
        <img src={article.urlToImage} className="image"/>
      </div>
    </Link>
  )
}

export default ArticleCard

Refactor link to cover entire card
Refactor link to cover entire card
