Skip to content

Commit

Permalink
chore: add read more in changelogs (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack authored Dec 11, 2024
1 parent 9d9b9bb commit 88aee95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/pages/changelog/posts-list/posts-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const PostsList = ({ posts, page, pageCount }: PostsListProps) => {
const date = new Date(updated_at);
const formattedDate = format(date, 'MMM dd, yyyy');
const preview = getPostPreview(content);
const isFullLoaded = preview === content;

return (
<li key={slug} className={clsx(index !== 0 && 'border-gray-90 sm:border-t sm:pt-7')}>
Expand Down Expand Up @@ -70,6 +71,14 @@ const PostsList = ({ posts, page, pageCount }: PostsListProps) => {
</Link>
</h2>
<Content content={preview} className="content-sm mt-9 lg:mt-6 md:mt-5" />
{!isFullLoaded && (
<Link
href={`${Route.CHANGELOG}/${slug}`}
className="text-14 font-semibold leading-none text-primary-1 hover:underline"
>
Read more
</Link>
)}
</div>
</article>
</li>
Expand Down

0 comments on commit 88aee95

Please sign in to comment.