Merge branch 'fe/develop' of https://lab.ssafy.com/s11-s-project/S11P21S002 into fe/develop
This commit is contained in:
commit
7fb5ba10af
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -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 (
|
||||
|
@ -102,13 +102,10 @@ function ProjectList({ projects, workspaceId }: { projects: ProjectResponse[]; w
|
||||
{projects.map((project: ProjectResponse) => (
|
||||
<Link
|
||||
key={project.id}
|
||||
to={`${webPath.workspace()}/${workspaceId}/project/${project.id}`}
|
||||
>
|
||||
<ProjectCard
|
||||
title={project.title}
|
||||
description={project.projectType}
|
||||
/>
|
||||
</Link>
|
||||
title={project.title}
|
||||
to={`${webPath.workspace()}/${workspaceId}/${project.id}`}
|
||||
description={project.projectType}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
@ -67,7 +67,7 @@ const router = createBrowserRouter([
|
||||
element: <LabelCanvas />,
|
||||
},
|
||||
{
|
||||
path: 'project/:projectId',
|
||||
path: ':projectId',
|
||||
element: <LabelCanvas />,
|
||||
},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user