From f10b7aacda10131ab8b57917e347d1901a536afa Mon Sep 17 00:00:00 2001 From: amirhouieh Date: Mon, 15 May 2023 11:26:55 +0200 Subject: [PATCH] fix article cards linking --- src/components/Article/Article.MobileToc.tsx | 2 +- .../ArticleReference/ArticleReference.tsx | 19 ++++++---- src/components/FeaturedPost/FeaturedPost.tsx | 38 +++++++++---------- src/components/PostList/PostList.tsx | 8 ++-- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/components/Article/Article.MobileToc.tsx b/src/components/Article/Article.MobileToc.tsx index 704a942..608d65e 100644 --- a/src/components/Article/Article.MobileToc.tsx +++ b/src/components/Article/Article.MobileToc.tsx @@ -24,7 +24,7 @@ export const MobileToc = ({ toc }: Props) => { > {toc.title} - + ))} diff --git a/src/components/ArticleReference/ArticleReference.tsx b/src/components/ArticleReference/ArticleReference.tsx index a18af57..a94f4e4 100644 --- a/src/components/ArticleReference/ArticleReference.tsx +++ b/src/components/ArticleReference/ArticleReference.tsx @@ -14,7 +14,6 @@ export default function ArticleReference({ data: { title, modifiedAt, mentions, slug }, ...props }: Props) { - const router = useRouter() const localDate = new Date(modifiedAt).toLocaleString('en-GB', { day: 'numeric', month: 'long', @@ -22,10 +21,12 @@ export default function ArticleReference({ }) return ( - - - {title} - + + + + {title} + + - + ) } -const ReferenceLink = styled(Link)` +const Container = styled.div` display: flex; flex-direction: column; padding: 8px 14px; border-bottom: 1px solid rgb(var(--lsd-border-primary)); text-decoration: none; - cursor: pointer; &:last-child { border-bottom: none; } +` +const ArticleLink = styled(Link)` + text-decoration: none; &:hover { text-decoration: underline; } diff --git a/src/components/FeaturedPost/FeaturedPost.tsx b/src/components/FeaturedPost/FeaturedPost.tsx index 5189dbe..4e0801f 100644 --- a/src/components/FeaturedPost/FeaturedPost.tsx +++ b/src/components/FeaturedPost/FeaturedPost.tsx @@ -11,26 +11,24 @@ const FeaturedPost = ({ post }: Props) => { return ( - - - - - + + + ) diff --git a/src/components/PostList/PostList.tsx b/src/components/PostList/PostList.tsx index a3e3157..dc4fa1f 100644 --- a/src/components/PostList/PostList.tsx +++ b/src/components/PostList/PostList.tsx @@ -56,11 +56,9 @@ export const PostsList = (props: Props) => { } key={index} > - - - - - + + + )) ) : (