-
Masonry Layout
-
-
- {
- if (e.target.checked) {
- dispatch(setLayout(PREVIEW_LAYOUTS.MASONRY));
- } else {
- dispatch(setLayout(PREVIEW_LAYOUTS.COLUMN));
- }
- }}
- />
-
-
-
- );
-};
-
-export default MasonryLayout;
diff --git a/desktop-app/src/renderer/components/ToolBar/Menu/Flyout/PreviewLayout/index.tsx b/desktop-app/src/renderer/components/ToolBar/Menu/Flyout/PreviewLayout/index.tsx
index 921acd542..945d67981 100644
--- a/desktop-app/src/renderer/components/ToolBar/Menu/Flyout/PreviewLayout/index.tsx
+++ b/desktop-app/src/renderer/components/ToolBar/Menu/Flyout/PreviewLayout/index.tsx
@@ -1,20 +1,18 @@
import { Icon } from '@iconify/react';
-import { PREVIEW_LAYOUTS } from 'common/constants';
+import { PREVIEW_LAYOUTS, PreviewLayout } from 'common/constants';
import { useDispatch, useSelector } from 'react-redux';
+import { ButtonGroup } from 'renderer/components/ButtonGroup';
import useKeyboardShortcut, {
SHORTCUT_CHANNEL,
} from 'renderer/components/KeyboardShortcutsManager/useKeyboardShortcut';
-import Toggle from 'renderer/components/Toggle';
import { selectLayout, setLayout } from 'renderer/store/features/renderer';
-const PreviewLayout = () => {
+const PreviewLayoutSelector = () => {
const layout = useSelector(selectLayout);
const dispatch = useDispatch();
- const handleLayout = () => {
- if (layout === PREVIEW_LAYOUTS.FLEX)
- dispatch(setLayout(PREVIEW_LAYOUTS.COLUMN));
- else dispatch(setLayout(PREVIEW_LAYOUTS.FLEX));
+ const handleLayout = (newLayout: PreviewLayout) => {
+ dispatch(setLayout(newLayout));
};
useKeyboardShortcut(SHORTCUT_CHANNEL.PREVIEW_LAYOUT, handleLayout);
@@ -22,22 +20,47 @@ const PreviewLayout = () => {
return (