modeMenuEvt(value)}
- />
+ <>
+
+
+ }
+ style={{ backgroundColor: isPageOn ? vogues.color.white : ''}}
+ onClick={togglePagePanel}
+ />
+
+
+ }
+ style={{ backgroundColor: isAnimationOn ? vogues.color.white : ''}}
+ onClick={toggleAnimationPanel}
+ />
+
+
+ >
)
});
diff --git a/src/wireframes/components/tools/ZoomTool.tsx b/src/wireframes/components/tools/ZoomTool.tsx
index d777b19..1805094 100644
--- a/src/wireframes/components/tools/ZoomTool.tsx
+++ b/src/wireframes/components/tools/ZoomTool.tsx
@@ -18,14 +18,15 @@ import type { MenuProps } from 'antd';
export const ZoomTool = React.memo(() => {
const dispatch = useDispatch();
const editorSize = useStore(getEditor).size;
- const sidebarSize = useStore(s => s.ui.sidebarSize);
+ const sidebarWidth = useStore(s => s.ui.sidebarSize);
+ const isFooter = useStore(s => s.ui.footerSize) == vogues.common.previewHeight ? 1 : 0;
const [zoomValue, setZoomValue] = useState('Fit');
const zoomPad = {
- vertical: vogues.common.editorMargin * 2 + vogues.common.editorPad * 3 + vogues.common.headerHeight + vogues.common.shapeWidth + (vogues.common.previewHeight + vogues.common.editorMargin + vogues.common.previewPadBot) + vogues.common.selectionThickness * 4,
- horizontal: vogues.common.editorMargin * 4 + vogues.common.editorPad * 2 + vogues.common.sidebarShape + vogues.common.selectionThickness * 4,
+ vertical: vogues.common.editorMargin * 2 + vogues.common.editorPad * 3 + vogues.common.headerHeight + vogues.common.shapeWidth + isFooter * (vogues.common.previewHeight + vogues.common.editorMargin + vogues.common.previewPadBot) + vogues.common.selectionThickness * 4,
+ horizontal: vogues.common.editorMargin * 4 + vogues.common.editorPad * 3 + vogues.common.sidebarShape + vogues.common.selectionThickness * 4,
}
- const [areaSize, setAreaSize] = useState(new Vec2(window.innerWidth - zoomPad.horizontal - sidebarSize, window.innerHeight - zoomPad.vertical));
+ const [areaSize, setAreaSize] = useState(new Vec2(window.innerWidth - zoomPad.horizontal - sidebarWidth, window.innerHeight - zoomPad.vertical));
const isZoom = (key: string) => {
setZoomValue(key);
@@ -33,7 +34,7 @@ export const ZoomTool = React.memo(() => {
};
const getWindowSize = () => {
- setAreaSize(new Vec2(window.innerWidth - zoomPad.horizontal - sidebarSize, window.innerHeight - zoomPad.vertical));
+ setAreaSize(new Vec2(window.innerWidth - zoomPad.horizontal - sidebarWidth, window.innerHeight - zoomPad.vertical));
}
// Get area size value on resizing window
@@ -54,8 +55,7 @@ export const ZoomTool = React.memo(() => {
getWindowSize();
isZoom(zoomValue);
}
-
- }, [sidebarSize, editorSize]);
+ }, [isFooter, sidebarWidth, editorSize]);
const getZoomValue = (value: string) => {
switch (value) {
diff --git a/src/wireframes/model/actions/ui.ts b/src/wireframes/model/actions/ui.ts
index 47c4cf0..b39abee 100644
--- a/src/wireframes/model/actions/ui.ts
+++ b/src/wireframes/model/actions/ui.ts
@@ -33,6 +33,11 @@ export const setSidebarSize =
return { payload: { size } };
});
+export const setFooterSize =
+ createAction('ui/footerSize', (size: number) => {
+ return { payload: { size } };
+ });
+
export const setMode =
createAction('ui/mode', (mode: ModeType) => {
return { payload: { mode } };
@@ -75,6 +80,9 @@ export function ui(initialState: UIState): Reducer {
.addCase(setSidebarSize, (state, action) => {
state.sidebarSize = action.payload.size;
})
+ .addCase(setFooterSize, (state, action) => {
+ state.footerSize = action.payload.size;
+ })
.addCase(setMode, (state, action) => {
state.selectedMode = action.payload.mode;
})
diff --git a/src/wireframes/model/ui-state.ts b/src/wireframes/model/ui-state.ts
index 008fdf0..ac48596 100644
--- a/src/wireframes/model/ui-state.ts
+++ b/src/wireframes/model/ui-state.ts
@@ -19,9 +19,12 @@ export interface UIState {
// The info toast from any loading operation.
infoToast?: string;
- // The size for right sidebar
+ // The size for right sidebar.
sidebarSize: number;
+ // The size for pages section.
+ footerSize: number;
+
// The mode for the application.
selectedMode: ModeType;
@@ -41,10 +44,11 @@ export interface UIStateInStore {
export const createInitialUIState: () => UIState = () => {
return {
+ footerSize: vogues.common.previewHeight,
zoom: 1,
selectedColor: 'palette',
selectedMode: 'design',
selectedAnimation: 'script',
- sidebarSize: vogues.common.sidebarClose,
+ sidebarSize: vogues.common.close,
};
};