From b47e5836406aa97d8484804fdca49e3590977f83 Mon Sep 17 00:00:00 2001 From: devdezzies Date: Tue, 1 Jul 2025 11:46:39 +0700 Subject: [PATCH 1/2] 11: added project header and applied next theme --- src/app/layout.tsx | 14 +++- .../projects/ui/components/message-card.tsx | 12 ++-- .../ui/components/message-loading.tsx | 56 +++++++++++++++ .../ui/components/messages-container.tsx | 33 ++++++--- .../projects/ui/components/project-header.tsx | 71 +++++++++++++++++++ .../projects/ui/views/project-view.tsx | 15 +++- 6 files changed, 183 insertions(+), 18 deletions(-) create mode 100644 src/modules/projects/ui/components/message-loading.tsx create mode 100644 src/modules/projects/ui/components/project-header.tsx diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7de9bb6..f751c78 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,6 +3,7 @@ import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; import { TRPCReactProvider } from "@/trpc/client"; import { Toaster } from "sonner"; +import { ThemeProvider } from "next-themes"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -26,12 +27,19 @@ export default function RootLayout({ }>) { return ( - + - - {children} + + + {children} + diff --git a/src/modules/projects/ui/components/message-card.tsx b/src/modules/projects/ui/components/message-card.tsx index 3c279d0..a0a4c12 100644 --- a/src/modules/projects/ui/components/message-card.tsx +++ b/src/modules/projects/ui/components/message-card.tsx @@ -42,9 +42,11 @@ const FragmentCard = ({ onFragmentClick }: FragmentCardProps) => { return ( - + + + + + + Go to dashboard + + + + + + + Appearance + + + + + + Light + + + Dark + + + System + + + + + + + + + ); +} \ No newline at end of file diff --git a/src/modules/projects/ui/views/project-view.tsx b/src/modules/projects/ui/views/project-view.tsx index 186a4fc..590f398 100644 --- a/src/modules/projects/ui/views/project-view.tsx +++ b/src/modules/projects/ui/views/project-view.tsx @@ -8,13 +8,17 @@ import { ResizablePanelGroup, } from "@/components/ui/resizable" import MessagesContainer from "../components/messages-container"; -import { Suspense } from "react"; +import { Suspense, useState } from "react"; +import { Fragment } from "@/generated/prisma"; +import ProjectHeader from "../components/project-header"; interface Props { projectId: string } export default function ProjectView({ projectId }: Props) { + const [activeFragment, setActiveFragment] = useState(null); + return (
@@ -23,8 +27,15 @@ export default function ProjectView({ projectId }: Props) { minSize={20} className="flex flex-col min-h-0" > + Loading project...

}> + +
Loading messages

}> - +
From 311c61300d2c4b32a92f4c13228cc79ff9a89c38 Mon Sep 17 00:00:00 2001 From: devdezzies Date: Tue, 1 Jul 2025 12:48:59 +0700 Subject: [PATCH 2/2] removed refetchInterval --- src/modules/projects/ui/components/messages-container.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/projects/ui/components/messages-container.tsx b/src/modules/projects/ui/components/messages-container.tsx index 0bb6b3d..5e171ee 100644 --- a/src/modules/projects/ui/components/messages-container.tsx +++ b/src/modules/projects/ui/components/messages-container.tsx @@ -21,10 +21,7 @@ export default function MessagesContainer({ const trpc = useTRPC(); const { data: messages } = useSuspenseQuery(trpc.messages.getMany.queryOptions({ projectId: projectId - }, { - // TODO: THIS ACTUALLY REFETCHES EVERYTIME, FIX LATER - refetchInterval: 5000, - })); + })); useEffect(() => { const lastAssistantMessageWithFragment = messages.findLast(