From 7f06d5a30d20a82c9f40c8051716b1f104af392e Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:14:55 +0530 Subject: [PATCH] style: project list page revamp (#2448) --- web/components/headers/projects.tsx | 10 +- web/components/project/card.tsx | 185 ++++++++++++++-------------- web/types/projects.d.ts | 8 ++ 3 files changed, 108 insertions(+), 95 deletions(-) diff --git a/web/components/headers/projects.tsx b/web/components/headers/projects.tsx index 9cb4c35f3..b8f1f9636 100644 --- a/web/components/headers/projects.tsx +++ b/web/components/headers/projects.tsx @@ -39,10 +39,10 @@ export const ProjectsHeader = observer(() => {
-
- +
+ projectStore.setSearchQuery(e.target.value)} placeholder="Search" @@ -50,13 +50,13 @@ export const ProjectsHeader = observer(() => {
diff --git a/web/components/project/card.tsx b/web/components/project/card.tsx index 57e27d060..aa93dca3b 100644 --- a/web/components/project/card.tsx +++ b/web/components/project/card.tsx @@ -5,19 +5,20 @@ import { observer } from "mobx-react-lite"; import { useMobxStore } from "lib/mobx/store-provider"; import { RootStore } from "store/root"; // icons -import { CalendarDays, Link2Icon, Pencil, Plus, Star, Trash2 } from "lucide-react"; +import { Globe2, LinkIcon, Lock, Pencil, Star } from "lucide-react"; // hooks import useToast from "hooks/use-toast"; // ui -import { Tooltip } from "@plane/ui"; +import { Button, Tooltip } from "@plane/ui"; // helpers import { renderShortDateWithYearFormat } from "helpers/date-time.helper"; -import { copyTextToClipboard, truncateText } from "helpers/string.helper"; +import { copyTextToClipboard } from "helpers/string.helper"; import { renderEmoji } from "helpers/emoji.helper"; // types import type { IProject } from "types"; // components import { DeleteProjectModal, JoinProjectModal } from "components/project"; +import { AssigneesList } from "components/ui"; export type ProjectCardProps = { project: IProject; @@ -75,6 +76,8 @@ export const ProjectCard: React.FC = observer((props) => { }); }; + const projectMembersIds = project.members.map((member) => member.member_id); + return ( <> {/* Delete Project Modal */} @@ -83,6 +86,7 @@ export const ProjectCard: React.FC = observer((props) => { isOpen={deleteProjectModalOpen} onClose={() => setDeleteProjectModal(false)} /> + {/* Join Project Modal */} {workspaceSlug && ( = observer((props) => { )} {/* Card Information */} -
+
-
+
+
+ {project.name} -
- {!project.is_member ? ( - - ) : ( - Joined - )} -
-
- -
-
- {project.emoji ? ( - - {renderEmoji(project.emoji)} - - ) : project.icon_prop ? ( - renderEmoji(project.icon_prop) - ) : null} -
-
-
- -
- - -
-

{project.name}

-
-

{truncateText(project.description ?? "", 100)}

-
- -
- -
- - {renderShortDateWithYearFormat(project.created_at)} -
-
- {project.is_member ? ( -
-
+
+
+
+ + {project.emoji + ? renderEmoji(project.emoji) + : project.icon_prop + ? renderEmoji(project.icon_prop) + : null} + +
+ +
+

{project.name}

+ +

+ Created on {renderShortDateWithYearFormat(project?.created_at)} +

+ {project.network === 0 ? ( + + ) : ( + + )} +
+
+
+ +
+
+
+
+ +
+

{project.description}

+
+ 0 + ? project.members.map((member) => member?.member__display_name).join(", ") + : "No Assignee" + } + position="top" + > +
+ +
+
{(isOwner || isMember) && ( - - + + )} - {isOwner && ( -
- + Join +
- )} + ) : null}
- ) : null} -
-
+
+ +
); diff --git a/web/types/projects.d.ts b/web/types/projects.d.ts index e364e9aec..5ddfd64eb 100644 --- a/web/types/projects.d.ts +++ b/web/types/projects.d.ts @@ -33,6 +33,7 @@ export interface IProject { is_favorite: boolean; is_member: boolean; member_role: 5 | 10 | 15 | 20 | null; + members: IProjectMemberLite[]; issue_views_view: boolean; module_view: boolean; name: string; @@ -62,6 +63,13 @@ type ProjectPreferences = { }; }; +export interface IProjectMemberLite { + id: string; + member__avatar: string; + member__display_name: string; + member_id: string; +} + export interface IProjectMember { id: string; member: IUserMemberLite;