* wip * wip * add pagination * wip * wip * wip * update resolver * wip * wip * endpoint is working but there is still work to do * merge main * wip * subject is now first subject * number of messages is working * improving query * fix bug * fix bug * added parameter * pagination introduced a bug * pagination is working * fix type * improve typing * improve typing * fix bug * add displayName * display displayName in the frontend * move entities * fix * generate metadata * add avatarUrl * modify after comments on PR * updates * remove email mocks * remove console log * move files * remove mock * use constant * use constant * use fragments * remove console.log * generate * changes made * update DTO * generate
22 lines
670 B
TypeScript
22 lines
670 B
TypeScript
import { useRecoilState } from 'recoil';
|
|
|
|
import { useOpenEmailThreadRightDrawer } from '@/activities/emails/right-drawer/hooks/useOpenEmailThreadRightDrawer';
|
|
import { viewableEmailThreadState } from '@/activities/emails/state/viewableEmailThreadState';
|
|
import { TimelineThread } from '~/generated/graphql';
|
|
|
|
export const useEmailThread = () => {
|
|
const [, setViewableEmailThread] = useRecoilState(viewableEmailThreadState);
|
|
|
|
const openEmailThredRightDrawer = useOpenEmailThreadRightDrawer();
|
|
|
|
const openEmailThread = (thread: TimelineThread) => {
|
|
openEmailThredRightDrawer();
|
|
|
|
setViewableEmailThread(thread);
|
|
};
|
|
|
|
return {
|
|
openEmailThread,
|
|
};
|
|
};
|