diff --git a/apps/web/client/src/app/projects/_components/select-presentation.tsx b/apps/web/client/src/app/projects/_components/select-presentation.tsx index c202357ab3..c330a2b5ed 100644 --- a/apps/web/client/src/app/projects/_components/select-presentation.tsx +++ b/apps/web/client/src/app/projects/_components/select-presentation.tsx @@ -1,19 +1,19 @@ 'use client'; import { useEffect, useMemo, useRef, useState } from 'react'; -import { Carousel } from './carousel'; import { AnimatePresence, motion } from 'motion/react'; import type { Project } from '@onlook/models'; import { Button } from '@onlook/ui/button'; import { Icons } from '@onlook/ui/icons'; -import { Templates } from './templates'; -import { TemplateModalPresentation } from './templates/template-modal-presentation'; +import { Carousel } from './carousel'; import { HighlightText } from './select/highlight-text'; import { MasonryLayout } from './select/masonry-layout'; import { ProjectCardPresentation } from './select/project-card-presentation'; import { SquareProjectCardPresentation } from './select/square-project-card-presentation'; +import { Templates } from './templates'; +import { TemplateModalPresentation } from './templates/template-modal-presentation'; interface SelectProjectPresentationProps { /** All projects including templates */ @@ -230,11 +230,7 @@ export const SelectProjectPresentation = ({ Create a new project to get started
- + + e.stopPropagation()} + > + {onRename && ( + { + event.preventDefault(); + onRename(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + + Rename Project + + )} + {onClone && ( + { + event.preventDefault(); + onClone(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + + Clone Project + + )} + {onToggleTemplate && ( + { + event.preventDefault(); + onToggleTemplate(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + {isTemplate ? ( + <> + + Unmark as template + + ) : ( + <> + + Convert to template + + )} + + )} + {onDelete && ( + { + event.preventDefault(); + onDelete(project); + }} + className="gap-2 text-red-400 hover:!bg-red-200/80 hover:!text-red-700 dark:text-red-200 dark:hover:!bg-red-800 dark:hover:!text-red-100" + > + + Delete Project + + )} + + +
{onClick && ( -
+
)} -
-
+
+
{HighlightText ? ( ) : ( project.name )}
-
+
{lastUpdated} ago
diff --git a/apps/web/client/src/stories/ProjectsPage.stories.tsx b/apps/web/client/src/stories/ProjectsPage.stories.tsx index 016d4f95f1..1f78c62484 100644 --- a/apps/web/client/src/stories/ProjectsPage.stories.tsx +++ b/apps/web/client/src/stories/ProjectsPage.stories.tsx @@ -4,6 +4,7 @@ import { SelectProjectPresentation } from '@/app/projects/_components/select-pre import type { Project, User } from '@onlook/models'; import { fn } from '@storybook/test'; import { useState } from 'react'; +import { v4 as uuidv4 } from 'uuid'; /** * ProjectsPageComposed - Full projects page combining TopBar and SelectProject. @@ -80,7 +81,7 @@ type Story = StoryObj; // Helper to create mock projects const createMockProject = (overrides?: Partial): Project => ({ - id: crypto.randomUUID(), + id: uuidv4(), name: 'Project Name', metadata: { createdAt: new Date('2024-01-01'),