mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
* refactor: add desktop sidebar navigation and consolidate header actions - Add DesktopSidebar component with collapsible navigation - Add useDesktop and useSidebarAction hooks for sidebar state management - Add useSidebarCollapsed hook with localStorage persistence and error handling - Integrate sidebar into App layout with tooltip support - Remove repoUrl and isRepoWorktree props from SourceControlPanel - BranchesTab now fetches repo data internally using getRepo query - Remove unused to prop from SidebarItem - Simplify RepoList conditional rendering - Add comprehensive test coverage for new components * refactor: remove LSP status button and memory plugin status hook - Delete LspStatusButton component and its test file - Remove unused useMemoryPluginStatus hook from RepoDetail - Clean up dead code as part of desktop header refactor
15 lines
361 B
TypeScript
15 lines
361 B
TypeScript
import { useState, useEffect } from 'react'
|
|
|
|
export function useDesktop() {
|
|
const [isDesktop, setIsDesktop] = useState(false)
|
|
|
|
useEffect(() => {
|
|
const check = () => setIsDesktop(window.innerWidth >= 768)
|
|
check()
|
|
window.addEventListener('resize', check)
|
|
return () => window.removeEventListener('resize', check)
|
|
}, [])
|
|
|
|
return isDesktop
|
|
}
|