Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Aug 28, 2019
1 parent ef14617 commit a5ac145
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
10 changes: 6 additions & 4 deletions packages/component/src/Activity/CarouselFilmStrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
};

Expand All @@ -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 (
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/Activity/Speak.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const useSpeakActivity = ({ activity }) => {
};

const Speak = ({ activity }) => {
const { markAsSpoken, selectVoice } = useSpeakActivity();
const { markAsSpoken, selectVoice } = useSpeakActivity({ activity });
const styleSet = useStyleSet();

if (!activity) {
Expand Down
5 changes: 1 addition & 4 deletions packages/component/src/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,7 @@ function patchPropsForAvatarInitials({ botAvatarInitials, userAvatarInitials, ..
);
}

return {
...props,
styleOptions
};
return styleOptions;
}

const Composer = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/hooks/useSetDictateInterims.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { useContext } from 'react';
import WebChatContext from '../Context';

export default function useSetDictateInterims() {
return useContext(WebChatContext).dictateInterims;
return useContext(WebChatContext).setDictateInterims;
}

0 comments on commit a5ac145

Please sign in to comment.