article card uses next link

This commit is contained in:
tmshv committed 2020-02-18 20:35:16 +03:00
1 parent 0b47b12d27
commit 93d9021ac0
1 file changed
+4 -1
+4 -1
View File
@@ -3,6 +3,7 @@ import './styles.css'
import cx from 'classnames' import cx from 'classnames'
import { Date } from './Date' import { Date } from './Date'
import { IImage } from 'src/types' import { IImage } from 'src/types'
import Link from 'next/link'
export interface IArticleCardProps { export interface IArticleCardProps {
article: any article: any
@@ -11,7 +12,8 @@ export interface IArticleCardProps {
export const ArticleCard: React.FC<IArticleCardProps> = ({ article, ...props }) => ( export const ArticleCard: React.FC<IArticleCardProps> = ({ article, ...props }) => (
<section className="ArticleCard"> <section className="ArticleCard">
<a className="invisible" href={article.url}> <Link href={article.url}>
<a className="invisible">
<div className="ArticleCard-image"> <div className="ArticleCard-image">
{!props.preview ? null : ( {!props.preview ? null : (
<picture> <picture>
@@ -35,5 +37,6 @@ export const ArticleCard: React.FC<IArticleCardProps> = ({ article, ...props })
)} )}
</div> </div>
</a> </a>
</Link>
</section> </section>
) )