Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed all markdown issues #614

Merged
merged 13 commits into from
Dec 22, 2024
1 change: 1 addition & 0 deletions packages/react/src/views/ChatHeader/ChatHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ const ChatHeader = ({
</Box>
{isThreadOpen && (
<DynamicHeader
Markdown
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smritidoneria
Why is Markdown written here ? Looks invalid

title={threadTitle}
handleClose={closeThread}
iconName="arrow-back"
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/views/ChatInput/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import useShowCommands from '../../hooks/useShowCommands';
import useSearchMentionUser from '../../hooks/useSearchMentionUser';
import formatSelection from '../../lib/formatSelection';
import { parseEmoji } from '../../lib/emoji';
import { Markdown } from '../Markdown';

const ChatInput = ({ scrollToBottom }) => {
const { styleOverrides, classNames } = useComponentOverrides('ChatInput');
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/views/Message/MessageToolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
useTheme,
} from '@embeddedchat/ui-elements';
import { EmojiPicker } from '../EmojiPicker';
import { parseEmoji } from '../../lib/emoji';
import { getMessageToolboxStyles } from './Message.styles';
import SurfaceMenu from '../SurfaceMenu/SurfaceMenu';
import { Markdown } from '../Markdown';

export const MessageToolbox = ({
className = '',
Expand Down Expand Up @@ -243,7 +243,7 @@ export const MessageToolbox = ({
padding: '0 0.5rem 0.5rem',
}}
>
{parseEmoji(message.msg)}
<Markdown body={message} isReaction={false} />
</Modal.Content>
<Modal.Footer>
<Button type="secondary" onClick={handleOnClose}>
Expand Down
17 changes: 9 additions & 8 deletions packages/react/src/views/QuoteMessage/QuoteMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import RCContext from '../../context/RCInstance';
import { useMessageStore } from '../../store';
import getQuoteMessageStyles from './QuoteMessage.styles';
import Attachment from '../AttachmentHandler/Attachment';
import { Markdown } from '../Markdown';

const QuoteMessage = ({ className = '', style = {}, message }) => {
const { RCInstance } = useContext(RCContext);
Expand Down Expand Up @@ -83,19 +84,19 @@ const QuoteMessage = ({ className = '', style = {}, message }) => {
</audio>
) : (
<Box css={styles.message}>
{message.msg
? message.msg
: `${message.file?.name} (${
message.file?.size
? (message.file.size / 1024).toFixed(2)
: 0
} kB)`}
{message.msg ? (
<Markdown body={message} isReaction={false} />
) : (
`${message.file?.name} (${
message.file?.size ? (message.file.size / 1024).toFixed(2) : 0
} kB)`
)}
</Box>
)
) : message?.msg[0] === '[' ? (
message?.msg.match(/\n(.*)/)[1]
) : (
message?.msg
<Markdown body={message} isReaction={false} />
)}
{message.attachments &&
message.attachments.length > 0 &&
Expand Down
Loading