From 9bd9923e11f5f7647b35c8ee42e80648a40a1cb3 Mon Sep 17 00:00:00 2001 From: MananTank Date: Mon, 23 Dec 2024 21:21:51 +0000 Subject: [PATCH] [TOOL-2816] Nebula - update sidebar + other minor UI adjustments (#5823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Short description of the bug fixed or feature added --- ## PR-Codex overview This PR focuses on improving the UI components in the `ChatBar`, `ChatSidebar`, and `ContextFilters` by updating styles, modifying button variants, and enhancing layout structures. It also introduces a new `SidebarIconLink` component for better organization. ### Detailed summary - Removed `variant="primary"` from `Button` in `ChatBar`. - Simplified `Button` in `NebulaMobileNav`. - Adjusted class names in `ChatHistoryPage` for responsiveness. - Updated `Badge` components in `ContextFilters` to use `variant="secondary"`. - Replaced multiple icons in `ChatSidebar` with new ones. - Changed `Button` variant to `outline` in `ChatSidebar`. - Added new `SidebarIconLink` component for navigation links. - Adjusted layout spacing in `ChatSidebar`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../(app)/chat/history/ChatHistoryPage.tsx | 5 +- .../nebula-app/(app)/components/ChatBar.tsx | 1 - .../(app)/components/ChatSidebar.tsx | 71 ++++++++++++------- .../(app)/components/ContextFilters.tsx | 8 +-- .../(app)/components/NebulaMobileNav.tsx | 6 +- 5 files changed, 55 insertions(+), 36 deletions(-) diff --git a/apps/dashboard/src/app/nebula-app/(app)/chat/history/ChatHistoryPage.tsx b/apps/dashboard/src/app/nebula-app/(app)/chat/history/ChatHistoryPage.tsx index 2a31f27ea98..7c6969d4674 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/chat/history/ChatHistoryPage.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/chat/history/ChatHistoryPage.tsx @@ -81,12 +81,13 @@ export function ChatHistoryPageUI(props: { {filteredSessions.length > 0 && ( {filteredSessions.length > 0 && ( -
+
{filteredSessions.map((session) => ( - - + Alpha
-
-
-
+
+ +
+ + + +
+ {sessionsToShow.length > 0 && (
-

+

Recent Chats

{sessionsToShow.map((session) => { @@ -70,13 +80,6 @@ export function ChatSidebar(props: { /> ); })} - - - View All -
)} @@ -89,3 +92,23 @@ export function ChatSidebar(props: {
); } + +function SidebarIconLink(props: { + icon: React.FC<{ className?: string }>; + label: string; + target?: "_blank"; + href: string; +}) { + return ( + + ); +} diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx index d2f9852fbfe..841c967497a 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx @@ -1,5 +1,6 @@ "use client"; +import { MultiNetworkSelector } from "@/components/blocks/NetworkSelectors"; import { Spinner } from "@/components/ui/Spinner/Spinner"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -30,7 +31,6 @@ import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { isAddress } from "thirdweb"; import { z } from "zod"; -import { MultiNetworkSelector } from "../../../../@/components/blocks/NetworkSelectors"; import type { ContextFilters } from "../api/chat"; export default function ContextFiltersButton(props: { @@ -55,14 +55,14 @@ export default function ContextFiltersButton(props: { Context Filters
{chainIds && chainIds.length > 0 && ( - + Chain {chainIds.join(", ")} )} {contractAddresses && contractAddresses.length > 0 && ( - + Contract {contractAddresses @@ -73,7 +73,7 @@ export default function ContextFiltersButton(props: { )} {walletAddresses && walletAddresses.length > 0 && ( - + Wallet {walletAddresses diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/NebulaMobileNav.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/NebulaMobileNav.tsx index 1ecbdaa02cf..cc65bd26596 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/NebulaMobileNav.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/NebulaMobileNav.tsx @@ -61,11 +61,7 @@ export function MobileNav(props: {
-