Feat/open comment drawer from comment chip (#187)

* wip

* Can open comment right drawer from company name cell
This commit is contained in:
Lucas Bordeau
2023-06-02 17:51:17 +02:00
committed by GitHub
parent 69c1095055
commit a2fe159c2c
15 changed files with 154 additions and 34 deletions

View File

@ -0,0 +1,18 @@
import { useRecoilState } from 'recoil';
import { useOpenRightDrawer } from '../../ui/layout/right-drawer/hooks/useOpenRightDrawer';
import { CommentableEntity } from '../types/CommentableEntity';
import { commentableEntityArrayState } from '../states/commentableEntityArrayState';
export function useOpenCommentRightDrawer() {
const openRightDrawer = useOpenRightDrawer();
const [, setCommentableEntityArray] = useRecoilState(
commentableEntityArrayState,
);
return function openCommentRightDrawer(
commentableEntityArray: CommentableEntity[],
) {
setCommentableEntityArray(commentableEntityArray);
openRightDrawer('comments');
};
}