@aslaluroba/help-center-react 3.2.13 → 3.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +14 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-list.d.ts +1 -0
- package/package.json +1 -1
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-list.tsx +3 -1
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-option.tsx +19 -11
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +1 -0
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ interface HelpscreenListProps {
|
|
|
11
11
|
onToggleOption: (option: Option) => void;
|
|
12
12
|
onStartChat: () => void;
|
|
13
13
|
showChatNowButton?: boolean;
|
|
14
|
+
chatWithUs?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const HelpscreenList: React.FC<HelpscreenListProps> = ({
|
|
@@ -19,6 +20,7 @@ const HelpscreenList: React.FC<HelpscreenListProps> = ({
|
|
|
19
20
|
onToggleOption,
|
|
20
21
|
onStartChat,
|
|
21
22
|
showChatNowButton = true,
|
|
23
|
+
chatWithUs = true,
|
|
22
24
|
}) => {
|
|
23
25
|
const { t } = useLocalTranslation();
|
|
24
26
|
|
|
@@ -39,7 +41,7 @@ const HelpscreenList: React.FC<HelpscreenListProps> = ({
|
|
|
39
41
|
<Button
|
|
40
42
|
variant='default'
|
|
41
43
|
onClick={onStartChat}
|
|
42
|
-
disabled={!selectedOption}
|
|
44
|
+
disabled={!selectedOption || !chatWithUs}
|
|
43
45
|
>
|
|
44
46
|
{t('homeSdk.chatNow')}
|
|
45
47
|
<SolarPlain2BoldDuotone className="babylai:w-6 babylai:h-6" />
|
|
@@ -13,23 +13,31 @@ const HelpscreenOption: React.FC<HelpscreenOptionProps> = ({
|
|
|
13
13
|
isSelected,
|
|
14
14
|
onClick,
|
|
15
15
|
}) => {
|
|
16
|
+
const chatWithUs = option.chatWithUs ?? true;
|
|
17
|
+
|
|
16
18
|
return (
|
|
17
19
|
<div
|
|
18
|
-
role=
|
|
19
|
-
tabIndex={0}
|
|
20
|
+
role={chatWithUs ? 'button' : undefined}
|
|
21
|
+
tabIndex={chatWithUs ? 0 : undefined}
|
|
20
22
|
className={cn(
|
|
21
|
-
'babylai:flex babylai:flex-col babylai:gap-2 babylai:p-6 babylai:rounded-3xl babylai:text-start babylai:border babylai:border-black-white-200 babylai:bg-card
|
|
23
|
+
'babylai:flex babylai:flex-col babylai:gap-2 babylai:p-6 babylai:rounded-3xl babylai:text-start babylai:border babylai:border-black-white-200 babylai:bg-card',
|
|
22
24
|
'babylai:transition-all babylai:duration-200 babylai:ease-out',
|
|
23
|
-
|
|
25
|
+
chatWithUs
|
|
26
|
+
? 'babylai:cursor-pointer babylai:active:scale-[0.98] babylai:active:opacity-95'
|
|
27
|
+
: 'babylai:cursor-default',
|
|
24
28
|
isSelected && 'babylai:ring babylai:ring-primary-500 babylai:shadow-md'
|
|
25
29
|
)}
|
|
26
|
-
onClick={onClick}
|
|
27
|
-
onKeyDown={
|
|
28
|
-
|
|
29
|
-
e
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
onClick={chatWithUs ? onClick : undefined}
|
|
31
|
+
onKeyDown={
|
|
32
|
+
chatWithUs
|
|
33
|
+
? (e) => {
|
|
34
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
onClick();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
: undefined
|
|
40
|
+
}
|
|
33
41
|
>
|
|
34
42
|
<h2 className="babylai:text-base! babylai:font-semibold! babylai:text-card-foreground" dir="auto">
|
|
35
43
|
{option.title}
|
|
@@ -59,6 +59,7 @@ const OptionsListScreen: React.FC<OptionsListScreenProps> = ({
|
|
|
59
59
|
onToggleOption={handleToggleExpandOption}
|
|
60
60
|
onStartChat={handleStartChatWithSelected}
|
|
61
61
|
showChatNowButton={!hasActiveSession}
|
|
62
|
+
chatWithUs={helpScreen?.chatWithUs ?? true}
|
|
62
63
|
/>
|
|
63
64
|
</div >
|
|
64
65
|
<PoweredBy />
|