From 0d775003bf1b9456351eaf11fe1a39d206aaea3c Mon Sep 17 00:00:00 2001 From: akhisud3195 Date: Thu, 10 Apr 2025 11:44:22 +0530 Subject: [PATCH] Hide projects list behind CTA --- apps/rowboat/app/projects/select/app.tsx | 21 ++++++++++++--- .../select/components/search-projects.tsx | 27 ++++++++++++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/apps/rowboat/app/projects/select/app.tsx b/apps/rowboat/app/projects/select/app.tsx index 226431e3..6bf91aae 100644 --- a/apps/rowboat/app/projects/select/app.tsx +++ b/apps/rowboat/app/projects/select/app.tsx @@ -15,6 +15,8 @@ import { CustomPromptCard } from "./components/custom-prompt-card"; import { Submit } from "./components/submit-button"; import { PageHeading } from "@/components/ui/page-heading"; import { USE_MULTIPLE_PROJECTS } from "@/app/lib/feature_flags"; +import { FolderOpenIcon, XMarkIcon } from "@heroicons/react/24/outline"; +import { Button } from "@/components/ui/button"; const sectionHeaderStyles = clsx( "text-sm font-medium", @@ -39,6 +41,7 @@ const textareaStyles = clsx( export default function App() { const [projects, setProjects] = useState[]>([]); const [isLoading, setIsLoading] = useState(true); + const [isProjectPaneOpen, setIsProjectPaneOpen] = useState(false); const [selectedCard, setSelectedCard] = useState<'custom' | any>('custom'); const [customPrompt, setCustomPrompt] = useState(""); @@ -198,7 +201,7 @@ export default function App() { : "mt-8 -mx-12" )}> {/* Left side: Project Selection */} - {USE_MULTIPLE_PROJECTS && ( + {USE_MULTIPLE_PROJECTS && isProjectPaneOpen && (
setIsProjectPaneOpen(false)} />
)} @@ -213,7 +217,8 @@ export default function App() { {/* Right side: Project Creation */}
{USE_MULTIPLE_PROJECTS && ( -
+
Create a new project + {!isProjectPaneOpen && ( + + )}
)} diff --git a/apps/rowboat/app/projects/select/components/search-projects.tsx b/apps/rowboat/app/projects/select/components/search-projects.tsx index 1b6cbe0b..d00ede72 100644 --- a/apps/rowboat/app/projects/select/components/search-projects.tsx +++ b/apps/rowboat/app/projects/select/components/search-projects.tsx @@ -1,9 +1,10 @@ -import { Project } from "@/types/project_types"; +import { Project } from "@/app/lib/types/project_types"; import { z } from "zod"; import { ProjectList } from "./project-list"; import { SectionHeading } from "@/components/ui/section-heading"; import { HorizontalDivider } from "@/components/ui/horizontal-divider"; import clsx from 'clsx'; +import { XMarkIcon } from "@heroicons/react/24/outline"; interface SearchProjectsProps { projects: z.infer[]; @@ -11,6 +12,7 @@ interface SearchProjectsProps { heading: string; subheading: string; className?: string; + onClose?: () => void; } export function SearchProjects({ @@ -18,16 +20,27 @@ export function SearchProjects({ isLoading, heading, subheading, - className + className, + onClose }: SearchProjectsProps) { return (
- - {heading} - +
+ + {heading} + + {onClose && ( + + )} +