([]);
@@ -41,13 +41,17 @@ export const GoalSublist = () => {
};
useEffect(() => {
- (isInboxOpen || showPartner ? getSharedWMGoal(goalID) : getGoal(goalID)).then((parent) => setParentGoal(parent));
+ (isInboxOpen || showPartnerMode ? getSharedWMGoal(goalID) : getGoal(goalID)).then((parent) =>
+ setParentGoal(parent),
+ );
}, [goalID]);
useEffect(() => {
- (isInboxOpen || showPartner ? getSharedWMChildrenGoals(goalID) : getChildrenGoals(goalID)).then((fetchedGoals) => {
- handleChildrenGoals(fetchedGoals);
- });
+ (isInboxOpen || showPartnerMode ? getSharedWMChildrenGoals(goalID) : getChildrenGoals(goalID)).then(
+ (fetchedGoals) => {
+ handleChildrenGoals(fetchedGoals);
+ },
+ );
}, [action, parentGoal, showAddGoal, showSuggestionModal, showChangesModal, showUpdateGoal]);
return (
diff --git a/src/components/GoalsComponents/MyGoal.tsx b/src/components/GoalsComponents/MyGoal.tsx
index 3dfcda282..ae3d2e9e7 100644
--- a/src/components/GoalsComponents/MyGoal.tsx
+++ b/src/components/GoalsComponents/MyGoal.tsx
@@ -1,23 +1,20 @@
-import { Tooltip } from "antd";
import React, { useEffect } from "react";
+import { useTranslation } from "react-i18next";
import { useLocation, useNavigate } from "react-router-dom";
import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil";
import pencil from "@assets/images/pencil.svg";
-import mainAvatarDark from "@assets/images/mainAvatarDark.svg";
-import mainAvatarLight from "@assets/images/mainAvatarLight.svg";
import { unarchiveIcon } from "@src/assets";
-import useGoalStore from "@src/hooks/useGoalStore";
-import NotificationSymbol from "@src/common/NotificationSymbol";
import { GoalItem } from "@src/models/GoalItem";
+import { getSvgForGoalPps } from "@src/utils";
import { unarchiveUserGoal } from "@src/api/GoalsAPI";
-import { darkModeState, displayPartner, lastAction, openInbox } from "@src/store";
import { replaceUrlsWithText, summarizeUrl } from "@src/utils/patterns";
-import { getHistoryUptoGoal, jumpToLowestChanges } from "@src/helpers/GoalProcessor";
+import { darkModeState, displayPartnerMode, lastAction, openInbox } from "@src/store";
import { displayGoalId, displayUpdateGoal, goalsHistory, displayChangesModal } from "@src/store/GoalsState";
+import useGoalStore from "@src/hooks/useGoalStore";
-import { useTranslation } from "react-i18next";
+import GoalAvatar from "./GoalAvatar";
interface MyGoalProps {
goal: GoalItem;
@@ -63,10 +60,10 @@ const GoalSent = ({ goal }: { goal: GoalItem }) => {
{goal.beforeTime && goal.afterTime
? `${t("between")} ${goal.afterTime}-${goal.beforeTime}`
: goal.beforeTime
- ? `${t("before")} ${goal.beforeTime}`
- : goal.afterTime
- ? `${t("after")} ${goal.afterTime}`
- : ""}
+ ? `${t("before")} ${goal.beforeTime}`
+ : goal.afterTime
+ ? `${t("after")} ${goal.afterTime}`
+ : ""}
{showStart && !!goal.start && (
@@ -85,17 +82,17 @@ const MyGoal: React.FC = ({ goal, showActions, setShowActions }) =>
// const sharedWithContact = goal.shared.contacts.length > 0 ? goal.shared.contacts[0].name : null;
// const collabWithContact =
// goal.collaboration.collaborators.length > 0 ? goal.collaboration.collaborators[0].name : null;
-
+ const participantsSvg = getSvgForGoalPps(goal.participants.length);
const navigate = useNavigate();
const location = useLocation();
- const { handleDisplayChanges, handleUpdateGoal } = useGoalStore();
+ const { handleUpdateGoal } = useGoalStore();
const darkModeStatus = useRecoilValue(darkModeState);
const showUpdateGoal = useRecoilValue(displayUpdateGoal);
const [selectedGoalId, setSelectedGoalId] = useRecoilState(displayGoalId);
const [showChangesModal, setShowChangesModal] = useRecoilState(displayChangesModal);
const [subGoalHistory, setSubGoalHistory] = useRecoilState(goalsHistory);
const isInboxOpen = useRecoilValue(openInbox);
- const showPartner = useRecoilValue(displayPartner);
+ const showPartnerMode = useRecoilValue(displayPartnerMode);
const setLastAction = useSetRecoilState(lastAction);
const { urlsWithIndexes, replacedString } = replaceUrlsWithText(goal.title);
@@ -165,7 +162,7 @@ const MyGoal: React.FC = ({ goal, showActions, setShowActions }) =>
}, [location]);
const isActionVisible = () => {
- return !archived && !isInboxOpen && !showPartner && showActions.open === goal.id && showActions.click > 0;
+ return !archived && !isInboxOpen && !showPartnerMode && showActions.open === goal.id && showActions.click > 0;
};
return (
@@ -271,29 +268,7 @@ const MyGoal: React.FC = ({ goal, showActions, setShowActions }) =>
)}
- {goal.participants.length > 0 && (
-
-
- {goal.participants[0].type === "collaborator" && (
-
- )}
-
-
-
- )}
+ {goal.participants.length > 0 && }
{archived && (