Skip to content

Commit

Permalink
Merge pull request #421 from Cognigy/bug/67960-teaser-message-logo
Browse files Browse the repository at this point in the history
Fixed teaser message not using configured logo
  • Loading branch information
dshire authored May 29, 2024
2 parents 556e852 + 7b1975e commit e62ebde
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/webchat-ui/components/presentational/TeaserMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { WebchatUIProps } from "../WebchatUI";
import { IWebchatConfig } from "../../../common/interfaces/webchat-config";
import { ISendMessageOptions } from "../../../webchat/store/messages/message-middleware";
import { useMediaQuery } from "react-responsive";
import { Logo } from "./Header";

const TeaserMessageRoot = styled.div(() => ({
position: "fixed",
Expand Down Expand Up @@ -62,6 +63,10 @@ const ButtonContainer = styled.div(() => ({
},
}));

const HeaderLogo = styled(Logo)(() => ({
marginInline: 0,
}));

interface ITeaserMessageProps {
messageText: string;
onClick: () => void;
Expand Down Expand Up @@ -114,7 +119,15 @@ export const TeaserMessage = (props: ITeaserMessageProps) => {
aria-live="polite"
>
<TeaserMessageHeader>
<CognigyAIAvatar />
{config?.settings?.layout?.logoUrl ? (
<HeaderLogo
src={config?.settings?.layout?.logoUrl}
className={"webchat-teaser-message-header-logo"}
alt="Chat logo"
/>
) : (
<CognigyAIAvatar alt="Chat logo" />
)}
<TeaserMessageHeaderContent>
<Typography
variant="title2-regular"
Expand Down

0 comments on commit e62ebde

Please sign in to comment.