fix(ui): hack for hiding pinned panels

This commit is contained in:
psychedelicious 2023-03-12 13:46:00 +11:00
parent dd2d96a50f
commit ad2f1b7b36
3 changed files with 14 additions and 7 deletions

View File

@ -11,12 +11,12 @@ import { activeTabNameSelector, uiSelector } from '../store/uiSelectors';
const floatingGalleryButtonSelector = createSelector(
[activeTabNameSelector, uiSelector],
(activeTabName, ui) => {
const { shouldPinGallery } = ui;
const { shouldPinGallery, shouldShowGallery } = ui;
return {
shouldPinGallery,
shouldShowGalleryButton:
!shouldPinGallery &&
(!shouldPinGallery || !shouldShowGallery) &&
['txt2img', 'img2img', 'unifiedCanvas'].includes(activeTabName),
};
},

View File

@ -23,17 +23,22 @@ const floatingButtonStyles: ChakraProps['sx'] = {
export const floatingParametersPanelButtonSelector = createSelector(
[uiSelector, activeTabNameSelector],
(ui, activeTabName) => {
const { shouldPinParametersPanel, shouldUseCanvasBetaLayout } = ui;
const {
shouldPinParametersPanel,
shouldUseCanvasBetaLayout,
shouldShowParametersPanel,
} = ui;
const canvasBetaLayoutCheck =
shouldUseCanvasBetaLayout && activeTabName === 'unifiedCanvas';
const shouldShowProcessButtons =
!canvasBetaLayoutCheck && !shouldPinParametersPanel;
!canvasBetaLayoutCheck &&
(!shouldPinParametersPanel || !shouldShowParametersPanel);
const shouldShowParametersPanelButton =
!canvasBetaLayoutCheck &&
!shouldPinParametersPanel &&
(!shouldPinParametersPanel || !shouldShowParametersPanel) &&
['txt2img', 'img2img', 'unifiedCanvas'].includes(activeTabName);
return {

View File

@ -154,19 +154,21 @@ const ResizableDrawer = ({
<Slide
direction={slideDirection}
in={isOpen}
motionProps={{ initial: false }}
unmountOnExit={isPinned}
motionProps={{ initial: isPinned }}
{...(isPinned
? {
style: {
position: undefined,
left: undefined,
right: undefined,
top: undefined,
bottom: undefined,
width: undefined,
},
}
: {
transition: { enter: { duration: 0.15 }, exit: { duration: 0.15 } },
// transition: { enter: { duration: 0.15 }, exit: { duration: 0.15 } },
style: { zIndex: 99, width: 'full' },
})}
>