From ae161b14c832ac7dde761364f7fe14a2d2cf252e Mon Sep 17 00:00:00 2001 From: Ashit Rath Date: Fri, 21 Jun 2024 11:51:53 +0530 Subject: [PATCH] chore: Fix missing changes in revert #34313 (#34371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Reverted missed out code in https://github.com/appsmithorg/appsmith/pull/34367 ## Automation /ok-to-test tags="@tag.IDE" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: a2525661414e7bb571914ede981383778e9c4d56 > Cypress dashboard. > Tags: `@tag.IDE` ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No --- app/client/src/pages/Editor/EditorName/index.tsx | 5 +++++ .../src/pages/Editor/EditorName/useNavigationMenuData.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/client/src/pages/Editor/EditorName/index.tsx b/app/client/src/pages/Editor/EditorName/index.tsx index 0c23e95512c9..9fb68ae5f24f 100644 --- a/app/client/src/pages/Editor/EditorName/index.tsx +++ b/app/client/src/pages/Editor/EditorName/index.tsx @@ -9,12 +9,14 @@ import { SavingState } from "design-system-old"; import EditableName from "./EditableName"; import { NavigationMenu } from "./NavigationMenu"; import { Menu, toast, MenuTrigger } from "design-system"; +import type { Theme } from "constants/DefaultTheme"; import ForkApplicationModal from "pages/Applications/ForkApplicationModal"; import { Container, StyledIcon } from "./components"; import { useSelector } from "react-redux"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import type { NavigationMenuDataProps } from "./useNavigationMenuData"; import type { MenuItemData } from "./NavigationMenuItem"; +import { useTheme } from "styled-components"; type EditorNameProps = CommonComponentProps & { applicationId?: string | undefined; @@ -49,6 +51,8 @@ export function EditorName(props: EditorNameProps) { setIsPopoverOpen, } = props; + const theme = useTheme() as Theme; + const [isEditingDefault, setIsEditingDefault] = useState(isNewEditor); const [isEditing, setIsEditing] = useState(!!isEditingDefault); const [isInvalid, setIsInvalid] = useState(false); @@ -100,6 +104,7 @@ export function EditorName(props: EditorNameProps) { const navigationMenuData = getNavigationMenu({ editMode, + theme, setForkApplicationModalOpen, }); diff --git a/app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts b/app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts index 0a8fb8f222c1..cb0485f8245e 100644 --- a/app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts +++ b/app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts @@ -19,6 +19,7 @@ import { import { getCurrentApplication } from "@appsmith/selectors/applicationSelectors"; import { Colors } from "constants/Colors"; import { getCurrentApplicationId } from "selectors/editorSelectors"; +import type { ThemeProp } from "WidgetProvider/constants"; import { toast } from "design-system"; import { DOCS_BASE_URL } from "constants/ThirdPartyConstants"; import { getAppsmithConfigs } from "@appsmith/configs"; @@ -26,7 +27,7 @@ import { getCurrentUser } from "selectors/usersSelectors"; const { cloudHosting, intercomAppID } = getAppsmithConfigs(); -export interface NavigationMenuDataProps { +export interface NavigationMenuDataProps extends ThemeProp { editMode: typeof noop; setForkApplicationModalOpen: React.Dispatch>; }