Skip to content

Commit f34552d

Browse files
feat: integrate contextual help drawer feature flag and enhance customer support button functionality
1 parent 4635ccc commit f34552d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

apps/dashboard/src/components/header-navigation/customer-support-button.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { IS_SELF_HOSTED } from '../../config';
55
import { openInNewTab } from '../../utils/url';
66
import { HeaderButton } from './header-button';
77
import { SupportDrawer } from './support-drawer';
8+
import { useFeatureFlag } from '@/hooks/use-feature-flag';
9+
import { FeatureFlagsKeysEnum } from '@novu/shared';
810

911
export 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
};

packages/shared/src/types/feature-flags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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',

0 commit comments

Comments
 (0)