Skip to content

Commit

Permalink
Improve failure message styling
Browse files Browse the repository at this point in the history
  • Loading branch information
peterszerzo committed Jan 2, 2024
1 parent 5175eb1 commit 9fd3168
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/chat-widget/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const MessageGroups: FC<{
return (
<C.FailureMessage key={responseIndex}>
<ErrorOutlineIcon />
<span>{response.payload.text}</span>
{response.payload.text}
</C.FailureMessage>
);
}
Expand Down
18 changes: 8 additions & 10 deletions packages/chat-widget/src/ui/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,18 @@ export const Message = styled.div<{ type: "user" | "bot" }>`
`;

export const FailureMessage = styled.p<{}>`
display: flex;
align-items: center;
justify-content: flex-start;
text-align: center;
flex-wrap: wrap;
font-size: ${constants.smallFontSize}px;
border-radius: ${(props) => props.theme.borderRadius}px;
background-color: ${(props) => props.theme.lightMessageColor};
color: #454545;
padding: ${(props) =>
`${props.theme.spacing / 2}px ${props.theme.spacing}px`};
color: #bf1c1c;
& svg {
display: inline-block;
flex: 0 0 ${constants.fontSize}px;
width: ${constants.fontSize}px;
height: ${constants.fontSize}px;
position: relative;
top: -1px;
flex: 0 0 ${constants.fontSize - 2}px;
width: ${constants.fontSize - 2}px;
height: ${constants.fontSize - 2}px;
margin-right: 4px;
}
`;
Expand Down
1 change: 0 additions & 1 deletion packages/website/src/components/ChatConfiguration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const getInitialConfig = (): Config => {
headers: {
"nlx-api-key": apiKey,
},
failureMessage: "Something went wrong",
languageCode,
};
};
Expand Down

0 comments on commit 9fd3168

Please sign in to comment.