|
@@ -1,14 +1,16 @@
|
|
|
-import { useAppSelector } from '../../../stores/store';
|
|
|
+import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
|
|
import { useNavigate } from 'react-router-dom';
|
|
|
import { IPage } from '../../../stores/reducers/pages/slice';
|
|
|
import { ViewLayoutTypePB } from '../../../../services/backend';
|
|
|
import { MouseEventHandler, useState } from 'react';
|
|
|
+import { activePageIdActions } from '../../../stores/reducers/activePageId/slice';
|
|
|
|
|
|
// number of pixels from left side of screen to show hidden navigation panel
|
|
|
const FLOATING_PANEL_SHOW_WIDTH = 10;
|
|
|
const FLOATING_PANEL_HIDE_EXTRA_WIDTH = 10;
|
|
|
|
|
|
export const useNavigationPanelHooks = function () {
|
|
|
+ const dispatch = useAppDispatch();
|
|
|
const folders = useAppSelector((state) => state.folders);
|
|
|
const pages = useAppSelector((state) => state.pages);
|
|
|
const width = useAppSelector((state) => state.navigationWidth);
|
|
@@ -52,6 +54,8 @@ export const useNavigationPanelHooks = function () {
|
|
|
}
|
|
|
})();
|
|
|
|
|
|
+ dispatch(activePageIdActions.setActivePageId(page.id));
|
|
|
+
|
|
|
navigate(`/page/${pageTypeRoute}/${page.id}`);
|
|
|
};
|
|
|
|