diff --git a/packages/component/src/Activity/CarouselFilmStrip.js b/packages/component/src/Activity/CarouselFilmStrip.js index e5df8332c6..5d42e5a1cd 100644 --- a/packages/component/src/Activity/CarouselFilmStrip.js +++ b/packages/component/src/Activity/CarouselFilmStrip.js @@ -91,11 +91,12 @@ const connectCarouselFilmStrip = (...selectors) => { ); }; -const useCarouselFilmStrip = ({ fromUser }) => { +const useCarouselFilmStrip = ({ activity }) => { + const { from: { role } = {} } = activity || {}; const { botAvatarInitials, userAvatarInitials } = useStyleOptions(); return { - avatarInitials: fromUser ? userAvatarInitials : botAvatarInitials + avatarInitials: role === 'user' ? userAvatarInitials : botAvatarInitials }; }; @@ -116,12 +117,13 @@ const WebChatCarouselFilmStrip = ({ } = activity; const fromUser = role === 'user'; - const avatarInitials = useCarouselFilmStrip({ fromUser }); + const { avatarInitials } = useCarouselFilmStrip({ activity }); + const styleOptions = useStyleOptions(); const styleSet = useStyleSet(); const roleLabel = useLocalize(fromUser ? 'UserSent' : 'BotSent'); const activityDisplayText = messageBackDisplayText || text; - const indented = fromUser ? styleSet.options.bubbleFromUserNubSize : styleSet.options.bubbleNubSize; + const indented = fromUser ? styleOptions.bubbleFromUserNubSize : styleOptions.bubbleNubSize; return (
{ }; const Speak = ({ activity }) => { - const { markAsSpoken, selectVoice } = useSpeakActivity(); + const { markAsSpoken, selectVoice } = useSpeakActivity({ activity }); const styleSet = useStyleSet(); if (!activity) { diff --git a/packages/component/src/Composer.js b/packages/component/src/Composer.js index 5ef2d8799a..c771cdbf00 100644 --- a/packages/component/src/Composer.js +++ b/packages/component/src/Composer.js @@ -131,10 +131,7 @@ function patchPropsForAvatarInitials({ botAvatarInitials, userAvatarInitials, .. ); } - return { - ...props, - styleOptions - }; + return styleOptions; } const Composer = ({ diff --git a/packages/component/src/hooks/useSetDictateInterims.js b/packages/component/src/hooks/useSetDictateInterims.js index 365b9aaa00..7bb7a5ce28 100644 --- a/packages/component/src/hooks/useSetDictateInterims.js +++ b/packages/component/src/hooks/useSetDictateInterims.js @@ -2,5 +2,5 @@ import { useContext } from 'react'; import WebChatContext from '../Context'; export default function useSetDictateInterims() { - return useContext(WebChatContext).dictateInterims; + return useContext(WebChatContext).setDictateInterims; }