From 0bf74ea65b1b6c2b8dd21ef1843ac5f1cd8af615 Mon Sep 17 00:00:00 2001 From: Daniel Whiffing Date: Fri, 13 Sep 2024 16:16:41 -0400 Subject: [PATCH] Displays tee address and model name below input. Makes wallet address shorter and clickable to copy address --- app/page.tsx | 76 ++++++++++++++---------- components/ChatWindow.tsx | 120 +++++++++++++++++++------------------- 2 files changed, 103 insertions(+), 93 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index d4c19fd..60e0e8c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -12,6 +12,9 @@ import { ScrollArea } from "@/components/ui/scroll-area"; import { EditContractModal } from "@/components/EditContractModal"; import { ConfirmAlert } from "@/components/ConfirmAlert"; import { ChatSettingsModal } from "@/components/ChatSettingsModal"; +import { shortenAddress } from "@/utils/shortenAddress"; +import { toast } from "sonner"; +import { useChat } from "@/components/ChatProvider"; export default function Page() { const { contracts } = useContracts(); @@ -20,6 +23,7 @@ export default function Page() { const [isSettingsModalOpen, setIsSettingsModalOpen] = useState(false); const { teeWalletAddress, isLoggedIn, handleLogin, handleLogout, isLoading } = useMagic(); + const { modelName } = useChat(); return (
@@ -30,44 +34,34 @@ export default function Page() { ) : isLoggedIn ? ( <>
- {/* Comment to hide side nav */} - {process.env.NODE_ENV === "development" && ( -
-
-
- Uploaded Contracts -
- - -
- {contracts.map((contract) => ( - setEditContractKey(contract.key)} - /> - ))} -
-
- +
+
+
+ Uploaded Contracts
+ + +
+ {contracts.map((contract) => ( + setEditContractKey(contract.key)} + /> + ))} +
+
+
- )} +
- {/* Remove div with id=temp if enabling side nav */}
{/* Top Navigation */} -
diff --git a/components/ChatWindow.tsx b/components/ChatWindow.tsx index fac7c02..34cbcab 100644 --- a/components/ChatWindow.tsx +++ b/components/ChatWindow.tsx @@ -61,69 +61,67 @@ export function ChatWindow() { } return ( -
- - -
-
-
- {messages.length > 0 - ? messages.map((m) => ( - - )) - : null} -
+ + +
+
+
+ {messages.length > 0 + ? messages.map((m) => ( + + )) + : null}
- - -
- - + + + + + +
+ + + Clear messages + + } /> -
- - - Clear messages - - } - /> - -
- - - -
+ +
+ + +
); }