From c6d6b9a0e938a003364dd7615a29806d14988387 Mon Sep 17 00:00:00 2001 From: Ramesh Kumar Chandra <31303617+rameshkumarchandra@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:22:24 +0530 Subject: [PATCH] style/responsive sidebar (#3505) * style: added sidebar toggle in all the screens for mobile responsive * chore: close sidebar on click of empty space when opened * chore: setting the sidebar collapsed in smaller screens --- .../sidebar/sidebar-menu-hamburger-toggle.tsx | 16 ++++++ .../dashboard/widgets/overview-stats.tsx | 49 ++++++++----------- web/components/headers/cycle-issues.tsx | 2 + web/components/headers/cycles.tsx | 3 ++ web/components/headers/global-issues.tsx | 4 +- web/components/headers/module-issues.tsx | 2 + web/components/headers/modules-list.tsx | 3 ++ web/components/headers/page-details.tsx | 3 ++ web/components/headers/pages.tsx | 3 ++ .../project-archived-issue-details.tsx | 3 ++ .../headers/project-archived-issues.tsx | 2 + .../headers/project-draft-issues.tsx | 2 + web/components/headers/project-inbox.tsx | 2 + .../headers/project-issue-details.tsx | 3 ++ web/components/headers/project-issues.tsx | 2 + web/components/headers/project-settings.tsx | 3 ++ .../headers/project-view-issues.tsx | 2 + web/components/headers/project-views.tsx | 2 + web/components/headers/projects.tsx | 3 ++ web/components/headers/user-profile.tsx | 3 ++ .../headers/workspace-active-cycles.tsx | 2 + .../headers/workspace-analytics.tsx | 3 ++ .../headers/workspace-dashboard.tsx | 4 +- web/components/headers/workspace-settings.tsx | 6 +-- web/components/project/sidebar-list-item.tsx | 45 +++++++++-------- web/components/workspace/sidebar-dropdown.tsx | 47 ++++++++++-------- web/components/workspace/sidebar-menu.tsx | 20 +++++--- web/layouts/app-layout/sidebar.tsx | 45 ++++++++++++++--- 28 files changed, 195 insertions(+), 89 deletions(-) create mode 100644 web/components/core/sidebar/sidebar-menu-hamburger-toggle.tsx diff --git a/web/components/core/sidebar/sidebar-menu-hamburger-toggle.tsx b/web/components/core/sidebar/sidebar-menu-hamburger-toggle.tsx new file mode 100644 index 000000000..0e34eac2c --- /dev/null +++ b/web/components/core/sidebar/sidebar-menu-hamburger-toggle.tsx @@ -0,0 +1,16 @@ +import { FC } from "react"; +import { Menu } from "lucide-react"; +import { useApplication } from "hooks/store"; +import { observer } from "mobx-react"; + +export const SidebarHamburgerToggle: FC = observer (() => { + const { theme: themStore } = useApplication(); + return ( +
themStore.toggleSidebar()} + > + +
+ ); +}); diff --git a/web/components/dashboard/widgets/overview-stats.tsx b/web/components/dashboard/widgets/overview-stats.tsx index 3af080dc3..418f0c63f 100644 --- a/web/components/dashboard/widgets/overview-stats.tsx +++ b/web/components/dashboard/widgets/overview-stats.tsx @@ -63,34 +63,27 @@ export const OverviewStatsWidget: React.FC = observer((props) => { if (!widgetStats) return ; return ( -
- {STATS_LIST.map((stat, index) => { - const isFirst = index === 0; - const isLast = index === STATS_LIST.length - 1; - const isMiddle = !isFirst && !isLast; - - return ( -
- {!isLast && ( -
- )} - -
{stat.count}
-

{stat.title}

- -
- ); - })} +
+ {STATS_LIST.map((stat) => ( +
+ +
+
+
{stat.count}
+

{stat.title}

+
+
+ +
+ ))}
); }); diff --git a/web/components/headers/cycle-issues.tsx b/web/components/headers/cycle-issues.tsx index 949c192fa..fc0075030 100644 --- a/web/components/headers/cycle-issues.tsx +++ b/web/components/headers/cycle-issues.tsx @@ -17,6 +17,7 @@ import useLocalStorage from "hooks/use-local-storage"; // components import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { ProjectAnalyticsModal } from "components/analytics"; +import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; // ui import { Breadcrumbs, Button, ContrastIcon, CustomMenu } from "@plane/ui"; // icons @@ -146,6 +147,7 @@ export const CycleIssuesHeader: React.FC = observer(() => { />
+ { // router @@ -30,6 +32,7 @@ export const CyclesHeader: FC = observer(() => { return (
+
= observer((props) => { <> setCreateViewModal(false)} />
-
+
+ { />
+ { // router @@ -31,6 +33,7 @@ export const ModulesListHeader: React.FC = observer(() => { return (
+
= observer((props) => { return (
+
{ // router @@ -29,6 +31,7 @@ export const PagesHeader = observer(() => { return (
+
{ return (
+
{ return (
+