Skip to content

Commit 099ec08

Browse files
authored
Merge pull request #287 from amansoni7477030/main
Deny button functionality in Desclaimer
2 parents a019fac + c7b1a96 commit 099ec08

File tree

13 files changed

+47
-7
lines changed

13 files changed

+47
-7
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ You can also customize chatbot with different configuration
143143
buttonTextColor: 'white',
144144
blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
145145
backgroundColor: 'white',
146+
denyButtonText: 'Cancel',
147+
denyButtonBgColor: '#ef4444',
146148
},
147149
customCSS: ``, // Add custom CSS styles. Use !important to override default styles
148150
chatWindow: {

dist/components/Bot.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export type BotProps = {
102102
disclaimer?: DisclaimerPopUpTheme;
103103
dateTimeToggle?: DateTimeToggleTheme;
104104
renderHTML?: boolean;
105+
closeBot?: () => void;
105106
};
106107
export type LeadsConfig = {
107108
status: boolean;

dist/components/Bot.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/features/bubble/components/Bubble.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/features/bubble/types.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export type DisclaimerPopUpTheme = {
101101
buttonText?: string;
102102
blurredBackgroundColor?: string;
103103
backgroundColor?: string;
104+
denyButtonBgColor?: string;
105+
denyButtonText?: string;
104106
};
105107
export type DateTimeToggleTheme = {
106108
date?: boolean;

dist/features/bubble/types.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
export type DisclaimerPopupProps = {
22
isOpen?: boolean;
3+
isFullPage?: boolean;
34
onAccept?: () => void;
5+
onDeny?: () => void;
46
title?: string;
57
message?: string;
68
buttonText?: string;
9+
denyButtonText?: string;
710
blurredBackgroundColor?: string;
811
backgroundColor?: string;
912
buttonColor?: string;
1013
textColor?: string;
1114
buttonTextColor?: string;
15+
denyButtonBgColor?: string;
1216
};
1317
export declare const DisclaimerPopup: (props: DisclaimerPopupProps) => import("solid-js").JSX.Element;
1418
//# sourceMappingURL=DisclaimerPopup.d.ts.map

dist/features/popup/components/DisclaimerPopup.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/web.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Bot.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export type BotProps = {
155155
disclaimer?: DisclaimerPopUpTheme;
156156
dateTimeToggle?: DateTimeToggleTheme;
157157
renderHTML?: boolean;
158+
closeBot?: () => void;
158159
};
159160

160161
export type LeadsConfig = {
@@ -1640,6 +1641,10 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
16401641
buttonTextColor={props.disclaimer?.buttonTextColor}
16411642
blurredBackgroundColor={props.disclaimer?.blurredBackgroundColor}
16421643
backgroundColor={props.disclaimer?.backgroundColor}
1644+
denyButtonBgColor={props.disclaimer?.denyButtonBgColor}
1645+
denyButtonText={props.disclaimer?.denyButtonText}
1646+
onDeny={props.closeBot}
1647+
isFullPage={props.isFullPage}
16431648
/>
16441649
)}
16451650
</>

src/features/bubble/components/Bubble.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const Bubble = (props: BubbleProps) => {
9797
'background-repeat': 'no-repeat',
9898
'z-index': 42424242,
9999
bottom: `${Math.min(buttonPosition().bottom + buttonSize + 10, window.innerHeight - chatWindowBottom)}px`,
100-
right: `${Math.min(buttonPosition().right, window.innerWidth - 410)}px`,
100+
right: `${Math.max(0, Math.min(buttonPosition().right, window.innerWidth - (bubbleProps.theme?.chatWindow?.width ?? 410) - 10))}px`,
101101
}}
102102
class={
103103
`fixed sm:right-5 rounded-lg w-full sm:w-[400px] max-h-[704px]` +
@@ -153,6 +153,7 @@ export const Bubble = (props: BubbleProps) => {
153153
disclaimer={bubbleProps.theme?.disclaimer}
154154
dateTimeToggle={bubbleProps.theme?.chatWindow?.dateTimeToggle}
155155
renderHTML={props.theme?.chatWindow?.renderHTML}
156+
closeBot={closeBot}
156157
/>
157158
</div>
158159
</Show>

src/features/bubble/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export type DisclaimerPopUpTheme = {
112112
buttonText?: string;
113113
blurredBackgroundColor?: string;
114114
backgroundColor?: string;
115+
denyButtonBgColor?: string;
116+
denyButtonText?: string;
115117
};
116118

117119
export type DateTimeToggleTheme = {

0 commit comments

Comments
 (0)