MentionNode: truncate Nostr usernames
This commit is contained in:
parent
f6d60c243a
commit
622692fe4d
|
@ -9,6 +9,7 @@ import { $applyNodeReplacement, DecoratorNode } from 'lexical';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { Tooltip } from 'soapbox/components/ui';
|
import { Tooltip } from 'soapbox/components/ui';
|
||||||
|
import { isPubkey } from 'soapbox/utils/nostr';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
EditorConfig,
|
EditorConfig,
|
||||||
|
@ -87,7 +88,7 @@ class MentionNode extends DecoratorNode<JSX.Element> {
|
||||||
type='button'
|
type='button'
|
||||||
dir='ltr'
|
dir='ltr'
|
||||||
>
|
>
|
||||||
@{username}
|
@{isPubkey(username) ? username.slice(0, 8) : username}
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue