2024-01-16 03:49:09 +08:00
|
|
|
import { ACTIONS, PANELS } from '/imports/ui/components/layout/enums';
|
2024-06-14 21:30:48 +08:00
|
|
|
import { useIsSharedNotesEnabled } from '/imports/ui/services/features';
|
2024-01-16 03:49:09 +08:00
|
|
|
|
2024-06-14 21:30:48 +08:00
|
|
|
const useIsEnabled = () => useIsSharedNotesEnabled();
|
2024-01-16 03:49:09 +08:00
|
|
|
|
|
|
|
// @ts-ignore Until everything in Typescript
|
|
|
|
const toggleNotesPanel = (sidebarContentPanel, layoutContextDispatch) => {
|
|
|
|
layoutContextDispatch({
|
|
|
|
type: ACTIONS.SET_SIDEBAR_CONTENT_IS_OPEN,
|
|
|
|
value: sidebarContentPanel !== PANELS.SHARED_NOTES,
|
|
|
|
});
|
|
|
|
layoutContextDispatch({
|
|
|
|
type: ACTIONS.SET_SIDEBAR_CONTENT_PANEL,
|
|
|
|
value:
|
|
|
|
sidebarContentPanel === PANELS.SHARED_NOTES
|
|
|
|
? PANELS.NONE
|
|
|
|
: PANELS.SHARED_NOTES,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
toggleNotesPanel,
|
2024-06-14 21:30:48 +08:00
|
|
|
useIsEnabled,
|
2024-01-16 03:49:09 +08:00
|
|
|
};
|