Emojify note and add non-nickname tooltip

This commit is contained in:
Jamie Kyle 2024-04-03 15:41:13 -07:00 committed by GitHub
parent 4d794eaf14
commit b6afa47126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 47 additions and 10 deletions

View file

@ -7,6 +7,8 @@ import type { LocalizerType } from '../types/I18N';
import { Button, ButtonVariant } from './Button';
import { Modal } from './Modal';
import { Linkify } from './conversation/Linkify';
import type { RenderTextCallbackType } from '../types/Util';
import { Emojify } from './conversation/Emojify';
export type NotePreviewModalProps = Readonly<{
conversation: ConversationType;
@ -15,6 +17,10 @@ export type NotePreviewModalProps = Readonly<{
onEdit: () => void;
}>;
const renderNonLink: RenderTextCallbackType = ({ key, text }) => {
return <Emojify key={key} text={text} />;
};
export function NotePreviewModal({
conversation,
i18n,
@ -40,7 +46,7 @@ export function NotePreviewModal({
}
>
<div dir="auto">
<Linkify text={conversation.note ?? ''} />
<Linkify text={conversation.note ?? ''} renderNonLink={renderNonLink} />
</div>
</Modal>
);