Skip to content

Commit

Permalink
Fix member handle issue from forum (#4483)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmaster54 authored Jul 28, 2023
1 parent 9f9514b commit 560b3b6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions packages/ui/src/common/components/Mention/Mention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
GetForumThreadMentionQuery,
} from '@/forum/queries'
import { asForumPostMention, asForumThreadMention, ForumPostMention, ForumThreadMention } from '@/forum/types'
import { useShowMemberModal } from '@/memberships/hooks/useShowMemberModal'
import { GetMemberMentionDocument, GetMemberMentionQuery } from '@/memberships/queries'
import { asMember, Member } from '@/memberships/types'
import { ProposalsRoutes } from '@/proposals/constants/routes'
Expand Down Expand Up @@ -79,7 +80,7 @@ type TState =
export const Mention = ({ children, type, itemId }: MentionProps) => {
const client = useApolloClient()
const [data, setData] = useState<TState>()

const showMemberModal = useShowMemberModal((data as Member)?.id)
const query = useCallback(
(query: DocumentNode) => async (id: string) =>
await client.query({
Expand Down Expand Up @@ -246,11 +247,19 @@ export const Mention = ({ children, type, itemId }: MentionProps) => {
<Container id="mention-container">
{Icon}
<Tooltip popupContent={Content} forBig>
<a href={'#' + UrlAddress}>
<TextMedium as="span" black bold underline>
{children}
</TextMedium>
</a>
{type === 'member' ? (
<a onClick={showMemberModal}>
<TextMedium as="span" black bold underline>
{children}
</TextMedium>
</a>
) : (
<a href={'#' + UrlAddress}>
<TextMedium as="span" black bold underline>
{children}
</TextMedium>
</a>
)}
</Tooltip>
</Container>
)
Expand Down

2 comments on commit 560b3b6

@vercel
Copy link

@vercel vercel bot commented on 560b3b6 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 560b3b6 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2-git-dev-joystream.vercel.app
pioneer-2.vercel.app
pioneer-2-joystream.vercel.app

Please sign in to comment.