feat: use custom hook useRightOverlayMode
parent
577278a14d
commit
851eca36e3
@ -1,6 +1,14 @@
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
import { RightOverlayMode } from '../state/ducks/section';
|
||||||
|
import { StateType } from '../state/reducer';
|
||||||
import { isRightPanelShowing } from '../state/selectors/conversations';
|
import { isRightPanelShowing } from '../state/selectors/conversations';
|
||||||
|
|
||||||
export function useIsRightPanelShowing(): boolean {
|
export function useIsRightPanelShowing(): boolean {
|
||||||
return useSelector(isRightPanelShowing);
|
return useSelector(isRightPanelShowing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function useRightOverlayMode(): RightOverlayMode | undefined {
|
||||||
|
return useSelector((state: StateType): RightOverlayMode | undefined => {
|
||||||
|
return state.section.rightOverlayMode;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue