Remainder of menu refactoring updates.

This commit is contained in:
Patrick Fic
2023-01-17 19:48:37 -08:00
parent ef290e79b1
commit 7bd83557c1
31 changed files with 360 additions and 405 deletions

View File

@@ -1,5 +1,5 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown, Menu } from "antd";
import { Dropdown } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -21,27 +21,21 @@ export function NotesPresetButton({ bodyshop, form }) {
form.setFieldsValue({ text: item.text });
};
const menu = (
<Menu
style={{
columnCount: Math.floor(bodyshop.md_notes_presets.length / 10) + 1,
}}
>
{bodyshop.md_notes_presets.map((i, idx) => (
<Menu.Item
onClick={() => handleSelect(i)}
key={idx}
style={{ breakInside: "avoid" }}
>
{i.label}
</Menu.Item>
))}
</Menu>
);
const menu = {
style: {
columnCount: Math.floor(bodyshop.md_notes_presets.length / 10) + 1,
},
items: bodyshop.md_notes_presets.map((i, idx) => ({
key: idx,
style: { breakInside: "avoid" },
onClick: () => handleSelect(i),
label: i.label,
})),
};
return (
<div>
<Dropdown trigger={["click"]} overlay={menu}>
<Dropdown trigger={["click"]} menu={menu}>
<a
className="ant-dropdown-link"
href="# "