move link in news item

This commit is contained in:
elisejakob
2024-05-21 00:22:00 +02:00
parent e5819d9000
commit 06358ef1af

View File

@ -8,27 +8,28 @@ export const NewsItem = ({ news }: { news: NewsFragment }) => {
const featuredImage: any = news.featuredImage; const featuredImage: any = news.featuredImage;
return ( return (
<Link href={`/aktuelt/${news.slug}`}> <li className={`${styles.newsItem} linkItem`}>
<li className={`${styles.newsItem} linkItem`}> <div className={styles.image}>
<div className={styles.image}> {featuredImage && (
{featuredImage && ( <Image
<Image src={featuredImage.url}
src={featuredImage.url} alt={featuredImage.alt}
alt={featuredImage.alt} width={featuredImage.width}
width={featuredImage.width} height={featuredImage.height}
height={featuredImage.height} sizes="20vw"
sizes="20vw" />
/> )}
)} </div>
</div> <div className={styles.text}>
<div className={styles.text}> <p className={styles.date}>
<p className={styles.date}> {formatDate(news.firstPublishedAt, commonDateFormat)}
{formatDate(news.firstPublishedAt, commonDateFormat)} </p>
</p> <h2 className={styles.title}>{news.title}</h2>
<h2 className={styles.title}>{news.title}</h2> <p className={styles.lead}>{news.excerpt}</p>
<p className={styles.lead}>{news.excerpt}</p> </div>
</div> <Link href={`/aktuelt/${news.slug}`} className="hiddenLink">
</li> Les artikkelen: {news.title}
</Link> </Link>
</li>
); );
}; };