优化,添加滚动记忆

This commit is contained in:
truewhile
2026-09-15 00:00:35 +08:00
parent 60f05129c9
commit a563ee11d6
15 changed files with 572 additions and 26 deletions
+9 -1
View File
@@ -4,6 +4,7 @@ import clsx from 'clsx'
import { LayoutSidebarContent, type LayoutSidebarContentProps } from './LayoutSidebarContent'
import { isPlayerRoute } from './layoutNavigation'
import { RouteErrorBoundary } from './RouteErrorBoundary'
import { useScrollMemory } from '../hooks/useScrollMemory'
import type { useLayoutSidebar } from './useLayoutSidebar'
type LayoutSidebarState = ReturnType<typeof useLayoutSidebar>
@@ -30,6 +31,7 @@ type LayoutSidebarsProps = Omit<
type LayoutWorkspaceProps = {
routeKey: string
userKey?: string
showMobileBottomNav?: boolean
}
@@ -109,7 +111,13 @@ export function LayoutSidebars({
)
}
export function LayoutWorkspace({ routeKey, showMobileBottomNav = false }: LayoutWorkspaceProps) {
export function LayoutWorkspace({
routeKey,
userKey = 'anonymous',
showMobileBottomNav = false,
}: LayoutWorkspaceProps) {
useScrollMemory(routeKey, userKey)
const bottomPad = showMobileBottomNav
? 'pb-[calc(3.75rem+env(safe-area-inset-bottom,0px))] lg:pb-10'
: ''