mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-14 20:11:22 +00:00
Add TextStyle and refactor
This commit is contained in:
parent
d24e2ac3bc
commit
656cbbde0e
@ -466,13 +466,13 @@ export const ChatList = ({
|
|||||||
|
|
||||||
{enableMentions && (hasSecretKey || isPrivate === false) && (
|
{enableMentions && (hasSecretKey || isPrivate === false) && (
|
||||||
<ChatOptions
|
<ChatOptions
|
||||||
openQManager={openQManager}
|
|
||||||
messages={messages}
|
|
||||||
goToMessage={goToMessage}
|
goToMessage={goToMessage}
|
||||||
members={members}
|
|
||||||
myName={myName}
|
|
||||||
selectedGroup={selectedGroup}
|
|
||||||
isPrivate={isPrivate}
|
isPrivate={isPrivate}
|
||||||
|
members={members}
|
||||||
|
messages={messages}
|
||||||
|
myName={myName}
|
||||||
|
openQManager={openQManager}
|
||||||
|
selectedGroup={selectedGroup}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -25,7 +25,6 @@ import {
|
|||||||
AppsSearchRight,
|
AppsSearchRight,
|
||||||
} from '../Apps/Apps-styles';
|
} from '../Apps/Apps-styles';
|
||||||
import IconClearInput from '../../assets/svgs/ClearInput.svg';
|
import IconClearInput from '../../assets/svgs/ClearInput.svg';
|
||||||
import { CellMeasurerCache } from 'react-virtualized';
|
|
||||||
import { getBaseApiReact } from '../../App';
|
import { getBaseApiReact } from '../../App';
|
||||||
import { MessageDisplay } from './MessageDisplay';
|
import { MessageDisplay } from './MessageDisplay';
|
||||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||||
@ -36,6 +35,7 @@ import { generateHTML } from '@tiptap/react';
|
|||||||
import ErrorBoundary from '../../common/ErrorBoundary';
|
import ErrorBoundary from '../../common/ErrorBoundary';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { isHtmlString } from '../../utils/chat';
|
import { isHtmlString } from '../../utils/chat';
|
||||||
|
import TextStyle from '@tiptap/extension-text-style';
|
||||||
|
|
||||||
const extractTextFromHTML = (htmlString = '') => {
|
const extractTextFromHTML = (htmlString = '') => {
|
||||||
return convert(htmlString, {
|
return convert(htmlString, {
|
||||||
@ -43,11 +43,6 @@ const extractTextFromHTML = (htmlString = '') => {
|
|||||||
})?.toLowerCase();
|
})?.toLowerCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
const cache = new CellMeasurerCache({
|
|
||||||
fixedWidth: true,
|
|
||||||
defaultHeight: 50,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const ChatOptions = ({
|
export const ChatOptions = ({
|
||||||
messages: untransformedMessages,
|
messages: untransformedMessages,
|
||||||
goToMessage,
|
goToMessage,
|
||||||
@ -86,6 +81,7 @@ export const ChatOptions = ({
|
|||||||
Underline,
|
Underline,
|
||||||
Highlight,
|
Highlight,
|
||||||
Mention,
|
Mention,
|
||||||
|
TextStyle,
|
||||||
]);
|
]);
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
|
@ -361,8 +361,8 @@ const MenuBar = memo(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const extensions = [
|
const extensions = [
|
||||||
|
TextStyle,
|
||||||
Color.configure({ types: [TextStyle.name, ListItem.name] }),
|
Color.configure({ types: [TextStyle.name, ListItem.name] }),
|
||||||
TextStyle.configure({ types: [ListItem.name] }),
|
|
||||||
StarterKit.configure({
|
StarterKit.configure({
|
||||||
bulletList: {
|
bulletList: {
|
||||||
keepMarks: true,
|
keepMarks: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user