aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/PostPreview/PostPreview.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-16 23:20:58 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-16 23:20:58 +0100
commit8a703cb39ff23ff3639b0da33f0d72f92f1cc55b (patch)
treee898046c472839f36e306d8ae9aa7efc58ba98cd /src/components/PostPreview/PostPreview.tsx
parent89bf1e53fda306d271676bda4605794567b7f3b6 (diff)
chore: create thematic page view
For now I have to repeat some markup/styles, I cannot reuse PostsList component. WP GraphQL does not offer edges for ACF Post2Post or filters to get thematic posts with another way. I should create custom fields in backend to improve the posts fetching.
Diffstat (limited to 'src/components/PostPreview/PostPreview.tsx')
-rw-r--r--src/components/PostPreview/PostPreview.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx
index 3dfef73..95aca97 100644
--- a/src/components/PostPreview/PostPreview.tsx
+++ b/src/components/PostPreview/PostPreview.tsx
@@ -19,7 +19,7 @@ const PostPreview = ({
return (
<article className={styles.wrapper}>
- {post.featuredImage && (
+ {post.featuredImage && Object.keys(post.featuredImage).length > 0 && (
<div className={styles.cover}>
<Image
src={post.featuredImage.sourceUrl}
@@ -41,7 +41,7 @@ const PostPreview = ({
dangerouslySetInnerHTML={{ __html: post.content }}
></div>
<footer className={styles.footer}>
- <Link href={post.slug}>
+ <Link href={`/article/${post.slug}`}>
<a className={styles['read-more']}>
{t`Read more`}
<span className="screen-reader-text">