-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: added delete sticky confirmation modal * fix: prevented quick links reordering * fix: quick links css * fix: minor css * fix: empty states * Filter quick_tutorial and new_at_plane * fix: stickies search backend change * fix: stickies editor enhanced * fix: sticky delete function --------- Co-authored-by: gakshita <[email protected]>
- Loading branch information
1 parent
5d8f66a
commit d96ab2e
Showing
17 changed files
with
303 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { ReactNode, useEffect, useRef, useState } from "react"; | ||
import { observer } from "mobx-react"; | ||
import { cn } from "@plane/utils"; | ||
|
||
interface IContentOverflowWrapper { | ||
children: ReactNode; | ||
maxHeight?: number; | ||
gradientColor?: string; | ||
buttonClassName?: string; | ||
containerClassName?: string; | ||
fallback?: ReactNode; | ||
} | ||
|
||
export const ContentOverflowWrapper = observer((props: IContentOverflowWrapper) => { | ||
const { | ||
children, | ||
maxHeight = 625, | ||
buttonClassName = "text-sm font-medium text-custom-primary-100", | ||
containerClassName, | ||
fallback = null, | ||
} = props; | ||
|
||
// states | ||
const [containerHeight, setContainerHeight] = useState(0); | ||
const [showAll, setShowAll] = useState(false); | ||
|
||
// refs | ||
const contentRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
if (!contentRef?.current) return; | ||
|
||
const updateHeight = () => { | ||
if (contentRef.current) { | ||
const height = contentRef.current.getBoundingClientRect().height; | ||
setContainerHeight(height); | ||
} | ||
}; | ||
|
||
// Initial height measurement | ||
updateHeight(); | ||
|
||
// Create ResizeObserver for size changes | ||
const resizeObserver = new ResizeObserver(updateHeight); | ||
resizeObserver.observe(contentRef.current); | ||
|
||
// Create MutationObserver for content changes | ||
const mutationObserver = new MutationObserver((mutations) => { | ||
const shouldUpdate = mutations.some( | ||
(mutation) => | ||
mutation.type === "childList" || | ||
(mutation.type === "attributes" && (mutation.attributeName === "style" || mutation.attributeName === "class")) | ||
); | ||
|
||
if (shouldUpdate) { | ||
updateHeight(); | ||
} | ||
}); | ||
|
||
mutationObserver.observe(contentRef.current, { | ||
childList: true, | ||
subtree: true, | ||
attributes: true, | ||
attributeFilter: ["style", "class"], | ||
}); | ||
|
||
return () => { | ||
resizeObserver.disconnect(); | ||
mutationObserver.disconnect(); | ||
}; | ||
}, [contentRef?.current]); | ||
|
||
if (!children) return fallback; | ||
|
||
return ( | ||
<div | ||
className={cn( | ||
"relative", | ||
{ | ||
[`overflow-hidden`]: !showAll, | ||
"overflow-visible": showAll, | ||
}, | ||
containerClassName | ||
)} | ||
style={{ maxHeight: showAll ? "100%" : `${maxHeight}px` }} | ||
> | ||
<div ref={contentRef}>{children}</div> | ||
|
||
{containerHeight > maxHeight && ( | ||
<div | ||
className={cn( | ||
"bottom-0 left-0 w-full", | ||
`bg-gradient-to-t from-custom-background-100 to-transparent flex flex-col items-center justify-end`, | ||
"text-center", | ||
{ | ||
"absolute h-[100px]": !showAll, | ||
"h-[30px]": showAll, | ||
} | ||
)} | ||
> | ||
<button | ||
className={cn("gap-1 w-full text-custom-primary-100 text-sm font-medium", buttonClassName)} | ||
onClick={() => setShowAll((prev) => !prev)} | ||
> | ||
{showAll ? "Show less" : "Show all"} | ||
</button> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Link2, Plus } from "lucide-react"; | ||
import { Button } from "@plane/ui"; | ||
|
||
type TProps = { | ||
handleCreate: () => void; | ||
}; | ||
export const LinksEmptyState = (props: TProps) => { | ||
const { handleCreate } = props; | ||
return ( | ||
<div className="min-h-[200px] flex w-full justify-center py-6 border-[1.5px] border-custom-border-100 rounded"> | ||
<div className="m-auto"> | ||
<div | ||
className={`mb-2 rounded-full mx-auto last:rounded-full w-[50px] h-[50px] flex items-center justify-center bg-custom-background-80/40 transition-transform duration-300`} | ||
> | ||
<Link2 size={30} className="text-custom-text-400 -rotate-45" /> | ||
</div> | ||
<div className="text-custom-text-100 font-medium text-base text-center mb-1">No quick links yet</div> | ||
<div className="text-custom-text-300 text-sm text-center mb-2"> | ||
Add any links you need for quick access to your work.{" "} | ||
</div> | ||
<Button variant="accent-primary" size="sm" onClick={handleCreate} className="mx-auto"> | ||
<Plus className="size-4 my-auto" /> <span>Add quick link</span> | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { History } from "lucide-react"; | ||
|
||
export const RecentsEmptyState = () => ( | ||
<div className="h-[200px] flex w-full justify-center py-6 border-[1.5px] border-custom-border-100 rounded"> | ||
<div className="m-auto"> | ||
<div | ||
className={`mb-2 rounded-full mx-auto last:rounded-full w-[50px] h-[50px] flex items-center justify-center bg-custom-background-80/40 transition-transform duration-300`} | ||
> | ||
<History size={30} className="text-custom-text-400 -rotate-45" /> | ||
</div> | ||
<div className="text-custom-text-100 font-medium text-base text-center mb-1">No recent items yet</div> | ||
<div className="text-custom-text-300 text-sm text-center mb-2">You don’t have any recent items yet. </div> | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.