PromucFlow_constructor/app/client/src/selectors/appViewSelectors.tsx
Sangeeth Sivan e9d719103c
chore: code split sagas and reducer's index file (#16261)
* chore: code split sagas and reducers index file

* fix: update imports

* chore: remove acl reducers file on ce

* fix: code split reducers properly

* chore: remove unnecessary import

* chore: split root sagas file
2022-08-24 17:46:32 +05:30

40 lines
1.1 KiB
TypeScript

import { createSelector } from "reselect";
import { AppState } from "@appsmith/reducers";
import { AppViewReduxState } from "reducers/uiReducers/appViewReducer";
import { PageListReduxState } from "reducers/entityReducers/pageListReducer";
const getAppViewState = (state: AppState) => state.ui.appView;
const getPageListState = (state: AppState): PageListReduxState =>
state.entities.pageList;
export const getPageList = createSelector(
getPageListState,
(pageList: PageListReduxState) =>
pageList.pages.length > 0 ? pageList.pages : undefined,
);
export const getIsFetchingPage = createSelector(
getAppViewState,
(view: AppViewReduxState) => view.isFetchingPage,
);
export const getIsInitialized = createSelector(
getAppViewState,
(view: AppViewReduxState) => view.initialized,
);
export const getCurrentDSLPageId = createSelector(
getPageListState,
(pageList: PageListReduxState) => pageList.currentPageId,
);
/**
* returns the height of header in app view mode
*
* @param state
* @returns
*/
export const getAppViewHeaderHeight = (state: AppState) => {
return state.ui.appView.headerHeight;
};