From cc79e906234e07b053a32817305beaad490a6898 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Mon, 22 Jul 2024 12:47:57 +0530 Subject: [PATCH 1/2] chore: sidebar navigation item refactor --- .../(detail)/[projectId]/settings/sidebar.tsx | 14 ++++++------ .../(projects)/settings/sidebar.tsx | 20 ++++++++--------- web/app/profile/sidebar.tsx | 22 ++++++++++--------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/settings/sidebar.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/settings/sidebar.tsx index af5e5355a76..0b9a94f82e0 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/settings/sidebar.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/settings/sidebar.tsx @@ -5,6 +5,8 @@ import Link from "next/link"; import { useParams, usePathname } from "next/navigation"; // ui import { Loader } from "@plane/ui"; +// components +import { SidebarNavItem } from "@/components/sidebar"; // constants import { EUserProjectRoles, PROJECT_SETTINGS_LINKS } from "@/constants/project"; // hooks @@ -44,15 +46,13 @@ export const ProjectSettingsSidebar = () => { (link) => projectMemberInfo >= link.access && ( -
{link.label} -
+ ) )} diff --git a/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx b/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx index 642a89bc42c..0dc206f2b0f 100644 --- a/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx +++ b/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx @@ -4,6 +4,8 @@ import React from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useParams, usePathname } from "next/navigation"; +// components +import { SidebarNavItem } from "@/components/sidebar"; // constants import { EUserWorkspaceRoles } from "@/constants/workspace"; // hooks @@ -31,17 +33,13 @@ export const WorkspaceSettingsSidebar = observer(() => { (link) => workspaceMemberInfo >= link.access && ( - -
- {link.label} -
-
+ + {link.label} + ) )} diff --git a/web/app/profile/sidebar.tsx b/web/app/profile/sidebar.tsx index 8d4cebbdefb..751dee61d2c 100644 --- a/web/app/profile/sidebar.tsx +++ b/web/app/profile/sidebar.tsx @@ -8,6 +8,8 @@ import { usePathname } from "next/navigation"; import { ChevronLeft, LogOut, MoveLeft, Plus, UserPlus } from "lucide-react"; // ui import { TOAST_TYPE, Tooltip, setToast } from "@plane/ui"; +// components +import { SidebarNavItem } from "@/components/sidebar"; // constants import { PROFILE_ACTION_LINKS } from "@/constants/profile"; // hooks @@ -119,7 +121,7 @@ export const ProfileLayoutSidebar = observer(() => { {!sidebarCollapsed && (
Your account
)} -
+
{PROFILE_ACTION_LINKS.map((link) => { if (link.key === "change-password" && currentUser?.is_password_autoset) return null; @@ -132,16 +134,16 @@ export const ProfileLayoutSidebar = observer(() => { disabled={!sidebarCollapsed} isMobile={isMobile} > -
- {} - {!sidebarCollapsed && link.label} -
+
+ + {!sidebarCollapsed &&

{link.label}

} +
+ ); From ac11f0b28945281781c44ea57126af3c927dd5bd Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Mon, 22 Jul 2024 14:13:38 +0530 Subject: [PATCH 2/2] chore: module and cycle sidebar padding adjustment --- web/core/components/cycles/analytics-sidebar/root.tsx | 7 +++++-- web/core/components/cycles/cycle-peek-overview.tsx | 1 + web/core/components/modules/analytics-sidebar/root.tsx | 7 +++++-- web/core/components/modules/module-peek-overview.tsx | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/web/core/components/cycles/analytics-sidebar/root.tsx b/web/core/components/cycles/analytics-sidebar/root.tsx index fe6fab9d20b..d4ec768cc38 100644 --- a/web/core/components/cycles/analytics-sidebar/root.tsx +++ b/web/core/components/cycles/analytics-sidebar/root.tsx @@ -33,6 +33,7 @@ type Props = { cycleId: string; handleClose: () => void; isArchived?: boolean; + isPeekMode?: boolean; }; const defaultValues: Partial = { @@ -45,7 +46,7 @@ const cycleService = new CycleService(); // TODO: refactor the whole component export const CycleDetailsSidebar: React.FC = observer((props) => { - const { cycleId, handleClose, isArchived } = props; + const { cycleId, handleClose, isArchived, isPeekMode = false } = props; // states const [archiveCycleModal, setArchiveCycleModal] = useState(false); const [cycleDeleteModal, setCycleDeleteModal] = useState(false); @@ -260,7 +261,9 @@ export const CycleDetailsSidebar: React.FC = observer((props) => { )} <> -
+
)} diff --git a/web/core/components/modules/analytics-sidebar/root.tsx b/web/core/components/modules/analytics-sidebar/root.tsx index 9b78d322e78..79114859544 100644 --- a/web/core/components/modules/analytics-sidebar/root.tsx +++ b/web/core/components/modules/analytics-sidebar/root.tsx @@ -63,11 +63,12 @@ type Props = { moduleId: string; handleClose: () => void; isArchived?: boolean; + isPeekMode?: boolean; }; // TODO: refactor this component export const ModuleAnalyticsSidebar: React.FC = observer((props) => { - const { moduleId, handleClose, isArchived } = props; + const { moduleId, handleClose, isArchived, isPeekMode = false } = props; // states const [moduleDeleteModal, setModuleDeleteModal] = useState(false); const [archiveModuleModal, setArchiveModuleModal] = useState(false); @@ -309,7 +310,9 @@ export const ModuleAnalyticsSidebar: React.FC = observer((props) => { )} setModuleDeleteModal(false)} data={moduleDetails} /> <> -
+
)}