ISSUE-017 - Improvements to a number of things.
* Moved FullScreenContainer in WorkspacesRoute to make scrolling much better. Seriously, 100% works better. * Simplified dimensions state actions to a shared one. * Abandoned the noisy and useless "AnimatedBG" type. * Added workspace dimensions state (I'll need this later to prevent off-screen dragging). * Placed OverlayDisplay component in PreviewWindow, where it makes more sense. I'll still allow it to roam around outside of it, though. * Renamed "menu" dimensions to "mainMenu". * Improved initNewOverlayItem action to support setting visible. * Correct handling of showing the OverlayItemContainer. * Simplified the initial position of a new OverlayItem to a simple initial value instead of setting it in the middle of provided dimensions. * Made PreviewWindow `position: relative` to allow absolute positioning of OverlayItem from it. * Added importHelpers to tsconfig because VSCode was complaining about it.
This commit is contained in:
1 parent
506491eed9
commit
61b60b9819
16 files changed
+113
-76
No files matched your search
+20
-9
@@ -2,8 +2,7 @@ import { Outlet } from "react-router-dom";
|
||||
|
||||
import { useDimensions } from "./utils/hooks";
|
||||
import {
|
||||
setMenuDimensions,
|
||||
setAppDimensions,
|
||||
setDimensions,
|
||||
} from "./features/pageDimensions/pageDimensionsSlice";
|
||||
|
||||
import { MainMenu } from "./components/Menu";
|
||||
@@ -12,18 +11,30 @@ import { useEffect } from "react";
|
||||
|
||||
function App() {
|
||||
const dispatch = useDispatch();
|
||||
const [appRef, { height: appHeight, width: appWidth }] = useDimensions<HTMLDivElement>();
|
||||
const [mainMenuRef, { height: mainMenuHeight }] = useDimensions<HTMLDivElement>();
|
||||
const [appRef, {
|
||||
height: appHeight,
|
||||
width: appWidth,
|
||||
}] = useDimensions<HTMLDivElement>();
|
||||
const [mainMenuRef, {
|
||||
height: mainMenuHeight,
|
||||
width: mainMenuWidth,
|
||||
}] = useDimensions<HTMLDivElement>();
|
||||
|
||||
// Set App height and width.
|
||||
// Set App dimensions.
|
||||
useEffect(() => {
|
||||
dispatch(setAppDimensions({ height: appHeight, width: appWidth }));
|
||||
dispatch(setDimensions({
|
||||
name: "app",
|
||||
dimensions: { height: appHeight, width: appWidth },
|
||||
}));
|
||||
}, [appHeight, appWidth]);
|
||||
|
||||
// Set MainMenu height.
|
||||
// Set MainMenu dimensions.
|
||||
useEffect(() => {
|
||||
dispatch(setMenuDimensions({ height: mainMenuHeight }));
|
||||
}, [mainMenuHeight]);
|
||||
dispatch(setDimensions({
|
||||
name: "mainMenu",
|
||||
dimensions: { height: mainMenuHeight, width: mainMenuWidth },
|
||||
}));
|
||||
}, [mainMenuHeight, mainMenuWidth]);
|
||||
|
||||
return (
|
||||
<div className="App" ref={appRef}>
|
||||
|
||||
Reference in new issue
Block a user