Files
cherry-studio/src/renderer/src/hooks/useNavbar.ts
T
fullex 0ef3852029 refactor: update theme handling and preference types
- Removed the App_SetTheme IPC channel and related theme management code.
- Updated imports to use preferenceTypes for theme and selection action items.
- Refactored preference service to preload preferences and adjusted related components.
- Cleaned up unused code and comments related to theme management.
- Enhanced the organization of preference-related types and actions for better maintainability.
2025-09-01 23:49:17 +08:00

13 lines
389 B
TypeScript

import { usePreference } from '@data/hooks/usePreference'
export const useNavbarPosition = () => {
const [navbarPosition, setNavbarPosition] = usePreference('ui.navbar.position')
return {
navbarPosition,
isLeftNavbar: navbarPosition === 'left',
isTopNavbar: navbarPosition === 'top',
setNavbarPosition: (position: 'left' | 'top') => setNavbarPosition(position)
}
}