sforkowany z mirror/soapbox
Do not include link to profile in ReplyMentionsModal
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>deduplicate
rodzic
bcf82e4312
commit
c792cc2549
|
@ -15,14 +15,17 @@ import type { Account as AccountEntity } from 'soapbox/types/entities';
|
||||||
|
|
||||||
interface IInstanceFavicon {
|
interface IInstanceFavicon {
|
||||||
account: AccountEntity,
|
account: AccountEntity,
|
||||||
|
disabled?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
const InstanceFavicon: React.FC<IInstanceFavicon> = ({ account }) => {
|
const InstanceFavicon: React.FC<IInstanceFavicon> = ({ account, disabled }) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const handleClick: React.MouseEventHandler = (e) => {
|
const handleClick: React.MouseEventHandler = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
|
if (disabled) return;
|
||||||
|
|
||||||
const timelineUrl = `/timeline/${account.domain}`;
|
const timelineUrl = `/timeline/${account.domain}`;
|
||||||
if (!(e.ctrlKey || e.metaKey)) {
|
if (!(e.ctrlKey || e.metaKey)) {
|
||||||
history.push(timelineUrl);
|
history.push(timelineUrl);
|
||||||
|
@ -32,7 +35,11 @@ const InstanceFavicon: React.FC<IInstanceFavicon> = ({ account }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button className='w-4 h-4 flex-none focus:ring-primary-500 focus:ring-2 focus:ring-offset-2' onClick={handleClick}>
|
<button
|
||||||
|
className='w-4 h-4 flex-none focus:ring-primary-500 focus:ring-2 focus:ring-offset-2'
|
||||||
|
onClick={handleClick}
|
||||||
|
disabled={disabled}
|
||||||
|
>
|
||||||
<img src={account.favicon} alt='' title={account.domain} className='w-full max-h-full' />
|
<img src={account.favicon} alt='' title={account.domain} className='w-full max-h-full' />
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
@ -219,7 +226,7 @@ const Account = ({
|
||||||
<Text theme='muted' size='sm' truncate>@{username}</Text>
|
<Text theme='muted' size='sm' truncate>@{username}</Text>
|
||||||
|
|
||||||
{account.favicon && (
|
{account.favicon && (
|
||||||
<InstanceFavicon account={account} />
|
<InstanceFavicon account={account} disabled={!withLinkToProfile} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{(timestamp) ? (
|
{(timestamp) ? (
|
||||||
|
|
|
@ -52,7 +52,7 @@ const Account: React.FC<IAccount> = ({ composeId, accountId, author }) => {
|
||||||
return (
|
return (
|
||||||
<HStack space={1} alignItems='center' justifyContent='between' className='p-2.5'>
|
<HStack space={1} alignItems='center' justifyContent='between' className='p-2.5'>
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<AccountComponent account={account} withRelationship={false} />
|
<AccountComponent account={account} withRelationship={false} withLinkToProfile={false} />
|
||||||
</div>
|
</div>
|
||||||
{!author && button}
|
{!author && button}
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
Ładowanie…
Reference in New Issue