From 8bf2b713bacc4fb9f29a3b9135c5540723c8d382 Mon Sep 17 00:00:00 2001 From: MadhavDhatrak Date: Sun, 2 Feb 2025 16:28:30 +0000 Subject: [PATCH] feat: enhance blog cards with read more button --- components/navigation/BlogPostItem.tsx | 147 ++++++++++++----------- components/newsroom/FeaturedBlogPost.tsx | 13 ++ 2 files changed, 90 insertions(+), 70 deletions(-) diff --git a/components/navigation/BlogPostItem.tsx b/components/navigation/BlogPostItem.tsx index 264fe0b6c66e..3ac810327528 100644 --- a/components/navigation/BlogPostItem.tsx +++ b/components/navigation/BlogPostItem.tsx @@ -10,6 +10,7 @@ import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading'; import { ParagraphTypeStyle } from '@/types/typography/Paragraph'; import AuthorAvatars from '../AuthorAvatars'; +import Button from '../buttons/Button'; import Heading from '../typography/Heading'; import Paragraph from '../typography/Paragraph'; @@ -54,82 +55,88 @@ export default forwardRef(function BlogPostItem( return (
  • - - - -
    -
    - - - {post.type} - - - - - {post.title} - - - - + + +
    +
    + + + {post.type} + + + + {post.title} + + + + + +
    +
    +
    +
    -
    -
    - -
    -
    - - - {post.authors - .map((author, index) => - author.link ? ( - - ) : ( - author.name - ) + // Handle the click event, e.g., navigate to author.link + window.open(author.link, '_blank'); + }} + > + {author.name} + + ) : ( + author.name ) - .reduce((prev, curr, index) => ( - - {prev} & {curr} - - ))} - - - - - · - {post.readingTime} min read - -
    + ) + .reduce((prev, curr, index) => ( + + {prev} & {curr} + + ))} + + + + +
    - - +
    + + {post.readingTime} min read + + +
    +
    +
  • ); diff --git a/components/newsroom/FeaturedBlogPost.tsx b/components/newsroom/FeaturedBlogPost.tsx index 49b4c8ef4ab4..99cac6c76b60 100644 --- a/components/newsroom/FeaturedBlogPost.tsx +++ b/components/newsroom/FeaturedBlogPost.tsx @@ -9,6 +9,7 @@ import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading'; import { ParagraphTypeStyle } from '@/types/typography/Paragraph'; import AuthorAvatars from '../AuthorAvatars'; +import Button from '../buttons/Button'; import Heading from '../typography/Heading'; import Paragraph from '../typography/Paragraph'; @@ -107,6 +108,18 @@ export default function FeaturedBlogPost({ post, className = '' }: FeaturedBlogP +
    + + {post.readingTime} min read + + +