Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-4746] fix: position peek view relative to app layout (#7635)

Prateek Shourya599ff2eec436
diff --git a/apps/web/core/components/analytics/work-items/modal/index.tsx b/apps/web/core/components/analytics/work-items/modal/index.tsx
index 4852a0bd55..2ff0809bc2 100644
--- a/apps/web/core/components/analytics/work-items/modal/index.tsx
+++ b/apps/web/core/components/analytics/work-items/modal/index.tsx
@@ -20,7 +20,7 @@ type Props = {
export const WorkItemsModal: React.FC<Props> = observer((props) => {
const { isOpen, onClose, projectDetails, moduleDetails, cycleDetails, isEpic } = props;
- const { updateIsEpic } = useAnalytics();
+ const { updateIsEpic, isPeekView } = useAnalytics();
const [fullScreen, setFullScreen] = useState(false);
const handleClose = () => {
@@ -29,18 +29,18 @@ export const WorkItemsModal: React.FC<Props> = observer((props) => {
};
useEffect(() => {
- updateIsEpic(isEpic ?? false);
- }, [isEpic, updateIsEpic]);
+ updateIsEpic(isPeekView ? (isEpic ?? false) : false);
+ }, [isEpic, updateIsEpic, isPeekView]);
const portalContainer = document.getElementById("full-screen-portal") as HTMLElement;
if (!isOpen) return null;
const content = (
- <div className={cn("inset-0 z-[25] h-full w-full overflow-y-auto", fullScreen ? "absolute" : "fixed")}>
+ <div className={cn("z-[25] h-full w-full overflow-y-auto absolute")}>
<div
- className={`right-0 top-0 z-20 h-full bg-custom-background-100 shadow-custom-shadow-md ${
- fullScreen ? "w-full p-2 absolute" : "w-full sm:w-full md:w-1/2 fixed"
+ className={`top-0 right-0 z-[25] h-full bg-custom-background-100 shadow-custom-shadow-md absolute ${
+ fullScreen ? "w-full p-2" : "w-1/2"
}`}
>
<div
@@ -67,5 +67,5 @@ export const WorkItemsModal: React.FC<Props> = observer((props) => {
</div>
);
- return fullScreen && portalContainer ? createPortal(content, portalContainer) : content;
+ return portalContainer ? createPortal(content, portalContainer) : content;
});
diff --git a/apps/web/core/components/issues/peek-overview/view.tsx b/apps/web/core/components/issues/peek-overview/view.tsx
index e06a483975..bbae72db33 100644
--- a/apps/web/core/components/issues/peek-overview/view.tsx
+++ b/apps/web/core/components/issues/peek-overview/view.tsx
@@ -110,16 +110,16 @@ export const IssueView: FC<IIssueView> = observer((props) => {
const peekOverviewIssueClassName = cn(
!embedIssue
- ? "fixed z-[25] flex flex-col overflow-hidden rounded border border-custom-border-200 bg-custom-background-100 transition-all duration-300"
+ ? "absolute z-[25] flex flex-col overflow-hidden rounded border border-custom-border-200 bg-custom-background-100 transition-all duration-300"
: `w-full h-full`,
!embedIssue && {
- "top-2 bottom-2 right-2 w-full md:w-[50%] border-0 border-l": peekMode === "side-peek",
+ "top-0 bottom-0 right-0 w-full md:w-[50%] border-0 border-l": peekMode === "side-peek",
"size-5/6 top-[8.33%] left-[8.33%]": peekMode === "modal",
"inset-0 m-4 absolute": peekMode === "full-screen",
}
);
- const shouldUsePortal = !embedIssue && peekMode === "full-screen";
+ const shouldUsePortal = !embedIssue;
const portalContainer = document.getElementById("full-screen-portal") as HTMLElement;