Skip to content

Commit 6f88d38

Browse files
committed
[BLD-325] Dashboard: Rename floating chat button label (#8086)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `CustomChatButton` component and its usage in various layouts by simplifying the button structure, changing icons, and removing unnecessary wrapper elements. ### Detailed summary - Removed the wrapper `<div>` around the `CustomChatButton` in `layout.tsx` files. - Changed the icon in `CustomChatButton` from `MessageCircleIcon` to `CircleQuestionMarkIcon`. - Updated button label from dynamic to static "Need help?". - Adjusted button class names for styling consistency. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent d53f8a2 commit 6f88d38

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

apps/dashboard/src/@/components/chat/CustomChatButton.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { MessageCircleIcon, XIcon } from "lucide-react";
3+
import { CircleQuestionMarkIcon, XIcon } from "lucide-react";
44
import { useSelectedLayoutSegments } from "next/navigation";
55
import { useCallback, useRef, useState } from "react";
66
import { createThirdwebClient } from "thirdweb";
@@ -16,7 +16,6 @@ const client = createThirdwebClient({
1616
});
1717

1818
export function CustomChatButton(props: {
19-
label: string;
2019
examplePrompts: string[];
2120
authToken: string;
2221
team: Team;
@@ -39,30 +38,33 @@ export function CustomChatButton(props: {
3938
<>
4039
{/* Inline Button (not floating) */}
4140
<Button
42-
className="gap-2 rounded-full shadow-lg"
41+
className={cn(
42+
"gap-2 rounded-full shadow-lg fixed right-6 bottom-6 z-50 bg-card",
43+
isOpen && "opacity-0",
44+
)}
45+
size="sm"
4346
onClick={() => {
4447
setIsOpen(true);
4548
setHasBeenOpened(true);
4649
}}
47-
variant="default"
50+
variant="outline"
4851
>
49-
<MessageCircleIcon className="size-4" />
50-
{props.label}
52+
<CircleQuestionMarkIcon className="size-3.5 text-muted-foreground" />
53+
Need help?
5154
</Button>
5255

5356
{/* Popup/Modal */}
5457
<div
5558
className={cn(
56-
"slide-in-from-bottom-20 zoom-in-95 fade-in-0 fixed bottom-0 left-0 z-50 flex h-[80vh] w-[100vw] animate-in flex-col overflow-hidden rounded-t-2xl border bg-background shadow-2xl duration-200 lg:right-6 lg:bottom-6 lg:left-auto lg:h-[80vh] lg:max-w-xl lg:rounded-xl",
59+
"slide-in-from-bottom-20 zoom-in-95 fade-in-0 fixed bottom-0 left-0 z-50 flex h-[80vh] w-[100vw] animate-in flex-col overflow-hidden rounded-t-2xl border bg-background shadow-2xl duration-200 lg:right-6 lg:bottom-6 lg:left-auto lg:h-[80vh] lg:max-w-xl lg:rounded-2xl",
5760
!isOpen && "hidden",
5861
)}
5962
ref={ref}
6063
>
6164
{/* Header with close button */}
6265
<div className="flex items-center justify-between border-b px-4 py-4">
6366
<div className="flex items-center gap-2 font-semibold text-lg">
64-
<MessageCircleIcon className="size-5 text-muted-foreground" />
65-
{props.label}
67+
Need help?
6668
</div>
6769
<Button
6870
aria-label="Close chat"

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/layout.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,12 @@ export default async function TeamLayout(props: {
103103
>
104104
{props.children}
105105
</TeamSidebarLayout>
106-
<div className="fixed right-4 bottom-4 z-50">
107-
<CustomChatButton
108-
authToken={authToken}
109-
clientId={undefined}
110-
examplePrompts={siwaExamplePrompts}
111-
label="Get Help"
112-
team={team}
113-
/>
114-
</div>
106+
<CustomChatButton
107+
authToken={authToken}
108+
clientId={undefined}
109+
examplePrompts={siwaExamplePrompts}
110+
team={team}
111+
/>
115112
</div>
116113
</SidebarProvider>
117114
);

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,12 @@ export default async function ProjectLayout(props: {
7777
{props.children}
7878
</ProjectSidebarLayout>
7979
</div>
80-
<div className="fixed right-4 bottom-4 z-50">
81-
<CustomChatButton
82-
authToken={authToken}
83-
clientId={project.publishableKey}
84-
examplePrompts={siwaExamplePrompts}
85-
label="Ask AI Assistant"
86-
team={team}
87-
/>
88-
</div>
80+
<CustomChatButton
81+
authToken={authToken}
82+
clientId={project.publishableKey}
83+
examplePrompts={siwaExamplePrompts}
84+
team={team}
85+
/>
8986
<SaveLastUsedProject projectId={project.id} teamId={team.id} />
9087
</SidebarProvider>
9188
);

0 commit comments

Comments
 (0)