From 9d04479f98fca7a322f55961f438aa756909b491 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Thu, 12 Jan 2023 20:40:09 +0530 Subject: [PATCH] fix: renamed folder MainMenu->main-menu and support rest props (#6103) * renamed folder MainMenu -> main-menu * rename ariaLabel -> aria-label and dataTestId -> data-testid * allow rest props * fix * lint * add ts check * ts for div * fix * fix * fix --- src/components/LayerUI.tsx | 2 +- src/components/LibraryMenuHeaderContent.tsx | 6 ++-- .../dropdownMenu/DropdownMenuItem.tsx | 15 +++----- .../dropdownMenu/DropdownMenuItemCustom.tsx | 12 +++---- .../dropdownMenu/DropdownMenuItemLink.tsx | 15 +++----- .../{mainMenu => main-menu}/DefaultItems.scss | 0 .../{mainMenu => main-menu}/DefaultItems.tsx | 36 +++++++++---------- .../{mainMenu => main-menu}/MainMenu.tsx | 0 src/packages/excalidraw/README.md | 28 ++++----------- src/packages/excalidraw/index.tsx | 2 +- 10 files changed, 43 insertions(+), 73 deletions(-) rename src/components/{mainMenu => main-menu}/DefaultItems.scss (100%) rename src/components/{mainMenu => main-menu}/DefaultItems.tsx (91%) rename src/components/{mainMenu => main-menu}/MainMenu.tsx (100%) diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index 5d4084a1..d75b8b41 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -50,7 +50,7 @@ import WelcomeScreen from "./welcome-screen/WelcomeScreen"; import { hostSidebarCountersAtom } from "./Sidebar/Sidebar"; import { jotaiScope } from "../jotai"; import { useAtom } from "jotai"; -import MainMenu from "./mainMenu/MainMenu"; +import MainMenu from "./main-menu/MainMenu"; interface LayerUIProps { actionManager: ActionManager; diff --git a/src/components/LibraryMenuHeaderContent.tsx b/src/components/LibraryMenuHeaderContent.tsx index abf6c2a2..beeb8dd1 100644 --- a/src/components/LibraryMenuHeaderContent.tsx +++ b/src/components/LibraryMenuHeaderContent.tsx @@ -193,7 +193,7 @@ export const LibraryMenuHeader: React.FC<{ {t("buttons.load")} @@ -202,7 +202,7 @@ export const LibraryMenuHeader: React.FC<{ {t("buttons.export")} @@ -219,7 +219,7 @@ export const LibraryMenuHeader: React.FC<{ setShowPublishLibraryDialog(true)} - dataTestId="lib-dropdown--remove" + data-testid="lib-dropdown--remove" > {t("buttons.publishLibrary")} diff --git a/src/components/dropdownMenu/DropdownMenuItem.tsx b/src/components/dropdownMenu/DropdownMenuItem.tsx index 47e20166..4f8db982 100644 --- a/src/components/dropdownMenu/DropdownMenuItem.tsx +++ b/src/components/dropdownMenu/DropdownMenuItem.tsx @@ -9,30 +9,23 @@ const DropdownMenuItem = ({ icon, onSelect, children, - dataTestId, shortcut, className, - style, - ariaLabel, + ...rest }: { icon?: JSX.Element; onSelect: () => void; children: React.ReactNode; - dataTestId?: string; shortcut?: string; className?: string; - style?: React.CSSProperties; - ariaLabel?: string; -}) => { +} & React.ButtonHTMLAttributes) => { return (