Skip to content

Commit

Permalink
chore: hide save button when version history overlay is active
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 committed Aug 23, 2024
1 parent 861756c commit 2ea7220
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { useParams, useSearchParams } from "next/navigation";
import { FileText } from "lucide-react";
// types
import { TLogoProps } from "@plane/types";
Expand All @@ -25,6 +25,7 @@ export interface IPagesHeaderProps {
export const PageDetailsHeader = observer(() => {
// router
const { workspaceSlug, pageId } = useParams();
const searchParams = useSearchParams();
// state
const [isOpen, setIsOpen] = useState(false);
// store hooks
Expand Down Expand Up @@ -55,6 +56,8 @@ export const PageDetailsHeader = observer(() => {
}
};

const isVersionHistoryOverlayActive = !!searchParams.get("version");

return (
<div className="relative z-10 flex h-[3.75rem] w-full flex-shrink-0 flex-row items-center justify-between gap-x-2 gap-y-4 bg-custom-sidebar-background-100 p-4">
<div className="flex w-full flex-grow items-center gap-2 overflow-ellipsis whitespace-nowrap">
Expand Down Expand Up @@ -157,7 +160,7 @@ export const PageDetailsHeader = observer(() => {
</div>
</div>
<PageDetailsHeaderExtraActions />
{isContentEditable && (
{isContentEditable && !isVersionHistoryOverlayActive && (
<Button
variant="primary"
size="sm"
Expand Down

0 comments on commit 2ea7220

Please sign in to comment.