Skip to content

Commit

Permalink
fix: ui changes (#297)
Browse files Browse the repository at this point in the history
* fix: module card height and invalid date

* fix: issue details page title resizing fix
  • Loading branch information
anmolsinghbhatia committed Feb 17, 2023
1 parent 45319d8 commit 8c39717
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
25 changes: 19 additions & 6 deletions apps/app/components/issues/description-form.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect, useMemo } from "react";
import { FC, useCallback, useEffect, useMemo, useRef, useState } from "react";

import dynamic from "next/dynamic";

Expand Down Expand Up @@ -38,6 +38,8 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = ({
userAuth,
}) => {
const { setToastAlert } = useToast();
const [issueTitleName, setIssueTitleName] = useState("");
const textareaRef = useRef<HTMLTextAreaElement | null>(null);

const {
handleSubmit,
Expand Down Expand Up @@ -104,21 +106,32 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = ({

const isNotAllowed = userAuth.isGuest || userAuth.isViewer;

useEffect(() => {
if (textareaRef && textareaRef.current) {
textareaRef.current.style.height = "0px";
const scrollHeight = textareaRef.current.scrollHeight;
textareaRef.current.style.height = scrollHeight + "px";
}
}, [issueTitleName]);

return (
<div>
<Input
<textarea
id="name"
placeholder="Enter issue name"
name="name"
value={watch("name")}
autoComplete="off"
ref={textareaRef}
onChange={(e) => {
setIssueTitleName(e.target.value);
setValue("name", e.target.value);
debounceHandler();
}}
mode="transparent"
className="text-xl font-medium"
disabled={isNotAllowed}
required={true}
className="block px-3 py-2 text-xl
w-full overflow-hidden resize-none min-h-10
rounded border-none bg-transparent ring-0 focus:ring-1 focus:ring-theme outline-none "
role="textbox "
/>
<span>{errors.name ? errors.name.message : null}</span>
<RemirrorRichTextEditor
Expand Down
6 changes: 4 additions & 2 deletions apps/app/components/modules/single-module-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const SingleModuleCard: React.FC<Props> = ({ module }) => {
</CustomMenu>
</div>
<Link href={`/${workspaceSlug}/projects/${module.project}/modules/${module.id}`}>
<a className="flex flex-col cursor-pointer rounded-md border bg-white p-3 ">
<a className="flex flex-col justify-between h-full cursor-pointer rounded-md border bg-white p-3 ">
<span className="w-3/4 text-ellipsis overflow-hidden">{module.name}</span>
<div className="mt-4 grid grid-cols-2 gap-2 text-xs md:grid-cols-4">
<div className="space-y-2">
Expand All @@ -89,7 +89,9 @@ export const SingleModuleCard: React.FC<Props> = ({ module }) => {
<h6 className="text-gray-500">END DATE</h6>
<div className="flex w-min cursor-pointer items-center gap-1 whitespace-nowrap rounded border px-1.5 py-0.5 text-xs shadow-sm">
<CalendarDaysIcon className="h-3 w-3" />
{renderShortNumericDateFormat(module.target_date ?? "")}
{module.target_date
? renderShortNumericDateFormat(module?.target_date)
: "Invalid"}
</div>
</div>
<div className="space-y-2">
Expand Down

1 comment on commit 8c39717

@vercel
Copy link

@vercel vercel bot commented on 8c39717 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./apps/app

plane-dev-caravel.vercel.app
plane-dev-git-develop-caravel.vercel.app
plane-dev.vercel.app

Please sign in to comment.