gitbook-collapse

This commit is contained in:
tangly1024.com
2023-06-29 15:55:23 +08:00
parent bb8d0a5fa7
commit bcddec5748
13 changed files with 107 additions and 65 deletions

View File

@@ -7,18 +7,10 @@ const BlogPostCard = ({ post, className }) => {
const router = useRouter()
const currentSelected = router.asPath.split('?')[0] === '/' + post.slug
return (
<div key={post.id} className="py-0.5">
<div key={post.id} className={`${className} py-1 cursor-pointer px-2 hover:bg-gray-50 rounded-md dark:hover:bg-gray-600 ${currentSelected ? 'bg-green-50 text-green-500' : ''}`}>
<div className="flex flex-col w-full">
<Link
href={`${BLOG.SUB_PATH}/${post.slug}`}
passHref
className={
`${className} ${currentSelected ? 'bg-gray-500 text-white font-bold' : 'text-gray-700 dark:text-gray-300 '} pl-1 hover:font-bold py-0.5 cursor-pointer`
}>
<div>
{post.title}
</div>
<Link href={`${BLOG.SUB_PATH}/${post.slug}`} passHref>
{post.title}
</Link>
</div>
</div>