File tree Expand file tree Collapse file tree
src/components/MessageInput Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import type { ComponentType } from 'react' ;
1+ import { type ComponentType , useMemo } from 'react' ;
22import React from 'react' ;
33import {
44 isLocalAttachment ,
88 isLocalVideoAttachment ,
99 isLocalVoiceRecordingAttachment ,
1010 isScrapedContent ,
11+ isVoiceRecordingAttachment ,
1112} from 'stream-chat' ;
1213import {
1314 UnsupportedAttachmentPreview as DefaultUnknownAttachmentPreview ,
@@ -53,15 +54,15 @@ export const AttachmentPreviewList = ({
5354
5455 // todo: we could also allow to attach poll to a message composition
5556 const { attachments, location } = useAttachmentsForPreview ( ) ;
57+ const filteredAttachments = useMemo (
58+ ( ) => attachments . filter ( ( a ) => ! isVoiceRecordingAttachment ( a ) ) ,
59+ [ attachments ] ,
60+ ) ;
5661
57- if ( ! attachments . length && ! location ) return null ;
62+ if ( ! filteredAttachments . length && ! location ) return null ;
5863
5964 return (
6065 < div className = 'str-chat__attachment-preview-list' >
61- { /*<div*/ }
62- { /* className='str-chat__attachment-list-scroll-container'*/ }
63- { /* data-testid='attachment-list-scroll-container'*/ }
64- { /*>*/ }
6566 { location && (
6667 < GeolocationPreview
6768 location = { location }
@@ -126,7 +127,6 @@ export const AttachmentPreviewList = ({
126127 }
127128 return null ;
128129 } ) }
129- { /*</div>*/ }
130130 </ div >
131131 ) ;
132132} ;
Original file line number Diff line number Diff line change @@ -253,12 +253,14 @@ export const QuotedMessagePreview = ({
253253 ) ;
254254
255255 return quotedMessage ? (
256- < QuotedMessagePreviewUI
257- getQuotedMessageAuthor = { getQuotedMessageAuthor }
258- onRemove = { ( ) => messageComposer . setQuotedMessage ( null ) }
259- quotedMessage = { quotedMessage }
260- renderText = { renderText }
261- />
256+ < div className = 'str-chat__message-composer__quoted-message-preview-slot' >
257+ < QuotedMessagePreviewUI
258+ getQuotedMessageAuthor = { getQuotedMessageAuthor }
259+ onRemove = { ( ) => messageComposer . setQuotedMessage ( null ) }
260+ quotedMessage = { quotedMessage }
261+ renderText = { renderText }
262+ />
263+ </ div >
262264 ) : null ;
263265} ;
264266
Original file line number Diff line number Diff line change 6363 flex-direction : column ;
6464 width : 100% ;
6565 min-width : 0 ;
66- padding-inline : var (--spacing-xs );
67- padding-block : var (--spacing-sm );
6866 @include utils .component-layer-overrides (' message-input' );
6967 }
7068
7169 .str-chat__message-composer-previews {
7270 display : flex ;
7371 flex-direction : column ;
7472 width : 100% ;
75- padding-bottom : var (--spacing-xs );
73+ padding : var (--spacing-xs ) var ( --spacing-xs ) 0 ;
7674 gap : var (--spacing-xxs );
7775
7876 min-width : 0 ;
8381 align-items : end ;
8482 width : 100% ;
8583 gap : var (--spacing-xs );
84+ padding : var (--spacing-sm );
8685
8786 $controls-containers-min-height : 26px ;
8887
Original file line number Diff line number Diff line change 11@use ' ../../../styling/utils' ;
22
33.str-chat {
4+ .str-chat__message-composer__quoted-message-preview-slot {
5+ padding : var (--spacing-xxs );
6+ }
7+
48 .str-chat__quoted-message-preview {
59 display : flex ;
610 align-items : center ;
You can’t perform that action at this time.
0 commit comments