mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): hide bbox button when no canvas session active
This commit is contained in:
parent
bdc428cdd8
commit
e795de5647
@ -1,4 +1,5 @@
|
||||
import { ButtonGroup } from '@invoke-ai/ui-library';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { BboxToolButton } from 'features/controlLayers/components/BboxToolButton';
|
||||
import { BrushToolButton } from 'features/controlLayers/components/BrushToolButton';
|
||||
import { EraserToolButton } from 'features/controlLayers/components/EraserToolButton';
|
||||
@ -11,7 +12,9 @@ import { useCanvasResetLayerHotkey } from 'features/controlLayers/hooks/useCanva
|
||||
export const ToolChooser: React.FC = () => {
|
||||
useCanvasResetLayerHotkey();
|
||||
useCanvasDeleteLayerHotkey();
|
||||
const isCanvasSessionActive = useAppSelector((s) => s.canvasV2.session.isActive);
|
||||
|
||||
if (isCanvasSessionActive) {
|
||||
return (
|
||||
<ButtonGroup isAttached>
|
||||
<BrushToolButton />
|
||||
@ -22,4 +25,15 @@ export const ToolChooser: React.FC = () => {
|
||||
<BboxToolButton />
|
||||
</ButtonGroup>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ButtonGroup isAttached>
|
||||
<BrushToolButton />
|
||||
<EraserToolButton />
|
||||
<RectToolButton />
|
||||
<MoveToolButton />
|
||||
<ViewToolButton />
|
||||
</ButtonGroup>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user