11import { useCallback , useEffect , useRef } from "react" ;
2+ import { usePathname } from "next/navigation" ;
23import { Controller , useForm } from "react-hook-form" ;
34// plane editor
45import { EditorRefApi } from "@plane/editor" ;
56// plane types
67import { TSticky } from "@plane/types" ;
78// plane utils
8- import { isCommentEmpty } from "@plane/utils" ;
9+ import { cn , isCommentEmpty } from "@plane/utils" ;
910// hooks
1011import { useWorkspace } from "@/hooks/store" ;
1112// components
@@ -25,10 +26,13 @@ export const StickyInput = (props: TProps) => {
2526 const { stickyData, workspaceSlug, handleUpdate, stickyId, handleDelete, handleChange, showToolbar } = props ;
2627 // refs
2728 const editorRef = useRef < EditorRefApi > ( null ) ;
29+ // navigation
30+ const pathname = usePathname ( ) ;
2831 // store hooks
2932 const { getWorkspaceBySlug } = useWorkspace ( ) ;
3033 // derived values
3134 const workspaceId = getWorkspaceBySlug ( workspaceSlug ) ?. id ?. toString ( ) ?? "" ;
35+ const isStickiesPage = pathname ?. includes ( "stickies" ) ;
3236 // form info
3337 const { handleSubmit, reset, control } = useForm < TSticky > ( {
3438 defaultValues : {
@@ -74,10 +78,15 @@ export const StickyInput = (props: TProps) => {
7478 if ( ! isContentEmpty ) return "" ;
7579 return "Click to type here" ;
7680 } }
77- containerClassName = "px-0 text-base min-h-[250px] w-full"
81+ containerClassName = { cn (
82+ "w-full min-h-[256px] max-h-[540px] overflow-y-scroll vertical-scrollbar scrollbar-sm p-4 text-base" ,
83+ {
84+ "max-h-[588px]" : isStickiesPage ,
85+ }
86+ ) }
7887 uploadFile = { async ( ) => "" }
7988 showToolbar = { showToolbar }
80- parentClassName = { "border-none p-0" }
89+ parentClassName = "border-none p-0"
8190 handleDelete = { handleDelete }
8291 handleColorChange = { handleChange }
8392 ref = { editorRef }
0 commit comments