[tasks] add empty state and new task button (#1072)
* [tasks] add empty state * add refetch + use spacing for padding * create task auto assigned with dueAt as today * add unscheduled tasks section * remove unnecessary assigneeId fetching * remove unnecessary refetchQueries * add refetch for delete task * rename createCommentMutation to deleteActivityMutation in activityActionBar
This commit is contained in:
@ -3,7 +3,10 @@ import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { GET_ACTIVITIES_BY_TARGETS } from '@/activities/queries';
|
||||
import {
|
||||
GET_ACTIVITIES,
|
||||
GET_ACTIVITIES_BY_TARGETS,
|
||||
} from '@/activities/queries';
|
||||
import { GET_COMPANIES } from '@/companies/queries';
|
||||
import { GET_PEOPLE } from '@/people/queries';
|
||||
import { IconButton } from '@/ui/button/components/IconButton';
|
||||
@ -22,16 +25,17 @@ type OwnProps = {
|
||||
|
||||
export function ActivityActionBar({ activityId }: OwnProps) {
|
||||
const theme = useTheme();
|
||||
const [createCommentMutation] = useDeleteActivityMutation();
|
||||
const [deleteActivityMutation] = useDeleteActivityMutation();
|
||||
const [, setIsRightDrawerOpen] = useRecoilState(isRightDrawerOpenState);
|
||||
|
||||
function deleteActivity() {
|
||||
createCommentMutation({
|
||||
deleteActivityMutation({
|
||||
variables: { activityId },
|
||||
refetchQueries: [
|
||||
getOperationName(GET_COMPANIES) ?? '',
|
||||
getOperationName(GET_PEOPLE) ?? '',
|
||||
getOperationName(GET_ACTIVITIES_BY_TARGETS) ?? '',
|
||||
getOperationName(GET_ACTIVITIES) ?? '',
|
||||
],
|
||||
});
|
||||
setIsRightDrawerOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user