0
0
Fork 0

Add hover cards in web UI (#30754)

Co-authored-by: Renaud Chaput <renchap@gmail.com>
This commit is contained in:
Eugen Rochko 2024-06-26 21:33:38 +02:00 committed by GitHub
parent 863c470a2b
commit e89317d4c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 631 additions and 42 deletions

View file

@ -0,0 +1,20 @@
import { useLinks } from 'mastodon/../hooks/useLinks';
export const AccountBio: React.FC<{
note: string;
className: string;
}> = ({ note, className }) => {
const handleClick = useLinks();
if (note.length === 0 || note === '<p></p>') {
return null;
}
return (
<div
className={`${className} translate`}
dangerouslySetInnerHTML={{ __html: note }}
onClickCapture={handleClick}
/>
);
};