File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/shared/src/types Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,13 @@ import { IS_SELF_HOSTED } from '../../config';
55import { openInNewTab } from '../../utils/url' ;
66import { HeaderButton } from './header-button' ;
77import { SupportDrawer } from './support-drawer' ;
8+ import { useFeatureFlag } from '@/hooks/use-feature-flag' ;
9+ import { FeatureFlagsKeysEnum } from '@novu/shared' ;
810
911export const CustomerSupportButton = ( ) => {
10- usePlainChat ( ) ;
1112 useBootIntercom ( ) ;
13+ const { showPlainLiveChat } = usePlainChat ( ) ;
14+ const isContextualHelpEnabled = useFeatureFlag ( FeatureFlagsKeysEnum . IS_CONTEXTUAL_HELP_DRAWER_ENABLED ) ;
1215
1316 if ( IS_SELF_HOSTED ) {
1417 return (
@@ -24,13 +27,19 @@ export const CustomerSupportButton = () => {
2427 ) ;
2528 }
2629
27- return (
30+ return isContextualHelpEnabled ? (
2831 < SupportDrawer >
2932 < button tabIndex = { - 1 } className = "flex items-center justify-center" >
3033 < HeaderButton label = "Help" >
3134 < RiQuestionFill className = "text-foreground-600 size-4" />
3235 </ HeaderButton >
3336 </ button >
3437 </ SupportDrawer >
38+ ) : (
39+ < button tabIndex = { - 1 } className = "flex items-center justify-center" onClick = { ( ) => showPlainLiveChat ( ) } >
40+ < HeaderButton label = "Help" >
41+ < RiQuestionFill className = "text-foreground-600 size-4" />
42+ </ HeaderButton >
43+ </ button >
3544 ) ;
3645} ;
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export enum FeatureFlagsKeysEnum {
7272 IS_PUSH_UNREAD_COUNT_ENABLED = 'IS_PUSH_UNREAD_COUNT_ENABLED' ,
7373 IS_EXPIRED_TOKENS_REMOVAL_ENABLED = 'IS_EXPIRED_TOKENS_REMOVAL_ENABLED' ,
7474 IS_ANALYTICS_WORKFLOW_FILTER_ENABLED = 'IS_ANALYTICS_WORKFLOW_FILTER_ENABLED' ,
75+ IS_CONTEXTUAL_HELP_DRAWER_ENABLED = 'IS_CONTEXTUAL_HELP_DRAWER_ENABLED' ,
7576
7677 // Numeric flags
7778 MAX_WORKFLOW_LIMIT_NUMBER = 'MAX_WORKFLOW_LIMIT_NUMBER' ,
You can’t perform that action at this time.
0 commit comments