diff --git a/components/BlogPostCard.js b/components/BlogPostCard.js
index 6811ff93..785dcd18 100644
--- a/components/BlogPostCard.js
+++ b/components/BlogPostCard.js
@@ -10,18 +10,19 @@ import { useGlobal } from '@/lib/global'
const BlogPostCard = ({ post, showSummary }) => {
const { locale } = useGlobal()
+ const showPreview = BLOG.home?.showPreview && post.blockMap
return (
-
+
-
+
{post.title}
-
+
- {showSummary &&
+ {(!showPreview || showSummary) &&
{post.summary}
}
- {BLOG.home?.showPreview && post?.blockMap &&
+ {showPreview && post?.blockMap &&
{
const { locale } = useGlobal()
- const [searchKey, setSearchKey] = useState(currentSearch)
+ const [searchKey, setSearchKey] = useState(currentSearch || '')
const [onLoading, setLoadingState] = useState(false)
const router = useRouter()
const searchInputRef = useRef()
@@ -52,7 +52,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
className={'w-full text-sm pl-2 transition focus:shadow-lg font-light leading-10 border-gray-300 text-black bg-gray-100 dark:bg-gray-900 dark:text-white'}
onKeyUp={handleKeyUp}
onChange={e => updateSearchKey(e.target.value)}
- defaultValue={currentSearch}
+ defaultValue={searchKey}
/>
{(searchKey && searchKey.length && )}
diff --git a/pages/article/[slug].js b/pages/article/[slug].js
index ba0949f3..50fbf3f1 100644
--- a/pages/article/[slug].js
+++ b/pages/article/[slug].js
@@ -37,7 +37,7 @@ const Slug = ({
const drawerRight = useRef(null)
const targetRef = typeof window !== 'undefined' ? document.getElementById('container') : null
- const floatSlot = { drawerRight?.current?.handleSwitchVisible() }} />
+ const floatSlot = post?.toc.length > 1 ? { drawerRight?.current?.handleSwitchVisible() }} />
: null
return (