diff --git a/src/components/Feed.tsx b/src/components/Feed.tsx index 9b3a323..21d5176 100644 --- a/src/components/Feed.tsx +++ b/src/components/Feed.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { api, cover, fmt, fmtTime, mediaUrl, platform } from "../api"; +import { api, cover, fmt, fmtTime, isMobile, mediaUrl } from "../api"; import type { Detail, Episode, Post, VideoCard } from "../types"; import { useStore } from "../store"; import { Avatar, Img, Sheet } from "./ui"; @@ -34,7 +34,7 @@ const stripHtml = (s: string) => s.replace(/<[^>]+>/g, " ").replace(/ /g, " export default function Feed({ videoIds, startIndex = 0, title = "", mode, kind = "video", active, bottomInset, onBack, onNearEnd, startEp, startTime }: Props) { const store = useStore(); const { isLiked, isFav, toggleLikeLocal, toggleFavLocal, toggleFollowLocal, muted, setMuted, volume, setVolume, toast, addHistory, user, setLoginOpen } = store; - const isDesktop = platform !== "android"; + const isDesktop = !isMobile; const boxRef = useRef(null); const videoRef = useRef(null); diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 338bd00..4b4ad1f 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef, useState } from "react"; import Feed from "../components/Feed"; -import { api, platform } from "../api"; +import { api, isMobile } from "../api"; import type { VideoCard } from "../types"; import { useStore } from "../store"; import { ISearch, IVol, IVolMute } from "../icons"; @@ -59,7 +59,7 @@ export default function Home({ active, bottomInset }: { active: boolean; bottomI )} {/* 移动端:静音 + 搜索(压在视频上,固定白字 + 半透明黑底) */} - {platform === "android" && !fs && ( + {isMobile && !fs && (
吃瓜详情
diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index 9dc1b21..46c9552 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { api, APP_VERSION, fmt, fmtTime, platform } from "../api"; +import { api, APP_VERSION, fmt, fmtTime, isMobile, platform } from "../api"; import type { Detail } from "../types"; import { useStore } from "../store"; import { Avatar, Empty, Img } from "../components/ui"; @@ -34,7 +34,7 @@ export default function Profile({ wide }: { wide: boolean }) {
我的
- {platform === "android" && ( + {isMobile && (
-
HGhub {APP_VERSION} · {platform === "android" ? "Android" : platform === "macos" ? "macOS" : "Windows"} 客户端
+
HGhub {APP_VERSION} · {platform === "android" ? "Android" : platform === "ios" ? "iOS" : platform === "macos" ? "macOS" : "Windows"} 客户端
);