Skip to content

Commit 331867f

Browse files
committed
add permissions prop to MessageList
1 parent 60af10b commit 331867f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/MessageList/MessageList.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import MessageNotification from './MessageNotification';
77
import CustomNotification from './CustomNotification';
88
import ConnectionStatus from './ConnectionStatus';
99
import MessageListInner from './MessageListInner';
10-
import { MESSAGE_ACTIONS } from '../Message/utils';
10+
import { defaultPinPermissions, MESSAGE_ACTIONS } from '../Message/utils';
1111
import { checkChannelPropType, smartRender } from '../../utils';
1212

1313
import { ChannelContext, withTranslationContext } from '../../context';
@@ -283,6 +283,7 @@ class MessageList extends PureComponent {
283283
.getMuteUserSuccessNotification,
284284
getMuteUserErrorNotification: this.props
285285
.getMuteUserErrorNotification,
286+
pinPermissions: this.props.pinPermissions,
286287
}}
287288
/>
288289
</div>
@@ -436,6 +437,10 @@ MessageList.propTypes = {
436437
* Available props - https://getstream.github.io/stream-chat-react/#messageinput
437438
* */
438439
additionalMessageInputProps: PropTypes.object,
440+
/**
441+
* The user roles allowed to pin messages in various channel types
442+
*/
443+
pinPermissions: /** @type {PropTypes.Validator<import('types').PinPermissions>>} */ (PropTypes.object),
439444
};
440445

441446
MessageList.defaultProps = {
@@ -451,6 +456,7 @@ MessageList.defaultProps = {
451456
unsafeHTML: false,
452457
noGroupByUser: false,
453458
messageActions: Object.keys(MESSAGE_ACTIONS),
459+
pinPermissions: defaultPinPermissions,
454460
};
455461

456462
export default withTranslationContext((props) => (

0 commit comments

Comments
 (0)