From 345a5aac6f82ebcd8e87c5f0bd3cd3fca8ecd982 Mon Sep 17 00:00:00 2001 From: AkshatM1707 Date: Fri, 20 Jun 2025 16:19:31 +0530 Subject: [PATCH] [fixed new board button issue][Changed frontend] --- app/(dashboard)/_components/board-list.tsx | 129 +++++++--- app/(dashboard)/_components/org-sidebar.tsx | 224 +++++++++++++----- app/(dashboard)/_components/sidebar/index.tsx | 16 +- app/(dashboard)/layout.tsx | 68 +++++- app/board/[boardid]/page.tsx | 28 ++- 5 files changed, 350 insertions(+), 115 deletions(-) diff --git a/app/(dashboard)/_components/board-list.tsx b/app/(dashboard)/_components/board-list.tsx index 0e8cd11..9e4f6a8 100644 --- a/app/(dashboard)/_components/board-list.tsx +++ b/app/(dashboard)/_components/board-list.tsx @@ -1,7 +1,7 @@ "use client"; import { useSearchParams } from "next/navigation"; -import { useMemo } from "react"; +import { useMemo, useEffect } from "react"; import { EmptySearch } from "./empty-search"; import { EmptyFavorites } from "./empty-favorites"; import { EmptyBoards } from "./empty-boards"; @@ -17,7 +17,27 @@ interface BoardListProps { export const BoardList = ({ orgId }: BoardListProps) => { const searchParams = useSearchParams(); - // Use `useMemo()` to extract values safely + // Inject keyframes dynamically since no global CSS is used + useEffect(() => { + const style = document.createElement("style"); + style.innerHTML = ` + @keyframes orb1 { + 0% { transform: translate(0, 0) scale(1); } + 50% { transform: translate(30px, 20px) scale(1.1); } + 100% { transform: translate(0, 0) scale(1); } + } + @keyframes orb2 { + 0% { transform: translate(0, 0) scale(1); } + 50% { transform: translate(-30px, -20px) scale(1.1); } + 100% { transform: translate(0, 0) scale(1); } + } + `; + document.head.appendChild(style); + return () => { + document.head.removeChild(style); + }; + }, []); + const search = useMemo( () => searchParams.get("search") || undefined, [searchParams] @@ -27,21 +47,43 @@ export const BoardList = ({ orgId }: BoardListProps) => { [searchParams] ); - // Fetch data using query params const data = useQuery(api.boards.get, { orgId, search, favorites }); if (data === undefined) { return ( -
-

- {favorites ? "Favorite Boards" : "Team Boards"} -

-
- - - - - +
+ {/* Beautiful Background */} +
+
+
+
+
+
+ +
+

+ {favorites ? "Favorite Boards" : "Team Boards"} +

+
+ + + + + +
); @@ -60,25 +102,48 @@ export const BoardList = ({ orgId }: BoardListProps) => { } return ( -
-

- {favorites ? "Favorite Boards" : "Team Boards"} -

-
- - {data.map((board) => ( - - ))} +
+ +
+
+
+
+
+
+ +
+

+ {favorites ? "Favorite Boards" : "Team Boards"} +

+
+ + {data.map((board) => ( + + ))} +
); diff --git a/app/(dashboard)/_components/org-sidebar.tsx b/app/(dashboard)/_components/org-sidebar.tsx index 3e0c66d..683d73c 100644 --- a/app/(dashboard)/_components/org-sidebar.tsx +++ b/app/(dashboard)/_components/org-sidebar.tsx @@ -1,13 +1,14 @@ "use client"; + import Link from "next/link"; import Image from "next/image"; import { Poppins } from "next/font/google"; import { cn } from "@/lib/utils"; import { OrganizationSwitcher } from "@clerk/nextjs"; import { Button } from "@/components/ui/button"; -import { LayoutDashboard, Star } from "lucide-react"; - +import { LayoutDashboard, Star, Sparkles, Grid3X3 } from "lucide-react"; import { useSearchParams } from "next/navigation"; + const font = Poppins({ subsets: ["latin"], weight: ["600"], @@ -18,67 +19,170 @@ export const OrgSidebar = () => { const favorites = searchParams.get("favorites"); return ( -
- -
- logo - - Board - -
- - -
- - + + + +
+ +
+ Favorite Boards + + +
+ + {/* Stats or Additional Info */} +
+
+
+ Quick Stats +
+ + {/* Tip 1 */} +
+ Create, collaborate, and innovate with your team in real-time. +
+ + {/* Tip 2 */} +
+ + You can favorite boards by clicking the star icon on them. +
+ + {/* Tip 3 */} +
+ Switch between multiple workspaces using the workspace switcher . +
+ + {/* Tip 4 */} +
+ Organize your boards into teams for better project management. +
+ + {/* Tip 5 +
+ Drag and move elements on boards effortlessly—just like sticky notes. +
*/} + + {/* Tip 6 */} +
+ Hover over board tiles for quick actions like renaming or deleting. +
+ + {/* Tip 7 +
+ Enjoy smooth cross-device collaboration—your boards stay synced everywhere. +
*/} +
+
+
); -}; +}; \ No newline at end of file diff --git a/app/(dashboard)/_components/sidebar/index.tsx b/app/(dashboard)/_components/sidebar/index.tsx index 0f64d0d..8980fc1 100644 --- a/app/(dashboard)/_components/sidebar/index.tsx +++ b/app/(dashboard)/_components/sidebar/index.tsx @@ -3,9 +3,17 @@ import { NewButton } from "./new-button"; export const Sidebar = () => { return ( -