Link内嵌改为a标签

This commit is contained in:
tangly1024
2021-12-15 11:37:37 +08:00
parent 400fad1a49
commit ef8f38fd7b
7 changed files with 25 additions and 24 deletions

View File

@@ -31,7 +31,7 @@ const LatestPostsGroup = ({ posts, sliceCount = 5 }) => {
const selected = currentPath === `${BLOG.path}/article/${post.slug}`
return (
<Link key={post.id} title={post.title} href={`${BLOG.path}/article/${post.slug}`} passHref>
<div className={(selected ? 'bg-gray-200 dark:bg-black ' : '') + ' my-1 px-5 flex font-light justify-between'}>
<a className={(selected ? 'bg-gray-200 dark:bg-black ' : '') + ' my-1 px-5 flex font-light justify-between'}>
<div className={ 'text-xs py-1 flex w-40 overflow-x-hidden whitespace-nowrap overflow-hidden ' +
'hover:text-blue-500 dark:hover:text-blue-400 cursor-pointer hover:underline' +
(selected ? 'dark:text-white text-black ' : 'text-gray-500 dark:text-gray-300')
@@ -41,7 +41,7 @@ const LatestPostsGroup = ({ posts, sliceCount = 5 }) => {
<div className='text-gray-500 text-xs py-1'>
{formatDateFmt(post.lastEditedTime, 'yyyy/MM/dd')}
</div>
</div>
</a>
</Link>
)
})}