@@ -3,6 +3,7 @@ import React, { useContext } from 'react';
33import { useUserRole , useOpenThreadHandler } from './hooks' ;
44import { ChannelContext } from '../../context' ;
55import { MessageActions } from '../MessageActions' ;
6+ import { MESSAGE_ACTIONS } from './utils' ;
67import { ThreadIcon , ReactionIcon } from './icons' ;
78
89/**
@@ -28,9 +29,19 @@ const MessageOptionsComponent = (props) => {
2829 */
2930 const { channel } = useContext ( ChannelContext ) ;
3031 const channelConfig = channel ?. getConfig ( ) ;
32+ const messageActions = props . getMessageActions ( ) ;
33+ const shouldShowReactions =
34+ messageActions . indexOf ( MESSAGE_ACTIONS . react ) > - 1 &&
35+ channelConfig &&
36+ channelConfig . reactions ;
3137 const shouldShowReplies =
32- displayReplies && ! threadList && channelConfig && channelConfig . replies ;
33- const shouldShowReactions = channelConfig && channelConfig . reactions ;
38+ messageActions . indexOf ( MESSAGE_ACTIONS . reply ) > - 1 &&
39+ displayReplies &&
40+ ! threadList &&
41+ channelConfig &&
42+ channelConfig . replies ;
43+
44+ console . log ( messageActions ) ;
3445 if (
3546 ! message ||
3647 message . type === 'error' ||
@@ -53,7 +64,7 @@ const MessageOptionsComponent = (props) => {
5364 < div
5465 data-testid = "thread-action"
5566 onClick = { propHandleOpenThread || handleOpenThread }
56- className = { `str-chat__message-${ theme } str-chat__message-${ theme } __actions__action--thread` }
67+ className = { `str-chat__message-${ theme } __actions__action str-chat__message-${ theme } __actions__action--thread` }
5768 >
5869 < ThreadIcon />
5970 </ div >
0 commit comments