From f8c1141e8cc4d7ea31e5ab404791ab4c8c7793b1 Mon Sep 17 00:00:00 2001 From: Maximus Date: Sat, 20 Aug 2022 16:09:27 +0300 Subject: [PATCH] changed icon component, paddings --- src/components/drop-down-menu/ContextMenu.tsx | 110 +++++++++--------- .../drop-down-menu/ContextMenuAction.tsx | 12 +- 2 files changed, 60 insertions(+), 62 deletions(-) diff --git a/src/components/drop-down-menu/ContextMenu.tsx b/src/components/drop-down-menu/ContextMenu.tsx index 16b7c0c..804cae8 100644 --- a/src/components/drop-down-menu/ContextMenu.tsx +++ b/src/components/drop-down-menu/ContextMenu.tsx @@ -3,9 +3,9 @@ /* -------------------------------------------------------------------------- */ import React, { Fragment } from "react"; import { Menu, Transition } from "@headlessui/react"; -import { PropsPartion } from "./ContextMenuItem"; +import { PropsPartion } from "./drop-down-menu/ContextMenuItem"; import classNames from "classnames"; -import { ReactComponent as SelectIcon } from "assets/svg/select-arrow.svg"; +import { SVGCaretDown } from "components/icons"; type ChildType = React.ReactElement; type ChildrenType = ChildType[] | ChildType; @@ -25,13 +25,13 @@ type MenuProps = { /* -------------------------------------------------------------------------- */ const MenuButtonStyle = ` +items-center inline-flex justify-center w-full cursor-default rounded border border-gray-100 outline-8 -bg-white py-2 pl-4 pr-1 @@ -43,7 +43,7 @@ left-0 mt-2 w-60 origin-top-left rounded -bg-white +bg-white shadow-lg focus:outline-none py-2 px-4 sm:text-sm`; @@ -51,17 +51,17 @@ py-2 px-4 sm:text-sm`; /* -------------------------------------------------------------------------- */ /* Component implementation */ /* -------------------------------------------------------------------------- */ -/** -* Use width ContextMenuAction.tsx , for example: -* -* alert('click')} -* > -* ... -* -*/ +/** + * Use width ContextMenuAction.tsx , for example: + * + * alert('click')} + * > + * ... + * + */ export default function ContextMenu({ button, children, @@ -69,48 +69,50 @@ export default function ContextMenu({ emphasis = "low", }: MenuProps) { return ( - - {({ open }) => ( - <> - + {({ open }) => ( + <> + + {button} + + + + - {button} - - - - - {children} - - - - )} - + {children} + + + + )} + ); } diff --git a/src/components/drop-down-menu/ContextMenuAction.tsx b/src/components/drop-down-menu/ContextMenuAction.tsx index 2023fb1..8d1e653 100644 --- a/src/components/drop-down-menu/ContextMenuAction.tsx +++ b/src/components/drop-down-menu/ContextMenuAction.tsx @@ -1,7 +1,6 @@ import classNames from "classnames"; import React from "react"; - type Props = { action: Function; caption: string; @@ -18,19 +17,16 @@ export default function ContextMenuAction({ className, }: Props) { return ( - - + ); } -