From 0d2c399555b93fa873e190eba8da9472f0e5c10e Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Fri, 3 Nov 2023 19:17:50 +0530 Subject: [PATCH] style: quick add issue UI improvements in all the layouts (#2615) * style: quick add issue UI improvements in all the layouts * style: ui improvements * style: quick add icon size * chore: static sizes to tailwind classes --------- Co-authored-by: Aaryan Khandelwal --- .../calendar/inline-create-issue-form.tsx | 23 ++++-------- .../gantt/inline-create-issue-form.tsx | 36 ++++++------------ .../kanban/inline-create-issue-form.tsx | 23 ++++-------- .../issues/issue-layouts/list/block.tsx | 2 +- .../list/inline-create-issue-form.tsx | 37 ++++++++----------- .../spreadsheet/inline-create-issue-form.tsx | 35 +++++++----------- 6 files changed, 56 insertions(+), 100 deletions(-) diff --git a/web/components/issues/issue-layouts/calendar/inline-create-issue-form.tsx b/web/components/issues/issue-layouts/calendar/inline-create-issue-form.tsx index 18b76c449..deef5f1bc 100644 --- a/web/components/issues/issue-layouts/calendar/inline-create-issue-form.tsx +++ b/web/components/issues/issue-layouts/calendar/inline-create-issue-form.tsx @@ -1,6 +1,5 @@ import { useEffect, useRef, useState } from "react"; import { useRouter } from "next/router"; -import { Transition } from "@headlessui/react"; import { useForm } from "react-hook-form"; // store @@ -66,7 +65,7 @@ const Inputs = (props: any) => { return ( <> -

{projectDetails?.identifier ?? "..."}

+

{projectDetails?.identifier ?? "..."}

{ {...register("name", { required: "Issue title is required.", })} - className="w-full pr-2 py-1.5 rounded-md bg-transparent text-sm font-medium leading-5 text-custom-text-200 outline-none" + className="w-full pr-2 py-1.5 rounded-md bg-transparent text-xs font-medium leading-5 text-custom-text-200 outline-none" /> ); @@ -181,15 +180,7 @@ export const CalendarInlineCreateIssueForm: React.FC = observer((props) = return ( <> - + {isOpen && (
= observer((props) = >
-
+ )} {!isOpen && (
diff --git a/web/components/issues/issue-layouts/gantt/inline-create-issue-form.tsx b/web/components/issues/issue-layouts/gantt/inline-create-issue-form.tsx index bcdd1ba13..8ce451e2b 100644 --- a/web/components/issues/issue-layouts/gantt/inline-create-issue-form.tsx +++ b/web/components/issues/issue-layouts/gantt/inline-create-issue-form.tsx @@ -1,25 +1,21 @@ import { useEffect, useState, useRef } from "react"; import { useRouter } from "next/router"; import { useForm } from "react-hook-form"; -import { Transition } from "@headlessui/react"; -import { PlusIcon } from "lucide-react"; - -// store import { observer } from "mobx-react-lite"; +import { PlusIcon } from "lucide-react"; +// mobx store import { useMobxStore } from "lib/mobx/store-provider"; - -// constants -import { createIssuePayload } from "constants/issue"; - // hooks import useToast from "hooks/use-toast"; import useKeypress from "hooks/use-keypress"; import useProjectDetails from "hooks/use-project-details"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; - +// helpers +import { renderDateFormat } from "helpers/date-time.helper"; // types import { IIssue } from "types"; -import { renderDateFormat } from "helpers/date-time.helper"; +// constants +import { createIssuePayload } from "constants/issue"; type Props = { prePopulatedData?: Partial; @@ -149,25 +145,17 @@ export const GanttInlineCreateIssueForm: React.FC = observer((props) => { return ( <> - + {isOpen && (
-
-

{projectDetails?.identifier ?? "..."}

+
+

{projectDetails?.identifier ?? "..."}

- + )} {isOpen && (

@@ -181,7 +169,7 @@ export const GanttInlineCreateIssueForm: React.FC = observer((props) => { className="flex items-center gap-x-[6px] text-custom-primary-100 px-2 py-1 rounded-md" onClick={() => setIsOpen(true)} > - + New Issue )} diff --git a/web/components/issues/issue-layouts/kanban/inline-create-issue-form.tsx b/web/components/issues/issue-layouts/kanban/inline-create-issue-form.tsx index 764c8a7c6..750606ebb 100644 --- a/web/components/issues/issue-layouts/kanban/inline-create-issue-form.tsx +++ b/web/components/issues/issue-layouts/kanban/inline-create-issue-form.tsx @@ -1,7 +1,6 @@ import { useEffect, useState, useRef } from "react"; import { useRouter } from "next/router"; import { useForm } from "react-hook-form"; -import { Transition } from "@headlessui/react"; import { PlusIcon } from "lucide-react"; // store import { observer } from "mobx-react-lite"; @@ -39,7 +38,7 @@ const Inputs = (props: any) => { return (

-

{projectDetails?.identifier ?? "..."}

+

{projectDetails?.identifier ?? "..."}

= observer((props) => { return (
- + {isOpen && (
-
+ )} {isOpen && ( -

+

Press {"'"}Enter{"'"} to add another issue

)} @@ -178,10 +169,10 @@ export const BoardInlineCreateIssueForm: React.FC = observer((props) => { {!isOpen && ( )} diff --git a/web/components/issues/issue-layouts/list/block.tsx b/web/components/issues/issue-layouts/list/block.tsx index 80ebea869..41dbe1acb 100644 --- a/web/components/issues/issue-layouts/list/block.tsx +++ b/web/components/issues/issue-layouts/list/block.tsx @@ -26,7 +26,7 @@ export const IssueBlock: React.FC = (props) => { <>
{display_properties && display_properties?.key && ( -
+
{issue?.project_detail?.identifier}-{issue.sequence_id}
)} diff --git a/web/components/issues/issue-layouts/list/inline-create-issue-form.tsx b/web/components/issues/issue-layouts/list/inline-create-issue-form.tsx index 761fd7f9e..effc96acb 100644 --- a/web/components/issues/issue-layouts/list/inline-create-issue-form.tsx +++ b/web/components/issues/issue-layouts/list/inline-create-issue-form.tsx @@ -1,7 +1,6 @@ import { useEffect, useState, useRef } from "react"; import { useRouter } from "next/router"; import { useForm } from "react-hook-form"; -import { Transition } from "@headlessui/react"; // hooks import useToast from "hooks/use-toast"; @@ -39,7 +38,7 @@ const Inputs = (props: any) => { return ( <> -

{projectDetails?.identifier ?? "..."}

+

{projectDetails?.identifier ?? "..."}

= observer((props) => { return (
- + {isOpen && (
-
+ )} {isOpen && ( -

+

Press {"'"}Enter{"'"} to add another issue

)} {!isOpen && ( - +
+ +
)}
); diff --git a/web/components/issues/issue-layouts/spreadsheet/inline-create-issue-form.tsx b/web/components/issues/issue-layouts/spreadsheet/inline-create-issue-form.tsx index 5284d64e4..269ad5538 100644 --- a/web/components/issues/issue-layouts/spreadsheet/inline-create-issue-form.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/inline-create-issue-form.tsx @@ -1,7 +1,6 @@ import { useEffect, useState, useRef } from "react"; import { useRouter } from "next/router"; import { useForm } from "react-hook-form"; -import { Transition } from "@headlessui/react"; // hooks import useToast from "hooks/use-toast"; @@ -39,7 +38,7 @@ const Inputs = (props: any) => { return ( <> -

{projectDetails?.identifier ?? "..."}

+

{projectDetails?.identifier ?? "..."}

{ {...register("name", { required: "Issue title is required.", })} - className="w-full px-2 py-3 rounded-md bg-transparent text-sm font-medium leading-5 text-custom-text-200 outline-none" + className="w-full py-3 rounded-md bg-transparent text-sm leading-5 text-custom-text-200 outline-none" /> ); @@ -154,15 +153,7 @@ export const SpreadsheetInlineCreateIssueForm: React.FC = observer((props return (
- + {isOpen && (
= observer((props
-
+ )} {isOpen && (

@@ -181,14 +172,16 @@ export const SpreadsheetInlineCreateIssueForm: React.FC = observer((props )} {!isOpen && ( - +

+ +
)}
);