Skip to content

Commit f1107c5

Browse files
committed
more cleanup
1 parent d4aef53 commit f1107c5

File tree

6 files changed

+14
-83
lines changed

6 files changed

+14
-83
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ const client = createThirdwebClient({
1515
});
1616

1717
export function CustomChatButton(props: {
18-
isLoggedIn: boolean;
19-
networks: "mainnet" | "testnet" | "all" | null;
20-
isFloating: boolean;
21-
pageType: "chain" | "contract" | "support";
2218
label: string;
2319
examplePrompts: string[];
24-
authToken: string | undefined;
20+
authToken: string;
2521
team: Team;
2622
clientId: string | undefined;
27-
requireLogin?: boolean;
2823
}) {
2924
const [isOpen, setIsOpen] = useState(false);
3025
const [hasBeenOpened, setHasBeenOpened] = useState(false);
@@ -81,8 +76,6 @@ export function CustomChatButton(props: {
8176
message: prompt,
8277
title: prompt,
8378
}))}
84-
networks={props.networks}
85-
requireLogin={props.requireLogin}
8679
team={props.team}
8780
/>
8881
)}

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

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"use client";
2-
import { ArrowRightIcon } from "lucide-react";
3-
import Link from "next/link";
4-
import { usePathname } from "next/navigation";
52
import { useCallback, useState } from "react";
63
import type { ThirdwebClient } from "thirdweb";
74
import { useActiveWalletConnectionStatus } from "thirdweb/react";
@@ -11,21 +8,15 @@ import { ThirdwebMiniLogo } from "../../../app/(app)/components/ThirdwebMiniLogo
118
import { ChatBar } from "./ChatBar";
129
import type { UserMessage, UserMessageContent } from "./CustomChats";
1310
import { type CustomChatMessage, CustomChats } from "./CustomChats";
14-
import type { ExamplePrompt, NebulaContext } from "./types";
11+
import type { ExamplePrompt } from "./types";
1512

1613
export default function CustomChatContent(props: {
1714
authToken: string | undefined;
1815
team: Team;
1916
clientId: string | undefined;
2017
client: ThirdwebClient;
2118
examplePrompts: ExamplePrompt[];
22-
networks: NebulaContext["networks"];
23-
requireLogin?: boolean;
2419
}) {
25-
if (props.requireLogin !== false && !props.authToken) {
26-
return <LoggedOutStateChatContent />;
27-
}
28-
2920
return (
3021
<CustomChatContentLoggedIn
3122
authToken={props.authToken || ""}
@@ -266,45 +257,6 @@ function CustomChatContentLoggedIn(props: {
266257
);
267258
}
268259

269-
function LoggedOutStateChatContent() {
270-
const pathname = usePathname();
271-
return (
272-
<div className="flex grow flex-col items-center justify-center p-4">
273-
<div className="mb-4 flex justify-center">
274-
<div className="rounded-full border p-1 bg-muted/20">
275-
<div className="rounded-full border p-2 bg-inverted">
276-
<ThirdwebMiniLogo
277-
isMonoChrome
278-
className="size-7 text-inverted-foreground"
279-
/>
280-
</div>
281-
</div>
282-
</div>
283-
284-
<h1 className="px-4 text-center font-semibold text-3xl tracking-tight md:text-4xl">
285-
How can I help you <br className="max-sm:hidden" />
286-
today?
287-
</h1>
288-
289-
<div className="h-3" />
290-
<p className="text-base text-muted-foreground">
291-
Sign in to use AI Assistant
292-
</p>
293-
<div className="h-5" />
294-
295-
<Button asChild>
296-
<Link
297-
className="w-full max-w-96 gap-2"
298-
href={`/login?next=${encodeURIComponent(pathname)}`}
299-
>
300-
Sign in
301-
<ArrowRightIcon className="size-4" />
302-
</Link>
303-
</Button>
304-
</div>
305-
);
306-
}
307-
308260
function EmptyStateChatPageContent(props: {
309261
sendMessage: (message: UserMessage) => void;
310262
examplePrompts: { title: string; message: string }[];

apps/dashboard/src/@/components/chat/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ export type ExamplePrompt = {
66

77
// TODO - remove "Nebula" wording and simplify types
88

9-
export type NebulaContext = {
10-
chainIds: string[] | null;
11-
walletAddress: string | null;
12-
networks: "mainnet" | "testnet" | "all" | null;
13-
};
14-
159
type NebulaUserMessageContentItem =
1610
| {
1711
type: "image";

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,15 @@ export default async function TeamLayout(props: {
103103
>
104104
{props.children}
105105
</TeamSidebarLayout>
106-
{team && (
107-
<div className="fixed right-6 bottom-6 z-50">
108-
<CustomChatButton
109-
authToken={authToken}
110-
clientId={undefined}
111-
examplePrompts={siwaExamplePrompts}
112-
isFloating={true}
113-
isLoggedIn={true}
114-
label="Get Help"
115-
networks="all"
116-
pageType="support"
117-
team={team}
118-
/>
119-
</div>
120-
)}
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>
121115
</div>
122116
</SidebarProvider>
123117
);

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,12 @@ export default async function ProjectLayout(props: {
9797
{props.children}
9898
</ProjectSidebarLayout>
9999
</div>
100-
<div className="fixed right-6 bottom-6 z-50">
100+
<div className="fixed right-4 bottom-4 z-50">
101101
<CustomChatButton
102102
authToken={authToken}
103103
clientId={project.publishableKey}
104104
examplePrompts={siwaExamplePrompts}
105-
isFloating={true}
106-
isLoggedIn={true}
107105
label="Ask AI Assistant"
108-
networks="all"
109-
pageType="support"
110106
team={team}
111107
/>
112108
</div>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/topic-selector-modal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
8585
eventTypes: [] as string[],
8686
filterType: "event" as const,
8787
fromAddresses: "",
88+
// biome-ignore lint/suspicious/noExplicitAny: TODO - fix
8889
inputAbi: [] as any[],
8990
name: "",
9091
secret: "",
@@ -104,6 +105,7 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
104105
eventTypes: [] as string[],
105106
filterType: "transaction" as const,
106107
fromAddresses: "",
108+
// biome-ignore lint/suspicious/noExplicitAny: TODO - fix
107109
inputAbi: [] as any[],
108110
name: "",
109111
secret: "",

0 commit comments

Comments
 (0)