[FIX] Default Attachments - Show Full Attachment.Text with Markdown (#20606)

Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
pull/20799/head
Aditya Mitra 5 years ago committed by GitHub
parent 1e440a3985
commit f467f65db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      client/components/Message/Attachments/Attachment.tsx
  2. 2
      client/components/Message/Attachments/DefaultAttachment.tsx

@ -20,7 +20,7 @@ export type AttachmentPropsBase = {
const Row: FC<BoxProps> = (props) => <Box mi='neg-x2' mbe='x2' rcx-message-attachment display='flex' alignItems='center' {...props}/>;
const Title: FC<BoxProps> = (props) => <Box withTruncatedText mi='x2' fontScale='c1' color='hint' {...props}></Box>;
const Text: FC<BoxProps> = (props) => <Box withTruncatedText mbe='x4' mi='x2' fontScale='p1' color='default' {...props}></Box>;
const Text: FC<BoxProps> = (props) => <Box mbe='x4' mi='x2' fontScale='p1' color='default' {...props}></Box>;
const Size: FC<BoxProps & { size: number }> = ({ size, ...props }) => {
const format = useFormatMemorySize();

@ -42,7 +42,7 @@ export type DefaultAttachmentProps = {
const isActionAttachment = (attachment: AttachmentProps): attachment is ActionAttachmentProps => 'actions' in attachment;
const applyMarkdownIfRequires = (list: DefaultAttachmentProps['mrkdwn_in']) => (key: MarkdownFields, text: string): JSX.Element | string => (list?.includes(key) ? <MarkdownText withRichContent={undefined} content={text}/> : text);
const applyMarkdownIfRequires = (list: DefaultAttachmentProps['mrkdwn_in'] = ['text', 'pretext']) => (key: MarkdownFields, text: string): JSX.Element | string => (list?.includes(key) ? <MarkdownText withRichContent={undefined} content={text}/> : text);
export const DefaultAttachment: FC<DefaultAttachmentProps> = (attachment) => {
const applyMardownFor = applyMarkdownIfRequires(attachment.mrkdwn_in);

Loading…
Cancel
Save