Add link to profile in Chat header

This commit is contained in:
Chewbacca 2022-11-07 11:47:18 -05:00
parent 57b2629337
commit 1ae9775e07

View file

@ -1,6 +1,6 @@
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import { useHistory, useParams } from 'react-router-dom'; import { Link, useHistory, useParams } from 'react-router-dom';
import { blockAccount, unblockAccount } from 'soapbox/actions/accounts'; import { blockAccount, unblockAccount } from 'soapbox/actions/accounts';
import { openModal } from 'soapbox/actions/modals'; import { openModal } from 'soapbox/actions/modals';
@ -113,13 +113,19 @@ const ChatPageMain = () => {
onClick={() => history.push('/chats')} onClick={() => history.push('/chats')}
/> />
<Avatar src={chat.account?.avatar} size={40} className='flex-none' /> <Link to={`/@${chat.account.acct}`}>
<Avatar src={chat.account.avatar} size={40} className='flex-none' />
</Link>
</HStack> </HStack>
<Stack alignItems='start' className='overflow-hidden h-11'> <Stack alignItems='start' className='overflow-hidden h-11'>
<div className='flex items-center space-x-1 flex-grow w-full'> <div className='flex items-center space-x-1 flex-grow w-full'>
<Text weight='bold' size='sm' align='left' truncate>{chat.account?.display_name || `@${chat.account.username}`}</Text> <Link to={`/@${chat.account.acct}`}>
{chat.account?.verified && <VerificationBadge />} <Text weight='bold' size='sm' align='left' truncate>
{chat.account.display_name || `@${chat.account.username}`}
</Text>
</Link>
{chat.account.verified && <VerificationBadge />}
</div> </div>
{chat.message_expiration && ( {chat.message_expiration && (