Add task to action bar (#1153)

- add task to action bar
This commit is contained in:
brendanlaschke
2023-08-10 18:17:58 +02:00
committed by GitHub
parent 0f364cc9e7
commit c91844071a
7 changed files with 92 additions and 104 deletions

View File

@ -1,14 +1,24 @@
import { useOpenCreateActivityDrawerForSelectedRowIds } from '@/activities/hooks/useOpenCreateActivityDrawerForSelectedRowIds';
import { TableActionBarButtonToggleComments } from '@/ui/table/action-bar/components/TableActionBarButtonOpenComments';
import { CommentableType } from '~/generated/graphql';
import { TableActionBarButtonToggleTasks } from '@/ui/table/action-bar/components/TableActionBarButtonOpenTasks';
import { ActivityType, CommentableType } from '~/generated/graphql';
export function TableActionBarButtonCreateActivityCompany() {
const openCreateActivityRightDrawer =
useOpenCreateActivityDrawerForSelectedRowIds();
async function handleButtonClick() {
openCreateActivityRightDrawer(CommentableType.Company);
async function handleButtonClick(type: ActivityType) {
openCreateActivityRightDrawer(type, CommentableType.Company);
}
return <TableActionBarButtonToggleComments onClick={handleButtonClick} />;
return (
<>
<TableActionBarButtonToggleComments
onClick={() => handleButtonClick(ActivityType.Note)}
/>
<TableActionBarButtonToggleTasks
onClick={() => handleButtonClick(ActivityType.Task)}
/>
</>
);
}