diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index 1c837b0b2..6f8641378 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -2324,13 +2324,7 @@ export type CreateCommentMutationVariables = Exact<{ export type CreateCommentMutation = { __typename?: 'Mutation', createOneComment: { __typename?: 'Comment', id: string, createdAt: string, body: string, activityId?: string | null, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } } }; export type CreateActivityMutationVariables = Exact<{ - activityId: Scalars['String']; - body?: InputMaybe; - title?: InputMaybe; - type: ActivityType; - authorId: Scalars['String']; - createdAt: Scalars['DateTime']; - activityTargetArray: Array | ActivityTargetCreateManyActivityInput; + data: ActivityCreateInput; }>; @@ -2841,10 +2835,8 @@ export type CreateCommentMutationHookResult = ReturnType; export type CreateCommentMutationOptions = Apollo.BaseMutationOptions; export const CreateActivityDocument = gql` - mutation CreateActivity($activityId: String!, $body: String, $title: String, $type: ActivityType!, $authorId: String!, $createdAt: DateTime!, $activityTargetArray: [ActivityTargetCreateManyActivityInput!]!) { - createOneActivity( - data: {id: $activityId, createdAt: $createdAt, updatedAt: $createdAt, author: {connect: {id: $authorId}}, body: $body, title: $title, type: $type, activityTargets: {createMany: {data: $activityTargetArray, skipDuplicates: true}}} - ) { + mutation CreateActivity($data: ActivityCreateInput!) { + createOneActivity(data: $data) { id createdAt updatedAt @@ -2885,13 +2877,7 @@ export type CreateActivityMutationFn = Apollo.MutationFunction diff --git a/front/src/modules/activities/components/TaskGroups.tsx b/front/src/modules/activities/components/TaskGroups.tsx index 33330c827..f946ae7ba 100644 --- a/front/src/modules/activities/components/TaskGroups.tsx +++ b/front/src/modules/activities/components/TaskGroups.tsx @@ -1,13 +1,74 @@ +import { useTheme } from '@emotion/react'; +import styled from '@emotion/styled'; +import { IconCheckbox } from '@tabler/icons-react'; + +import { Button, ButtonVariant } from '@/ui/button/components/Button'; +import { ActivityType } from '~/generated/graphql'; + +import { useOpenCreateActivityDrawer } from '../hooks/useOpenCreateActivityDrawer'; import { useTasks } from '../hooks/useTasks'; import { TaskList } from './TaskList'; +const StyledTaskGroupEmptyContainer = styled.div` + align-items: center; + align-self: stretch; + display: flex; + flex: 1 0 0; + flex-direction: column; + gap: ${({ theme }) => theme.spacing(2)}; + justify-content: center; + padding-bottom: ${({ theme }) => theme.spacing(16)}; + padding-left: ${({ theme }) => theme.spacing(4)}; + padding-right: ${({ theme }) => theme.spacing(4)}; + padding-top: ${({ theme }) => theme.spacing(3)}; +`; + +const StyledEmptyTaskGroupTitle = styled.div` + color: ${({ theme }) => theme.font.color.secondary}; + font-size: ${({ theme }) => theme.font.size.xxl}; + font-weight: ${({ theme }) => theme.font.weight.semiBold}; + line-height: ${({ theme }) => theme.text.lineHeight.md}; +`; + +const StyledEmptyTaskGroupSubTitle = styled.div` + color: ${({ theme }) => theme.font.color.extraLight}; + font-size: ${({ theme }) => theme.font.size.xxl}; + font-weight: ${({ theme }) => theme.font.weight.semiBold}; + line-height: ${({ theme }) => theme.text.lineHeight.md}; + margin-bottom: ${({ theme }) => theme.spacing(2)}; +`; + export function TaskGroups() { - const { todayOrPreviousTasks, upcomingTasks } = useTasks(); + const { todayOrPreviousTasks, upcomingTasks, unscheduledTasks } = useTasks(); + const theme = useTheme(); + + const openCreateActivity = useOpenCreateActivityDrawer(); + + if ( + todayOrPreviousTasks?.length === 0 && + upcomingTasks?.length === 0 && + unscheduledTasks?.length === 0 + ) { + return ( + + No task yet + Create one: +