diff --git a/web/src/components/blog-home/blog-home.tsx b/web/src/components/blog-home/blog-home.tsx index 1cf66b5..795c8fe 100644 --- a/web/src/components/blog-home/blog-home.tsx +++ b/web/src/components/blog-home/blog-home.tsx @@ -15,6 +15,7 @@ import { listLabels } from "@/api/label"; import { POST_SORT_TYPE } from "@/localstore"; import { motion } from "framer-motion"; import { useDevice } from "@/hooks/use-device"; +import { checkIsMobile } from "@/utils/client/device"; // 定义排序类型 type SortType = 'latest' | 'popular'; @@ -23,7 +24,6 @@ export default function BlogHome() { const [labels, setLabels] = useState([]); const [posts, setPosts] = useState([]); const [loading, setLoading] = useState(false); - const { isMobile } = useDevice(); const [sortType, setSortType, sortTypeLoaded] = useStoredState(POST_SORT_TYPE, 'latest'); useEffect(() => { if (!sortTypeLoaded) return; @@ -90,7 +90,7 @@ export default function BlogHome() { {/* 主要内容区域 */} {/* 文章列表标题 */} @@ -155,9 +155,9 @@ export default function BlogHome() { {/* 侧边栏 */}