From 669e284dc5f8bf5936a0633f08a8c0e5da1f7082 Mon Sep 17 00:00:00 2001 From: mamoodi Date: Thu, 6 Feb 2025 09:57:54 -0500 Subject: [PATCH] Only show start project button in conversations (#6626) Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com> --- .../src/components/shared/buttons/exit-project-button.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/components/shared/buttons/exit-project-button.tsx b/frontend/src/components/shared/buttons/exit-project-button.tsx index 5a6db074f6..8e40bf5efa 100644 --- a/frontend/src/components/shared/buttons/exit-project-button.tsx +++ b/frontend/src/components/shared/buttons/exit-project-button.tsx @@ -1,4 +1,5 @@ import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router"; import { I18nKey } from "#/i18n/declaration"; import NewProjectIcon from "#/icons/new-project.svg?react"; import { TooltipButton } from "./tooltip-button"; @@ -9,7 +10,12 @@ interface ExitProjectButtonProps { export function ExitProjectButton({ onClick }: ExitProjectButtonProps) { const { t } = useTranslation(); + const location = useLocation(); const startNewProject = t(I18nKey.PROJECT$START_NEW); + + // Only show the button in the conversations page + if (!location.pathname.startsWith("/conversations")) return null; + return (