主题支持title icon

This commit is contained in:
tangly1024.com
2024-02-05 18:02:56 +08:00
parent a45320d1af
commit 77a367d175
3 changed files with 3 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import { siteConfig } from '@/lib/config'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { checkContainHttp, sliceUrlFromHttp } from '@/lib/utils'
import NotionIcon from '@/components/NotionIcon'
const BlogPostCard = ({ post, className }) => {
const router = useRouter()
@@ -9,8 +10,8 @@ const BlogPostCard = ({ post, className }) => {
const url = checkContainHttp(post.slug) ? sliceUrlFromHttp(post.slug) : `${siteConfig('SUB_PATH', '')}/${post.slug}`
return (
<Link href={url} passHref> <div key={post.id} className={`${className} py-1.5 cursor-pointer px-1.5 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 select-none">
{post.title}
<div className="w-full select-none">
<NotionIcon icon={post?.pageIcon}/> {post.title}
</div>
</div>
</Link>