update dropdown-menu.tsx and action.tsx
This commit is contained in:
parent
100b44f024
commit
1cafed30e8
|
|
@ -213,12 +213,31 @@ const DropdownHamburgerBetter: React.FC<{
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuGroup>
|
<DropdownMenuGroup>
|
||||||
{list.map((e, idx) => {
|
{list.map((e, idx) => {
|
||||||
|
if (typeof e?.children === "function") {
|
||||||
return (
|
return (
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
key={"menu-group-" + idx}
|
key={"menu-group-" + idx}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
}}
|
||||||
|
className={cn(
|
||||||
|
"cursor-pointer hover:bg-gray-100 rounded-md",
|
||||||
|
e?.className ? e?.className : ""
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{e.children()}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<DropdownMenuItem
|
||||||
|
key={"menu-group-" + idx}
|
||||||
|
onClick={(event) => {
|
||||||
|
if (!e?.progration) {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
if (typeof e?.onClick === "function") {
|
if (typeof e?.onClick === "function") {
|
||||||
e?.onClick();
|
e?.onClick();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue