diff --git a/src/pages/common/components/FeedItem/context.ts b/src/pages/common/components/FeedItem/context.ts index 67cf765193..f7f7c2f35d 100644 --- a/src/pages/common/components/FeedItem/context.ts +++ b/src/pages/common/components/FeedItem/context.ts @@ -42,6 +42,7 @@ export interface FeedItemBaseContentProps { hasImages?: boolean; isLoading?: boolean; shouldHideBottomContent?: boolean; + dmUserId?: string; } export interface GetLastMessageOptions { diff --git a/src/pages/commonFeed/components/FeedLayout/FeedLayout.tsx b/src/pages/commonFeed/components/FeedLayout/FeedLayout.tsx index 1ad096f4b4..93441ebc08 100644 --- a/src/pages/commonFeed/components/FeedLayout/FeedLayout.tsx +++ b/src/pages/commonFeed/components/FeedLayout/FeedLayout.tsx @@ -63,7 +63,6 @@ import { import { InfiniteScroll, TextEditorValue } from "@/shared/ui-kit"; import { addQueryParam, - checkIsProject, deleteQueryParam, getParamsFromOneOfRoutes, getUserName, diff --git a/src/pages/inbox/components/ChatChannelItem/ChatChannelItem.tsx b/src/pages/inbox/components/ChatChannelItem/ChatChannelItem.tsx index 86b964072f..9d9880c345 100644 --- a/src/pages/inbox/components/ChatChannelItem/ChatChannelItem.tsx +++ b/src/pages/inbox/components/ChatChannelItem/ChatChannelItem.tsx @@ -129,6 +129,7 @@ export const ChatChannelItem: FC = (props) => { ownerId={userId} renderImage={renderImage} isImageRounded + dmUserId={dmUserId} /> ); }; diff --git a/src/pages/inbox/components/FeedItemBaseContent/FeedItemBaseContent.tsx b/src/pages/inbox/components/FeedItemBaseContent/FeedItemBaseContent.tsx index 04238c3472..438a80d52f 100644 --- a/src/pages/inbox/components/FeedItemBaseContent/FeedItemBaseContent.tsx +++ b/src/pages/inbox/components/FeedItemBaseContent/FeedItemBaseContent.tsx @@ -1,7 +1,11 @@ import React, { FC, MouseEventHandler, useRef, useState } from "react"; import classNames from "classnames"; import { useLongPress } from "use-long-press"; -import { FeedCardTags, FeedItemBaseContentProps } from "@/pages/common"; +import { + FeedCardTags, + FeedItemBaseContentProps, + useFeedItemContext, +} from "@/pages/common"; import { PredefinedTypes } from "@/shared/models"; import { ContextMenu, @@ -36,10 +40,12 @@ export const FeedItemBaseContent: FC = (props) => { isImageRounded, isProject, discussionPredefinedType, + dmUserId, } = props; const contextMenuRef = useRef(null); const [isLongPressing, setIsLongPressing] = useState(false); const [isLongPressed, setIsLongPressed] = useState(false); + const { onUserSelect } = useFeedItemContext(); const isContextMenuEnabled = Boolean(menuItems && menuItems.length > 0); const finalTitle = discussionPredefinedType === PredefinedTypes.General && commonName @@ -97,6 +103,12 @@ export const FeedItemBaseContent: FC = (props) => { } }; + const handleAvatarClick = () => { + if (onUserSelect && dmUserId) { + onUserSelect(dmUserId); + } + }; + return (
= (props) => { onContextMenu={handleContextMenu} {...getLongPressProps()} > - {renderImage?.(imageClassName) || ( - - )} +
+ {renderImage?.(imageClassName) || ( + + )} +