-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Ordered and unordered list styles, Line breaks. (#25494)
* use new list component * Fix Message lists and line breaks * Remove unecessary check from plaintext * skip empty text * remove parser from server * Fix components order * disable playwright * update * Fix parser version and wrong import * Match versions * Move actual `dependencies` from `devDependencies` * revert playwright * revert * Remove a few components * change version to next Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * update fuselage Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
- Loading branch information
Showing
19 changed files
with
177 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1661,7 +1661,7 @@ | |
padding-bottom: 24px; | ||
} | ||
|
||
& ul { | ||
& ul.messages-list { | ||
padding: 21px 0 10px; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
apps/meteor/client/views/room/MessageList/components/EncryptedMessageRender.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/meteor/client/views/room/MessageList/components/MessageContentBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable complexity */ | ||
import { IMessage } from '@rocket.chat/core-typings'; | ||
import React, { FC, memo } from 'react'; | ||
|
||
import MessageBodyRender from '../../../../components/Message/MessageBodyRender'; | ||
import { useMessageActions } from '../../contexts/MessageContext'; | ||
import { useParsedMessage } from '../hooks/useParsedMessage'; | ||
|
||
const MessageContentBody: FC<{ message: IMessage; isThreadPreview?: boolean }> = ({ message, isThreadPreview }) => { | ||
const { | ||
actions: { openRoom, openUserCard }, | ||
} = useMessageActions(); | ||
|
||
const tokens = useParsedMessage(message); | ||
|
||
return ( | ||
<MessageBodyRender | ||
onUserMentionClick={openUserCard} | ||
onChannelMentionClick={openRoom} | ||
mentions={message?.mentions || []} | ||
channels={message?.channels || []} | ||
tokens={tokens} | ||
isThreadPreview={isThreadPreview} | ||
/> | ||
); | ||
}; | ||
|
||
export default memo(MessageContentBody); |
37 changes: 0 additions & 37 deletions
37
apps/meteor/client/views/room/MessageList/components/MessageRender.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/meteor/client/views/room/MessageList/hooks/useParsedMessage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { IMessage } from '@rocket.chat/core-typings'; | ||
import { MarkdownAST, parser } from '@rocket.chat/message-parser'; | ||
import { useMemo } from 'react'; | ||
|
||
export function useParsedMessage(message: IMessage): MarkdownAST { | ||
return useMemo(() => { | ||
if (message.md) { | ||
return message.md; | ||
} | ||
if (!message.msg) { | ||
return []; | ||
} | ||
return parser(message.msg); | ||
}, [message]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.