Feat: 레이블링 링크 수정

This commit is contained in:
jhynsoo 2024-09-20 09:50:12 +09:00
parent 3181995e18
commit 8d49b7c2a7
4 changed files with 9 additions and 10 deletions

View File

@ -1,16 +1,17 @@
import { Compass } from 'lucide-react';
import { Link } from 'react-router-dom';
interface ProjectCardProps {
title: string;
description: string;
to?: string;
imageUrl?: string;
onClick?: () => void;
}
export default function ProjectCard({ title, description, imageUrl, onClick }: ProjectCardProps): JSX.Element {
export default function ProjectCard({ title, description, imageUrl = '', to = '' }: ProjectCardProps): JSX.Element {
return (
<div
onClick={onClick}
<Link
to={to}
className="relative flex w-[327px] cursor-pointer items-start gap-4 overflow-hidden rounded-lg border border-gray-200 bg-white p-4 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-800 dark:hover:text-gray-50"
>
<div className="flex h-24 w-24 items-center justify-center rounded-lg bg-gray-100">
@ -28,6 +29,6 @@ export default function ProjectCard({ title, description, imageUrl, onClick }: P
<div className="font-sans text-lg leading-tight text-black dark:text-white">{title}</div>
<div className="text-sm leading-tight text-gray-500 dark:text-gray-400">{description}</div>
</div>
</div>
</Link>
);
}

View File

@ -17,7 +17,7 @@ export default function WorkspaceSidebar({ workspaceName, projects }: { workspac
// const [selectedProjectId, setSelectedProjectId] = useState<string | undefined>();
const handleSelectProject = (projectId: string) => {
// setSelectedProjectId(projectId);
navigate(`${webPath.workspace()}/${workspaceId}/project/${projectId}`);
navigate(`${webPath.workspace()}/${workspaceId}/${projectId}`);
};
return (

View File

@ -113,10 +113,8 @@ function ProjectList({
<ProjectCard
key={project.id}
title={project.title}
to={`${webPath.workspace()}/${workspaceId}/${project.id}`}
description={project.projectType}
onClick={() => {
navigate(`${webPath.workspace()}/${workspaceId}/project/${project.id}`);
}}
/>
))}
</div>

View File

@ -67,7 +67,7 @@ const router = createBrowserRouter([
element: <LabelCanvas />,
},
{
path: 'project/:projectId',
path: ':projectId',
element: <LabelCanvas />,
},
],