diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-29 17:52:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-29 18:01:06 +0100 |
| commit | 8e0c8c9255ba5ab466d8372fe223efeb5a3f0833 (patch) | |
| tree | 67102c4c0776f83c8f845266728cb4099a14b41a /src/components/PostPreview/PostPreview.tsx | |
| parent | 76c01d51ccbdd0faaf12b624328a40ef24f33f88 (diff) | |
chore: replace read more link with ButtonLink component
I also fix the load more button position since I removed the margin
auto.
Diffstat (limited to 'src/components/PostPreview/PostPreview.tsx')
| -rw-r--r-- | src/components/PostPreview/PostPreview.tsx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/components/PostPreview/PostPreview.tsx b/src/components/PostPreview/PostPreview.tsx index f5c6d9b..ccbb9e5 100644 --- a/src/components/PostPreview/PostPreview.tsx +++ b/src/components/PostPreview/PostPreview.tsx @@ -2,9 +2,10 @@ import PostMeta from '@components/PostMeta/PostMeta'; import { t } from '@lingui/macro'; import { ArticlePreview } from '@ts/types/articles'; import Link from 'next/link'; -import ArrowRightIcon from '@assets/images/icon-arrow-right.svg'; import styles from './PostPreview.module.scss'; import Image from 'next/image'; +import { ButtonLink } from '@components/Buttons'; +import { ArrowIcon } from '@components/Icons'; type TitleLevel = 2 | 3 | 4 | 5 | 6; @@ -41,16 +42,18 @@ const PostPreview = ({ dangerouslySetInnerHTML={{ __html: post.intro }} ></div> <footer className={styles.footer}> - <Link href={`/article/${post.slug}`}> - <a className={styles['read-more']}> - {t`Read more`} - <span className="screen-reader-text"> - {' '} - {t({ message: `about ${post.title}`, comment: 'Post title' })} - </span> - <ArrowRightIcon className={styles.icon} /> - </a> - </Link> + <ButtonLink + target={`/article/${post.slug}`} + position="left" + hasIcon={true} + > + {t`Read more`} + <span className="screen-reader-text"> + {' '} + {t({ message: `about ${post.title}`, comment: 'Post title' })} + </span> + <ArrowIcon /> + </ButtonLink> </footer> <PostMeta commentCount={post.commentCount} |
