fix: Update colors in widget buttons to fix invalid colors (#6033)

Co-authored-by: nithindavid <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Sivin Varghese 2022-12-15 04:51:20 +05:30 committed by GitHub
parent 26e05de642
commit 2972319026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 99 additions and 21 deletions

View file

@ -10,7 +10,7 @@ import {
widgetHolder,
createBubbleHolder,
createBubbleIcon,
bubbleImg,
bubbleSVG,
chatBubble,
closeBubble,
bubbleHolder,
@ -21,6 +21,7 @@ import {
addUnreadClass,
removeUnreadClass,
} from './bubbleHelpers';
import { isWidgetColorLighter } from 'shared/helpers/colorHelper';
import { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';
import { CHATWOOT_ERROR, CHATWOOT_READY } from '../widget/constants/sdkEvents';
import { SET_USER_ERROR } from '../widget/constants/errorTypes';
@ -277,9 +278,14 @@ export const IFrameHelper = {
closeBtnClassName += ' woot-widget-bubble--flat';
}
if (isWidgetColorLighter(widgetColor)) {
className += ' woot-widget-bubble-color--lighter';
closeBtnClassName += ' woot-widget-bubble-color--lighter';
}
const chatIcon = createBubbleIcon({
className,
src: bubbleImg,
path: bubbleSVG,
target: chatBubble,
});