[Glitch] Fix: Embed author handle using wrong DisplayName
Port 258869278e8f42ff7c1795eb024c7c2ed6cfebca to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
48bb64cde3
commit
3c3a812a9c
@ -1,23 +0,0 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { Avatar } from 'flavours/glitch/components/avatar';
|
||||
import { useAppSelector } from 'flavours/glitch/store';
|
||||
import { LinkedDisplayName } from '../../../components/display_name';
|
||||
|
||||
export const AuthorLink = ({ accountId }) => {
|
||||
const account = useAppSelector(state => state.getIn(['accounts', accountId]));
|
||||
|
||||
if (!account) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<LinkedDisplayName displayProps={{account}} className='story__details__shared__author-link'>
|
||||
<Avatar account={account} size={16} />
|
||||
</LinkedDisplayName>
|
||||
);
|
||||
};
|
||||
|
||||
AuthorLink.propTypes = {
|
||||
accountId: PropTypes.string.isRequired,
|
||||
};
|
||||
@ -0,0 +1,22 @@
|
||||
import type { FC } from 'react';
|
||||
|
||||
import { LinkedDisplayName } from '@/flavours/glitch/components/display_name';
|
||||
import { Avatar } from 'flavours/glitch/components/avatar';
|
||||
import { useAppSelector } from 'flavours/glitch/store';
|
||||
|
||||
export const AuthorLink: FC<{ accountId: string }> = ({ accountId }) => {
|
||||
const account = useAppSelector((state) => state.accounts.get(accountId));
|
||||
|
||||
if (!account) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<LinkedDisplayName
|
||||
displayProps={{ account, variant: 'simple' }}
|
||||
className='story__details__shared__author-link'
|
||||
>
|
||||
<Avatar account={account} size={16} />
|
||||
</LinkedDisplayName>
|
||||
);
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user