优化阅读功能

This commit is contained in:
truewhile
2026-10-01 21:57:25 +08:00
parent c1ff55ffbf
commit ce4319ec25
56 changed files with 9511 additions and 354 deletions
+7 -1
View File
@@ -4,6 +4,7 @@ import { useLocation, useNavigate } from 'react-router-dom'
import { prefetchCommonRouteChunks } from '../appRoutes'
import { useAuthStore } from '../stores/auth'
import { usePlayProfileStore } from '../stores/playProfile'
import { useReaderSettingsStore } from '../stores/readerSettings'
import {
LayoutHeader,
LayoutSidebars,
@@ -48,6 +49,7 @@ export function Layout() {
const user = useAuthStore((s) => s.user)
const logout = useAuthStore((s) => s.logout)
const homeMode = useReaderSettingsStore((s) => s.homeMode)
const activeProfileId = usePlayProfileStore((s) => s.activeProfileId)
const setActiveProfile = usePlayProfileStore((s) => s.setActiveProfile)
const theme = useThemeMode()
@@ -61,7 +63,9 @@ export function Layout() {
const showSidebar = !isMediaView(location.pathname, location.search)
const hideSearch = location.pathname.startsWith('/settings')
const isPlayPage = isPlayerRoute(location.pathname)
const showMobileBottomNav = shouldShowMobileBottomNav(location.pathname)
// 阅读模式:首页切到阅读后,影视那一套壳(媒体搜索、账号菜单、底部导航)都不该出现
const readingMode = homeMode === 'reading' && location.pathname === '/'
const showMobileBottomNav = shouldShowMobileBottomNav(location.pathname) && !readingMode
return (
<div className="flex h-[100dvh] min-h-0 w-full overflow-hidden bg-[var(--app-bg)] text-[var(--app-text)] font-body select-none">
@@ -84,6 +88,8 @@ export function Layout() {
onLogout={closeProfileAndLogout}
showSidebar={showSidebar}
hideSearch={hideSearch}
readingMode={readingMode}
showReaderToggle={location.pathname === '/'}
pathname={location.pathname}
/>
)}