UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: переход в проект из карточки главной

This commit is contained in:
DCCONSTRUCTIONS 2026-04-24 12:20:15 +03:00
parent 2642a522f2
commit cf6fca20aa
2 changed files with 24 additions and 5 deletions

View File

@ -211,6 +211,7 @@ export const DashboardWidgets = observer(function DashboardWidgets(props: Dashbo
analyticsMap={analyticsMap}
recents={workspaceRecents}
selectedProjectId={selectedProjectId}
workspaceSlug={workspaceSlugValue}
onSelectProject={setSelectedProjectId}
/>
</div>

View File

@ -5,6 +5,7 @@
*/
import { FolderOpenDot, Layers3, Search, UsersRound } from "lucide-react";
import Link from "next/link";
import type { TActivityEntityData, TProjectAnalyticsCount } from "@plane/types";
import { Logo } from "@plane/propel/emoji-icon-picker";
import { cn } from "@plane/utils";
@ -19,6 +20,7 @@ type HomeProjectStackProps = {
orientation?: "horizontal" | "vertical";
recents?: TActivityEntityData[];
selectedProjectId: string | null;
workspaceSlug: string;
onSelectProject: (projectId: string) => void;
};
@ -34,6 +36,7 @@ export function HomeProjectStack(props: HomeProjectStackProps) {
orientation = "vertical",
recents,
selectedProjectId,
workspaceSlug,
onSelectProject,
} = props;
@ -87,16 +90,26 @@ export function HomeProjectStack(props: HomeProjectStackProps) {
const isActive = project.id === selectedProject?.id;
return (
<button
<div
key={project.id}
type="button"
className={cn("nodedc-home-project-card text-left", {
"nodedc-home-project-card-horizontal shrink-0": horizontal,
"absolute inset-x-0": !horizontal,
"cursor-default": isActive,
"cursor-pointer": !isActive,
})}
data-active={isActive}
role="button"
tabIndex={0}
aria-label={`Выбрать проект ${project.name}`}
onClick={() => onSelectProject(project.id)}
onKeyDown={(event) => {
if (event.target !== event.currentTarget) return;
if (event.key !== "Enter" && event.key !== " ") return;
event.preventDefault();
onSelectProject(project.id);
}}
style={
horizontal
? { zIndex: visibleProjects.length - index }
@ -115,10 +128,15 @@ export function HomeProjectStack(props: HomeProjectStackProps) {
<div className="absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(var(--nodedc-accent-rgb),0.28),transparent_34%),linear-gradient(160deg,rgba(5,5,8,0.08)_0%,rgba(5,5,8,0.42)_34%,rgba(5,5,8,0.84)_100%)]" />
<div className="relative flex h-full flex-col justify-between p-4">
<div className="flex items-start justify-between gap-3">
<div className="inline-flex items-center gap-2 rounded-full bg-black/25 px-2.5 py-1 text-[11px] font-medium text-white/[0.72] backdrop-blur-md">
<Link
href={`/${workspaceSlug}/projects/${project.id}/issues`}
className="inline-flex items-center gap-2 rounded-full bg-black/25 px-2.5 py-1 text-[11px] font-medium text-white/[0.72] backdrop-blur-md transition hover:bg-black/40 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-[rgb(var(--nodedc-accent-rgb))]"
aria-label={`Открыть проект ${project.name}`}
onClick={(event) => event.stopPropagation()}
>
<Logo logo={project.logo_props} size={14} />
<span>{project.identifier}</span>
</div>
</Link>
<div
className={cn(
"rounded-full px-2.5 py-1 text-[11px] font-semibold backdrop-blur-md",
@ -155,7 +173,7 @@ export function HomeProjectStack(props: HomeProjectStackProps) {
</div>
</div>
</div>
</button>
</div>
);
};