fix(ios): 播放页、首页、图文页、我的页移动端判断统一改用 isMobile
This commit is contained in:
@@ -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<HTMLDivElement>(null);
|
||||
const videoRef = useRef<VideoHandle>(null);
|
||||
|
||||
+2
-2
@@ -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 && (
|
||||
<div className="absolute inset-x-0 z-20 flex items-center px-3 pointer-events-none hg-player-ui" style={{ top: "calc(var(--sat, 0px) + 6px)" }}>
|
||||
<div className="ml-auto flex items-center gap-2">
|
||||
<button onClick={() => setMuted((m) => !m)} aria-label={muted ? "取消静音" : "静音"}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { api, cover, fmt, platform } from "../api";
|
||||
import { api, cover, fmt, isMobile } from "../api";
|
||||
import type { Post } from "../types";
|
||||
import { useStore } from "../store";
|
||||
import { Empty, Img } from "../components/ui";
|
||||
@@ -109,7 +109,7 @@ export function PostDetail({ id, onBack, active = true }: { id: number; onBack:
|
||||
|
||||
return (
|
||||
<div className="absolute inset-0 bg-bg flex flex-col">
|
||||
<div className="shrink-0 flex items-center gap-2 px-2 bg-s1" style={{ paddingTop: platform === "android" ? "var(--sat, 0px)" : 0, height: platform === "android" ? "calc(44px + var(--sat, 0px))" : 44 }}>
|
||||
<div className="shrink-0 flex items-center gap-2 px-2 bg-s1" style={{ paddingTop: isMobile ? "var(--sat, 0px)" : 0, height: isMobile ? "calc(44px + var(--sat, 0px))" : 44 }}>
|
||||
<button onClick={onBack} className="w-9 h-9 rounded-full flex items-center justify-center text-on hover:bg-s3 pressable"><IBack size={19} /></button>
|
||||
<span className="text-[13.5px] font-semibold text-on">吃瓜详情</span>
|
||||
</div>
|
||||
|
||||
@@ -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 }) {
|
||||
<div className="absolute inset-0 bg-bg flex flex-col">
|
||||
<div className="shrink-0 px-4 pb-2 flex items-center" style={{ paddingTop: "calc(var(--sat, 0px) + 14px)" }}>
|
||||
<div className="text-[24px] font-bold text-on leading-none">我的</div>
|
||||
{platform === "android" && (
|
||||
{isMobile && (
|
||||
<button onClick={() => push({ kind: "settings" })} aria-label="设置"
|
||||
className="ml-auto w-9 h-9 rounded-full bg-s3 flex items-center justify-center text-mut pressable">
|
||||
<ISettings size={17} strokeWidth={1.7} />
|
||||
@@ -126,7 +126,7 @@ export default function Profile({ wide }: { wide: boolean }) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="text-center text-[10px] text-dim mt-5">HGhub {APP_VERSION} · {platform === "android" ? "Android" : platform === "macos" ? "macOS" : "Windows"} 客户端</div>
|
||||
<div className="text-center text-[10px] text-dim mt-5">HGhub {APP_VERSION} · {platform === "android" ? "Android" : platform === "ios" ? "iOS" : platform === "macos" ? "macOS" : "Windows"} 客户端</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user