|
1 | | -import { useState, cloneElement, isValidElement, useMemo } from 'react'; |
| 1 | +import { cloneElement, isValidElement, useMemo, useState } from 'react'; |
2 | 2 | import { createPortal } from 'react-dom'; |
3 | | -import { useLocation } from 'react-router-dom'; |
4 | 3 | import { |
| 4 | + RiBook2Line, |
| 5 | + RiBuildingLine, |
| 6 | + RiCalendarEventLine, |
5 | 7 | RiCloseFill, |
6 | | - RiSearchLine, |
7 | | - RiQuestionLine, |
| 8 | + RiCodeLine, |
| 9 | + RiGlobalLine, |
| 10 | + RiHashtag, |
| 11 | + RiKey2Line, |
| 12 | + RiLayoutGridLine, |
| 13 | + RiMailLine, |
8 | 14 | RiMessage3Line, |
9 | 15 | RiNewspaperLine, |
10 | | - RiCalendarEventLine, |
11 | | - RiRouteFill, |
12 | | - RiCodeLine, |
13 | 16 | RiNotification4Fill, |
14 | | - RiStore3Line, |
15 | | - RiUserLine, |
16 | | - RiKey2Line, |
| 17 | + RiRouteFill, |
| 18 | + RiSearchLine, |
17 | 19 | RiSettings3Line, |
18 | | - RiHashtag, |
19 | | - RiGlobalLine, |
20 | | - RiLayoutGridLine, |
| 20 | + RiStore3Line, |
21 | 21 | RiTranslate2, |
22 | | - RiMailLine, |
23 | | - RiBuildingLine, |
| 22 | + RiUserLine, |
24 | 23 | } from 'react-icons/ri'; |
25 | | -import { usePlainChat } from '@/hooks/use-plain-chat'; |
| 24 | +import { useLocation } from 'react-router-dom'; |
26 | 25 | import { NovuIcon } from '@/components/icons'; |
| 26 | +import { usePlainChat } from '@/hooks/use-plain-chat'; |
27 | 27 |
|
28 | 28 | const DOCS_BASE_URL = 'https://docs.novu.co'; |
29 | 29 | const UTM_SUFFIX = '?utm_campaign=support_drawer'; |
30 | 30 | const BOOK_DEMO_URL = `https://cal.com/team/novu/intro${UTM_SUFFIX}`; |
31 | 31 | const CHANGELOG_URL = `https://go.novu.co/changelog${UTM_SUFFIX}`; |
| 32 | +const ROADMAP_URL = `https://roadmap.novu.co/roadmap${UTM_SUFFIX}`; |
32 | 33 |
|
33 | 34 | // Hash fragments must come after query params in URLs |
34 | 35 | // 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[]> = { |
140 | 141 | { |
141 | 142 | icon: RiCodeLine, |
142 | 143 | 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.", |
144 | 145 | url: docsUrl('/api-reference/overview'), |
145 | 146 | }, |
146 | 147 | ], |
@@ -356,27 +357,17 @@ function SupportDrawerContent({ onClose }: SupportDrawerContentProps) { |
356 | 357 | onClose(); |
357 | 358 | } |
358 | 359 |
|
359 | | - function handleAskQuestion() { |
360 | | - onClose(); |
361 | | - showPlainLiveChat(); |
362 | | - } |
363 | | - |
364 | 360 | function handleShareFeedback() { |
365 | 361 | if (isLiveChatVisible) { |
366 | 362 | showPlainLiveChat(); |
367 | 363 | onClose(); |
368 | 364 | } else { |
369 | | - window.open(docsUrl(), '_blank'); |
| 365 | + handleOpenExternalLink(docsUrl()); |
370 | 366 | } |
371 | 367 | } |
372 | 368 |
|
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'); |
380 | 371 | onClose(); |
381 | 372 | } |
382 | 373 |
|
@@ -456,16 +447,19 @@ function SupportDrawerContent({ onClose }: SupportDrawerContentProps) { |
456 | 447 | </div> |
457 | 448 |
|
458 | 449 | <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 |
461 | 452 | </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)}> |
466 | 454 | What's new |
467 | 455 | </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)}> |
469 | 463 | <span> |
470 | 464 | Book a demo <span className="text-foreground-400">(Yes, with a real human)</span> |
471 | 465 | </span> |
|
0 commit comments