From 22656d011462b2a9ada7b78b0d271074a48263d4 Mon Sep 17 00:00:00 2001
From: Akshita Goyal <36129505+gakshita@users.noreply.github.com>
Date: Wed, 4 Sep 2024 14:38:30 +0530
Subject: [PATCH] [WEB-2273] Chore: header UI (#5467)
* chore: headers + common containers
* fix: filters code splitting
* fix: home header
* fix: header changes
* fix: uncommented filters
* fix: used enums
* fix: enum changes
---
.../tailwind-config-custom/tailwind.config.js | 22 +-
packages/ui/src/header/header.tsx | 39 +++
packages/ui/src/header/helper.tsx | 25 ++
packages/ui/src/header/index.ts | 1 +
packages/ui/src/index.ts | 2 +
packages/ui/src/row/helper.tsx | 12 +
packages/ui/src/row/index.ts | 1 +
packages/ui/src/row/row.tsx | 25 ++
.../(projects)/active-cycles/header.tsx | 36 +--
.../(projects)/analytics/header.tsx | 62 ++--
.../(projects)/analytics/page.tsx | 39 +--
web/app/[workspaceSlug]/(projects)/header.tsx | 14 +-
.../(projects)/profile/[userId]/header.tsx | 10 +-
.../(projects)/profile/[userId]/navbar.tsx | 5 +-
.../(detail)/[projectId]/archives/header.tsx | 14 +-
.../archives/issues/(detail)/header.tsx | 124 +++----
.../cycles/(detail)/[cycleId]/page.tsx | 2 +-
.../[projectId]/cycles/(detail)/header.tsx | 12 +-
.../[projectId]/cycles/(list)/header.tsx | 90 +++---
.../[projectId]/cycles/(list)/page.tsx | 5 +-
.../(detail)/[projectId]/inbox/header.tsx | 43 +--
.../[projectId]/issues/(detail)/header.tsx | 30 +-
.../[projectId]/issues/(list)/header.tsx | 291 +++++------------
.../modules/(detail)/[moduleId]/page.tsx | 2 +-
.../[projectId]/modules/(detail)/header.tsx | 303 +++++++++---------
.../[projectId]/modules/(list)/header.tsx | 18 +-
.../[projectId]/modules/(list)/page.tsx | 24 +-
.../[projectId]/pages/(detail)/header.tsx | 24 +-
.../[projectId]/pages/(list)/header.tsx | 48 +--
.../(detail)/[projectId]/settings/header.tsx | 10 +-
.../views/(detail)/[viewId]/header.tsx | 30 +-
.../[projectId]/views/(list)/header.tsx | 99 ++----
.../[projectId]/views/(list)/page.tsx | 40 ++-
.../(projects)/settings/header.tsx | 38 ++-
.../(projects)/workspace-views/header.tsx | 19 +-
.../components/common/breadcrumb-link.tsx | 2 +-
web/core/components/core/app-header.tsx | 19 +-
.../content/inbox-issue-mobile-header.tsx | 8 +-
.../inbox-filter/applied-filters/root.tsx | 5 +-
.../components/inbox/inbox-filter/root.tsx | 24 +-
.../inbox/inbox-filter/sorting/order-by.tsx | 26 +-
web/core/components/inbox/sidebar/root.tsx | 9 +-
web/core/components/issues/filters.tsx | 143 +++++++++
.../filters/applied-filters/filters-list.tsx | 2 +-
.../applied-filters/roots/cycle-root.tsx | 22 +-
.../roots/global-view-root.tsx | 51 ++-
.../applied-filters/roots/module-root.tsx | 22 +-
.../applied-filters/roots/project-root.tsx | 5 +-
.../roots/project-view-root.tsx | 9 +-
.../modules/applied-filters/root.tsx | 159 ++++-----
.../pages/editor/header/extra-options.tsx | 2 +-
.../pages/editor/header/mobile-root.tsx | 11 +-
.../components/pages/editor/header/root.tsx | 12 +-
web/core/components/pages/header/root.tsx | 17 +-
.../components/pages/list/search-input.tsx | 9 +-
.../project/applied-filters/root.tsx | 4 +-
web/core/components/project/filters.tsx | 93 ++++++
web/core/components/project/header.tsx | 118 ++-----
web/core/components/project/root.tsx | 18 +-
.../layouts/spreadsheet-layout-loader.tsx | 2 +-
.../sidebar/filters/applied-filter.tsx | 49 +--
.../sidebar/header/root.tsx | 15 +-
.../workspace-notifications/sidebar/root.tsx | 15 +-
.../components/workspace/views/header.tsx | 45 +--
64 files changed, 1356 insertions(+), 1119 deletions(-)
create mode 100644 packages/ui/src/header/header.tsx
create mode 100644 packages/ui/src/header/helper.tsx
create mode 100644 packages/ui/src/header/index.ts
create mode 100644 packages/ui/src/row/helper.tsx
create mode 100644 packages/ui/src/row/index.ts
create mode 100644 packages/ui/src/row/row.tsx
create mode 100644 web/core/components/issues/filters.tsx
create mode 100644 web/core/components/project/filters.tsx
diff --git a/packages/tailwind-config-custom/tailwind.config.js b/packages/tailwind-config-custom/tailwind.config.js
index 4f032e0f8..a708a6221 100644
--- a/packages/tailwind-config-custom/tailwind.config.js
+++ b/packages/tailwind-config-custom/tailwind.config.js
@@ -333,6 +333,8 @@ module.exports = {
72: "16.2rem",
80: "18rem",
96: "21.6rem",
+ "page-x": "1.35rem",
+ "page-y": "1.35rem"
},
margin: {
0: "0",
@@ -434,5 +436,23 @@ module.exports = {
custom: ["Inter", "sans-serif"],
},
},
- plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],
+ plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography"), function({ addUtilities }) {
+ const newUtilities = {
+ // Mobile screens
+ '.px-page-x': {
+ paddingLeft: '0.675rem',
+ paddingRight: '0.675rem',
+ },
+ // Medium screens (768px and up)
+ '@media (min-width: 768px)': {
+ '.px-page-x': {
+ paddingLeft: '1.35rem',
+ paddingRight: '1.35rem',
+ },
+ }
+ };
+
+ addUtilities(newUtilities, ['responsive']);
+ },
+],
};
diff --git a/packages/ui/src/header/header.tsx b/packages/ui/src/header/header.tsx
new file mode 100644
index 000000000..97b7ed2eb
--- /dev/null
+++ b/packages/ui/src/header/header.tsx
@@ -0,0 +1,39 @@
+import * as React from "react";
+import { cn } from "../../helpers";
+import { EHeaderVariant, getHeaderStyle, THeaderVariant } from "./helper";
+import { ERowVariant, CustomRow } from "../row";
+
+export interface CustomHeaderProps {
+ variant?: THeaderVariant;
+ setHeight?: boolean;
+ className?: string;
+ children: React.ReactNode;
+}
+
+const CustomHeader = (props: CustomHeaderProps) => {
+ const { variant = EHeaderVariant.PRIMARY, className = "", setHeight = true, children, ...rest } = props;
+
+ const style = getHeaderStyle(variant, setHeight);
+ return (
+
{moduleDetails?.name && moduleDetails.name}
- {issuesCount && issuesCount > 0 ? ( -{moduleDetails?.name && moduleDetails.name}
+ {issuesCount && issuesCount > 0 ? ( +