diff --git a/src/components/GoalPage/GoalPage.tsx b/src/components/GoalPage/GoalPage.tsx index 8023d5387..6795d4887 100644 --- a/src/components/GoalPage/GoalPage.tsx +++ b/src/components/GoalPage/GoalPage.tsx @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useRef } from 'react'; import dynamic from 'next/dynamic'; import styled from 'styled-components'; import { gapM, gray7 } from '@taskany/colors'; -import { Button, Card, CardInfo, CardContent, nullable, Text, Tag } from '@taskany/bricks'; +import { Button, Card, CardInfo, CardContent, nullable, Text, Tag, TagCleanButton } from '@taskany/bricks'; import { IconEditOutline, IconBinOutline, IconPlusCircleOutline, IconArrowRightOutline } from '@taskany/icons'; import { ExternalPageProps } from '../../utils/declareSsrProps'; @@ -188,6 +188,18 @@ export const GoalPage = ({ user, ssrTime, params: { id } }: ExternalPageProps<{ [goal, invalidate, goalTagsUpdate], ); + const onGoalTagRemove = useCallback( + (value: TagObject) => async () => { + if (!goal) return; + + const tags = goal.tags.filter((tag) => tag.id !== value.id); + await goalTagsUpdate(tags); + + invalidate(); + }, + [goal, invalidate, goalTagsUpdate], + ); + const onGoalAssigneeChange = useCallback( async (activity?: NonNullable) => { if (!activity?.user?.activityId) return; @@ -500,7 +512,10 @@ export const GoalPage = ({ user, ssrTime, params: { id } }: ExternalPageProps<{ <> {goal.tags?.map((tag) => ( - {tag.title} + + + {tag.title} + ))} {nullable(goal._isEditable, () => (