Emoji: Account page (#36385)

This commit is contained in:
Echo 2025-10-08 13:11:25 +02:00 committed by GitHub
commit 6abda76d13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 195 additions and 137 deletions

View file

@ -7,6 +7,8 @@ import { isFulfilled, isRejected } from '@reduxjs/toolkit';
import { openURL } from 'mastodon/actions/search';
import { useAppDispatch } from 'mastodon/store';
import { isModernEmojiEnabled } from '../utils/environment';
const isMentionClick = (element: HTMLAnchorElement) =>
element.classList.contains('mention') &&
!element.classList.contains('hashtag');
@ -53,6 +55,11 @@ export const useLinks = (skipHashtags?: boolean) => {
const handleClick = useCallback(
(e: React.MouseEvent) => {
// Exit early if modern emoji is enabled, as this is handled by HandledLink.
if (isModernEmojiEnabled()) {
return;
}
const target = (e.target as HTMLElement).closest('a');
if (!target || e.button !== 0 || e.ctrlKey || e.metaKey) {