mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Peeking: discard dedicated action getter
This commit is contained in:
@@ -25,7 +25,7 @@ import { useOverlayComponents } from '~/common/layout/overlays/useOverlayCompone
|
||||
import { BringTheLove } from './BringTheLove';
|
||||
import { DesktopNavGroupBox, DesktopNavIcon, navItemClasses } from './DesktopNavIcon';
|
||||
import { InvertedBar, InvertedBarCornerItem } from '../InvertedBar';
|
||||
import { optimaGetPeekActions, optimaOpenModels, optimaOpenPreferences, optimaToggleDrawer, useOptimaDrawerOpen, useOptimaModals } from '../useOptima';
|
||||
import { optimaActions, optimaOpenModels, optimaOpenPreferences, optimaToggleDrawer, useOptimaDrawerOpen, useOptimaModals } from '../useOptima';
|
||||
import { scratchClipSupported, useScratchClipVisibility } from '../scratchclip/store-scratchclip';
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export function DesktopNav(props: { component: React.ElementType, currentApp?: N
|
||||
const isDrawerOpen = useOptimaDrawerOpen();
|
||||
const { showPromisedOverlay } = useOverlayComponents();
|
||||
const { showModels, showPreferences } = useOptimaModals();
|
||||
const { peekDrawerEnter, peekDrawerLeave } = optimaGetPeekActions();
|
||||
const { peekDrawerEnter, peekDrawerLeave } = optimaActions();
|
||||
const { isVisible: isScratchClipVisible, toggleVisibility: toggleScratchClipVisibility } = useScratchClipVisibility();
|
||||
|
||||
// derived state
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { OptimaPortalId, useLayoutPortalsStore } from './store-layout-portals';
|
||||
import { optimaGetPeekActions } from '../useOptima';
|
||||
import { optimaActions } from '../useOptima';
|
||||
|
||||
|
||||
const _drawerWrapperStyle = {
|
||||
@@ -16,7 +16,7 @@ export function OptimaDrawerIn(props: { children: React.ReactNode }) {
|
||||
if (!portalElement) return null;
|
||||
|
||||
// wrap portal contents in a div that updates the hover state of the drawer
|
||||
const { peekDrawerEnter, peekDrawerLeave } = optimaGetPeekActions();
|
||||
const { peekDrawerEnter, peekDrawerLeave } = optimaActions();
|
||||
return createPortal(
|
||||
<div
|
||||
onMouseEnter={peekDrawerEnter}
|
||||
|
||||
@@ -30,10 +30,6 @@ export function useOptimaDrawerPeeking() {
|
||||
return useLayoutOptimaStore(({ drawerIsPeeking }) => drawerIsPeeking);
|
||||
}
|
||||
|
||||
export function optimaGetPeekActions(): { peekDrawerEnter: () => void, peekDrawerLeave: () => void } {
|
||||
return useLayoutOptimaStore.getState();
|
||||
}
|
||||
|
||||
|
||||
// Panel
|
||||
|
||||
@@ -65,6 +61,10 @@ export function useOptimaPanelOpen(isMobile: boolean, currentApp?: NavItemApp) {
|
||||
};
|
||||
}
|
||||
|
||||
export function useOptimaPanelPeeking() {
|
||||
return useLayoutOptimaStore(({ panelIsPeeking }) => panelIsPeeking);
|
||||
}
|
||||
|
||||
|
||||
// Modals
|
||||
|
||||
|
||||
Reference in New Issue
Block a user