UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: выравнивание нижнего dock внешних контуров с внутренним контуром
This commit is contained in:
parent
91906e917e
commit
bcd4d676db
|
|
@ -34,9 +34,9 @@ export const ProjectExternalContoursHeader = observer(function ProjectExternalCo
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Header className="pt-4">
|
<Header>
|
||||||
<Header.LeftItem className="items-center pt-2">
|
<Header.LeftItem>
|
||||||
<div className="flex flex-grow items-center gap-4">
|
<div className="flex min-w-0 flex-grow items-center gap-4">
|
||||||
<Breadcrumbs isLoading={currentProjectDetailsLoader === "init-loader"}>
|
<Breadcrumbs isLoading={currentProjectDetailsLoader === "init-loader"}>
|
||||||
<CommonProjectBreadcrumbs workspaceSlug={workspaceSlug?.toString()} projectId={projectId?.toString()} />
|
<CommonProjectBreadcrumbs workspaceSlug={workspaceSlug?.toString()} projectId={projectId?.toString()} />
|
||||||
<Breadcrumbs.Item
|
<Breadcrumbs.Item
|
||||||
|
|
@ -60,7 +60,7 @@ export const ProjectExternalContoursHeader = observer(function ProjectExternalCo
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Header.LeftItem>
|
</Header.LeftItem>
|
||||||
<Header.RightItem className="pt-2">
|
<Header.RightItem>
|
||||||
{workspaceSlug && projectId && isAuthorized ? (
|
{workspaceSlug && projectId && isAuthorized ? (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<ExternalContourCreateModalRoot
|
<ExternalContourCreateModalRoot
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ReactNode } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import type { CSSProperties, ReactNode } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
// plane imports
|
// plane imports
|
||||||
import { Row } from "@plane/ui";
|
import { Row } from "@plane/ui";
|
||||||
|
|
@ -21,10 +22,40 @@ export interface AppHeaderProps {
|
||||||
|
|
||||||
export const AppHeader = observer(function AppHeader(props: AppHeaderProps) {
|
export const AppHeader = observer(function AppHeader(props: AppHeaderProps) {
|
||||||
const { header, mobileHeader, className, rowClassName } = props;
|
const { header, mobileHeader, className, rowClassName } = props;
|
||||||
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
const [dockStyle, setDockStyle] = useState<CSSProperties | undefined>(undefined);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (typeof window === "undefined") return;
|
||||||
|
|
||||||
|
const container = containerRef.current;
|
||||||
|
const main = container?.closest("main");
|
||||||
|
if (!(main instanceof HTMLElement)) return;
|
||||||
|
|
||||||
|
const updateDockBounds = () => {
|
||||||
|
const { left, width } = main.getBoundingClientRect();
|
||||||
|
|
||||||
|
setDockStyle({
|
||||||
|
left,
|
||||||
|
width,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
updateDockBounds();
|
||||||
|
|
||||||
|
const resizeObserver = new ResizeObserver(updateDockBounds);
|
||||||
|
resizeObserver.observe(main);
|
||||||
|
window.addEventListener("resize", updateDockBounds);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
resizeObserver.disconnect();
|
||||||
|
window.removeEventListener("resize", updateDockBounds);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("z-[18]", className)}>
|
<div ref={containerRef} className={cn("fixed right-0 bottom-0 z-[18]", className)} style={dockStyle}>
|
||||||
<Row className={cn("flex h-11 w-full items-center gap-2 border-b border-subtle bg-surface-1", rowClassName)}>
|
<Row className={cn("flex h-11 w-full items-center gap-2 border-t border-subtle bg-surface-1", rowClassName)}>
|
||||||
<ExtendedAppHeader header={header} />
|
<ExtendedAppHeader header={header} />
|
||||||
</Row>
|
</Row>
|
||||||
{mobileHeader && mobileHeader}
|
{mobileHeader && mobileHeader}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue