File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
src/components/MessageList Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { v4 as uuidv4 } from 'uuid';
66
77import DefaultDateSeparator from './DateSeparator' ;
88import MessageNotification from './MessageNotification' ;
9- import MessageSystem from './MessageSystem' ;
9+ import DefaultMessageSystem from './MessageSystem' ;
1010import DefaultTypingIndicator from './TypingIndicator' ;
1111import TypingIndicatorContainer from './TypingIndicatorContainer' ;
1212
@@ -67,6 +67,7 @@ const MessageList = (props) => {
6767 disableWhileEditing = true ,
6868 HeaderComponent,
6969 Message : MessageFromProps ,
70+ MessageSystem = DefaultMessageSystem ,
7071 messageActions,
7172 noGroupByUser,
7273 onThreadSelect,
@@ -310,6 +311,11 @@ MessageList.propTypes = {
310311 * */
311312 Message : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . elementType ] ) ,
312313 messageActions : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . array ] ) ,
314+ /**
315+ * Custom UI component to display a system message
316+ * Default component (accepts the same props): [MessageSystem](https://getstream.github.io/stream-chat-react-native/#messagesystem)
317+ */
318+ MessageSystem : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . elementType ] ) ,
313319 /**
314320 * Boolean weather current message list is a thread.
315321 */
Original file line number Diff line number Diff line change 11import React , { useContext } from 'react' ;
22import styled from '@stream-io/styled-components' ;
3+ import PropTypes from 'prop-types' ;
34
45import { TranslationContext } from '../../context' ;
56
@@ -63,4 +64,9 @@ const MessageSystem = ({ message }) => {
6364 ) ;
6465} ;
6566
67+ MessageSystem . propTypes = {
68+ /** Current [message object](https://getstream.io/chat/docs/#message_format) */
69+ message : PropTypes . object . isRequired ,
70+ } ;
71+
6672export default MessageSystem ;
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ module.exports = {
6565 'src/components/MessageList/EventIndicator.js' ,
6666 'src/components/MessageList/MessageList.js' ,
6767 'src/components/MessageList/MessageNotification.js' ,
68+ 'src/components/MessageList/MessageSystem.js' ,
6869 'src/components/MessageList/TypingIndicator.js' ,
6970 ] ,
7071 exampleMode : 'collapse' ,
@@ -104,7 +105,7 @@ module.exports = {
104105 'src/components/MessageInput/UploadProgressIndicator.js' ,
105106 ] ,
106107 exampleMode : 'collapse' ,
107- name : 'Message Input ' ,
108+ name : 'MessageInput Components ' ,
108109 usageMode : 'expand' ,
109110 } ,
110111 {
@@ -193,7 +194,7 @@ module.exports = {
193194 } ,
194195 {
195196 exampleMode : 'collapse' ,
196- name : 'Custom UI component props ' ,
197+ name : 'Custom UI Component Props ' ,
197198 sections : [
198199 {
199200 content : 'src/components/docs/AttachmentProps.md' ,
You can’t perform that action at this time.
0 commit comments