From 7087b3fcbcf4b63f62638b528209b0eae2bdf7a0 Mon Sep 17 00:00:00 2001 From: GiselleNessi Date: Fri, 25 Apr 2025 19:34:39 +0000 Subject: [PATCH] Dashboard: add nebula chat on support page, update CTAs (#6862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on enhancing the `FloatingChat` component by renaming it to `NebulaChatButton` and adding support for a new `support` page type. It also updates various components and their usage across the application to reflect this change. ### Detailed summary - Renamed `NebulaFloatingChatButton` to `NebulaChatButton`. - Added `support` as a new value for the `pageType` property. - Updated imports and component usage to reflect the new name. - Added `isFloating` prop to `NebulaChatButton`. - Modified `SupportPage` to utilize `NebulaChatButton` for support inquiries. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../(chain)/[chain_id]/(chainPage)/layout.tsx | 5 +- .../[chain_id]/[contractAddress]/layout.tsx | 5 +- .../app/(app)/(dashboard)/support/page.tsx | 62 +++++++++++++++++-- .../FloatingChat/FloatingChat.stories.tsx | 8 +-- .../components/FloatingChat/FloatingChat.tsx | 54 +++++++++------- .../FloatingChat/FloatingChatContent.tsx | 4 +- 6 files changed, 98 insertions(+), 40 deletions(-) diff --git a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx index 72f63b4ed3a..f4bd349ab68 100644 --- a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx +++ b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx @@ -19,7 +19,7 @@ import Link from "next/link"; import { redirect } from "next/navigation"; import { getThirdwebClient } from "../../../../../../@/constants/thirdweb.server"; import { mapV4ChainToV5Chain } from "../../../../../../contexts/map-chains"; -import { NebulaFloatingChatButton } from "../../../../../nebula-app/(app)/components/FloatingChat/FloatingChat"; +import { NebulaChatButton } from "../../../../../nebula-app/(app)/components/FloatingChat/FloatingChat"; import { getAuthToken, getAuthTokenWalletAddress, @@ -99,7 +99,8 @@ The following is the user's message: return ( <> - -
@@ -127,12 +152,37 @@ export default function SupportPage() { How can we help?

- Our dedicated support team is here to help you with any questions - or issues you may have. Contact us today and let us assist you. + Get instant answers with Nebula AI, our onchain support assistant. + Still need help? You can also create a support case to reach our + team.

- +
+ ({ + title: prompt, + message: prompt, + }))} + /> + + + Open a support case + +
diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.stories.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.stories.tsx index f1b67c773ad..61c480f9702 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.stories.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.stories.tsx @@ -2,11 +2,11 @@ import type { Meta, StoryObj } from "@storybook/react"; import { storybookThirdwebClient } from "stories/utils"; import { ThirdwebProvider } from "thirdweb/react"; import { examplePrompts } from "../../data/examplePrompts"; -import { NebulaFloatingChatButton } from "./FloatingChat"; +import { NebulaChatButton } from "./FloatingChat"; const meta = { title: "Nebula/FloatingChat", - component: NebulaFloatingChatButton, + component: NebulaChatButton, decorators: [ (Story) => ( @@ -14,10 +14,10 @@ const meta = { ), ], -} satisfies Meta; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const LoggedIn: Story = { args: { diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.tsx index 369146f3e0b..ee690537cff 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/FloatingChat/FloatingChat.tsx @@ -21,12 +21,13 @@ import { NebulaIcon } from "../../icons/NebulaIcon"; const LazyFloatingChatContent = lazy(() => import("./FloatingChatContent")); -export function NebulaFloatingChatButton(props: { - pageType: "chain" | "contract"; +export function NebulaChatButton(props: { + pageType: "chain" | "contract" | "support"; authToken: string | undefined; examplePrompts: ExamplePrompt[]; label: string; client: ThirdwebClient; + isFloating: boolean; nebulaParams: | { messagePrefix: string; @@ -47,25 +48,30 @@ export function NebulaFloatingChatButton(props: { return ( <> - {!isOpen && ( -
- +
+ + {props.isFloating && ( -
- )} + )} +