Skip to content

Commit 55d6806

Browse files
committed
fix: stickies height
1 parent 7f22cd1 commit 55d6806

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

web/core/components/editor/sticky-editor/editor.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ import React, { useState } from "react";
33
import { EIssueCommentAccessSpecifier } from "@plane/constants";
44
// plane editor
55
import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/editor";
6-
// components
6+
// plane types
77
import { TSticky } from "@plane/types";
88
// helpers
99
import { cn } from "@/helpers/common.helper";
1010
import { getEditorFileHandlers } from "@/helpers/editor.helper";
11-
// hooks
1211
// plane web hooks
1312
import { useEditorFlagging } from "@/plane-web/hooks/use-editor-flagging";
1413
import { useFileSize } from "@/plane-web/hooks/use-file-size";
@@ -60,7 +59,7 @@ export const StickyEditor = React.forwardRef<EditorRefApi, StickyEditorWrapperPr
6059

6160
return (
6261
<div
63-
className={cn("relative border border-custom-border-200 rounded p-3", parentClassName)}
62+
className={cn("relative border border-custom-border-200 rounded", parentClassName)}
6463
onFocus={() => !showToolbarInitially && setIsFocused(true)}
6564
onBlur={() => !showToolbarInitially && setIsFocused(false)}
6665
>
@@ -82,10 +81,10 @@ export const StickyEditor = React.forwardRef<EditorRefApi, StickyEditorWrapperPr
8281
/>
8382
{showToolbar && (
8483
<div
85-
className={cn(
86-
"transition-all duration-300 ease-out origin-top",
87-
isFocused ? "max-h-[200px] opacity-100 scale-y-100 mt-3" : "max-h-0 opacity-0 scale-y-0 invisible"
88-
)}
84+
className={cn("transition-all duration-300 ease-out origin-top px-4 h-[60px]", {
85+
"max-h-[60px] opacity-100 scale-y-100": isFocused,
86+
"max-h-0 opacity-0 scale-y-0 invisible": !isFocused,
87+
})}
8988
>
9089
<StickyEditorToolbar
9190
executeCommand={(item) => {

web/core/components/editor/sticky-editor/toolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const StickyEditorToolbar: React.FC<Props> = (props) => {
5858
useOutsideClickDetector(colorPaletteRef, () => setShowColorPalette(false));
5959

6060
return (
61-
<div className="flex w-full justify-between mt-2 h-full">
61+
<div className="flex w-full justify-between h-full">
6262
<div className="flex my-auto gap-4" ref={colorPaletteRef}>
6363
{/* color palette */}
6464
{showColorPalette && <ColorPalette handleUpdate={handleColorChange} />}

web/core/components/stickies/layout/sticky-dnd-wrapper.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ export const StickyDNDWrapper = observer((props: Props) => {
121121
}, [handleDrop, isDragging, isLastChild, pathname, stickyId, workspaceSlug]);
122122

123123
return (
124-
<div className="flex min-h-[300px] box-border p-2 flex-col" style={{ width: itemWidth }}>
124+
<div
125+
className="flex flex-col box-border p-[8px]"
126+
style={{
127+
width: itemWidth,
128+
}}
129+
>
125130
{!isInFirstRow && <DropIndicator isVisible={instruction === "reorder-above"} />}
126131
<StickyNote
127132
key={stickyId || "new"}

web/core/components/stickies/sticky/inputs.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { useCallback, useEffect, useRef } from "react";
2+
import { usePathname } from "next/navigation";
23
import { Controller, useForm } from "react-hook-form";
34
// plane editor
45
import { EditorRefApi } from "@plane/editor";
56
// plane types
67
import { TSticky } from "@plane/types";
78
// plane utils
8-
import { isCommentEmpty } from "@plane/utils";
9+
import { cn, isCommentEmpty } from "@plane/utils";
910
// hooks
1011
import { 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}

web/core/components/stickies/sticky/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const StickyNote = observer((props: TProps) => {
7474
handleClose={() => setIsDeleteModalOpen(false)}
7575
/>
7676
<div
77-
className={cn("w-full flex flex-col h-fit rounded p-4 group/sticky max-h-[650px] overflow-y-scroll", className)}
77+
className={cn("w-full h-fit flex flex-col rounded group/sticky overflow-y-scroll", className)}
7878
style={{
7979
backgroundColor,
8080
}}

0 commit comments

Comments
 (0)