Skip to content

Commit 6694fe5

Browse files
feat: update support drawer with new external link handling and improved documentation access
1 parent f34552d commit 6694fe5

File tree

2 files changed

+31
-44
lines changed

2 files changed

+31
-44
lines changed

apps/dashboard/src/components/header-navigation/support-drawer.tsx

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
import { useState, cloneElement, isValidElement, useMemo } from 'react';
1+
import { cloneElement, isValidElement, useMemo, useState } from 'react';
22
import { createPortal } from 'react-dom';
3-
import { useLocation } from 'react-router-dom';
43
import {
4+
RiBook2Line,
5+
RiBuildingLine,
6+
RiCalendarEventLine,
57
RiCloseFill,
6-
RiSearchLine,
7-
RiQuestionLine,
8+
RiCodeLine,
9+
RiGlobalLine,
10+
RiHashtag,
11+
RiKey2Line,
12+
RiLayoutGridLine,
13+
RiMailLine,
814
RiMessage3Line,
915
RiNewspaperLine,
10-
RiCalendarEventLine,
11-
RiRouteFill,
12-
RiCodeLine,
1316
RiNotification4Fill,
14-
RiStore3Line,
15-
RiUserLine,
16-
RiKey2Line,
17+
RiRouteFill,
18+
RiSearchLine,
1719
RiSettings3Line,
18-
RiHashtag,
19-
RiGlobalLine,
20-
RiLayoutGridLine,
20+
RiStore3Line,
2121
RiTranslate2,
22-
RiMailLine,
23-
RiBuildingLine,
22+
RiUserLine,
2423
} from 'react-icons/ri';
25-
import { usePlainChat } from '@/hooks/use-plain-chat';
24+
import { useLocation } from 'react-router-dom';
2625
import { NovuIcon } from '@/components/icons';
26+
import { usePlainChat } from '@/hooks/use-plain-chat';
2727

2828
const DOCS_BASE_URL = 'https://docs.novu.co';
2929
const UTM_SUFFIX = '?utm_campaign=support_drawer';
3030
const BOOK_DEMO_URL = `https://cal.com/team/novu/intro${UTM_SUFFIX}`;
3131
const CHANGELOG_URL = `https://go.novu.co/changelog${UTM_SUFFIX}`;
32+
const ROADMAP_URL = `https://roadmap.novu.co/roadmap${UTM_SUFFIX}`;
3233

3334
// Hash fragments must come after query params in URLs
3435
// e.g. docsUrl('/framework/controls#using-variables') => https://docs.novu.co/framework/controls?utm_campaign=support_drawer#using-variables
@@ -140,7 +141,7 @@ const CONTEXTUAL_SUGGESTIONS: Record<RouteContext, SuggestionItem[]> = {
140141
{
141142
icon: RiCodeLine,
142143
title: 'REST API reference',
143-
description: 'Learn how to authenticate and work with Novu\'s API endpoints.',
144+
description: "Learn how to authenticate and work with Novu's API endpoints.",
144145
url: docsUrl('/api-reference/overview'),
145146
},
146147
],
@@ -356,27 +357,17 @@ function SupportDrawerContent({ onClose }: SupportDrawerContentProps) {
356357
onClose();
357358
}
358359

359-
function handleAskQuestion() {
360-
onClose();
361-
showPlainLiveChat();
362-
}
363-
364360
function handleShareFeedback() {
365361
if (isLiveChatVisible) {
366362
showPlainLiveChat();
367363
onClose();
368364
} else {
369-
window.open(docsUrl(), '_blank');
365+
handleOpenExternalLink(docsUrl());
370366
}
371367
}
372368

373-
function handleWhatsNew() {
374-
window.open(CHANGELOG_URL, '_blank');
375-
onClose();
376-
}
377-
378-
function handleBookDemo() {
379-
window.open(BOOK_DEMO_URL, '_blank');
369+
function handleOpenExternalLink(url: string) {
370+
window.open(url, '_blank noopener noreferrer');
380371
onClose();
381372
}
382373

@@ -456,16 +447,19 @@ function SupportDrawerContent({ onClose }: SupportDrawerContentProps) {
456447
</div>
457448

458449
<div className="flex flex-col gap-0.5 p-1.5">
459-
<FooterLink icon={RiQuestionLine} onClick={handleAskQuestion}>
460-
Ask a question
450+
<FooterLink icon={RiBook2Line} onClick={() => handleOpenExternalLink(docsUrl())}>
451+
Documentation
461452
</FooterLink>
462-
<FooterLink icon={RiMessage3Line} onClick={handleShareFeedback}>
463-
Share feedback
464-
</FooterLink>
465-
<FooterLink icon={RiNewspaperLine} onClick={handleWhatsNew}>
453+
<FooterLink icon={RiNewspaperLine} onClick={() => handleOpenExternalLink(CHANGELOG_URL)}>
466454
What's new
467455
</FooterLink>
468-
<FooterLink icon={RiCalendarEventLine} onClick={handleBookDemo}>
456+
<FooterLink icon={RiRouteFill} onClick={() => handleOpenExternalLink(ROADMAP_URL)}>
457+
Roadmap
458+
</FooterLink>
459+
<FooterLink icon={RiMessage3Line} onClick={handleShareFeedback}>
460+
Chat with us
461+
</FooterLink>
462+
<FooterLink icon={RiCalendarEventLine} onClick={() => handleOpenExternalLink(BOOK_DEMO_URL)}>
469463
<span>
470464
Book a demo <span className="text-foreground-400">(Yes, with a real human)</span>
471465
</span>

apps/dashboard/src/hooks/use-plain-chat.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ export const usePlainChat = () => {
3434
externalId: currentUser?._id,
3535
},
3636
links: [
37-
{ icon: 'book', text: 'Documentation', url: 'https://docs.novu.co?utm_campaign=in_app_live_chat' },
38-
{
39-
icon: 'integration',
40-
text: 'Roadmap',
41-
url: 'https://roadmap.novu.co/roadmap?utm_campaign=in_app_live_chat',
42-
},
43-
{ icon: 'link', text: 'Changelog', url: 'https://go.novu.co/changelog?utm_campaign=in_app_live_chat' },
4437
{
4538
icon: 'email',
4639
text: 'Contact Sales',

0 commit comments

Comments
 (0)