Majority of Dropdown Overlay Menu refactors.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2023-12-29 13:26:37 -05:00
parent 79dce5d069
commit 07b46ed92b
32 changed files with 744 additions and 833 deletions

View File

@@ -1,5 +1,5 @@
import { PlusCircleOutlined } from "@ant-design/icons";
import { Dropdown, Menu } from "antd";
import { Dropdown } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -16,19 +16,16 @@ const mapDispatchToProps = (dispatch) => ({
});
export function ChatPresetsComponent({ bodyshop, setMessage, className }) {
const menuItems = bodyshop.md_messaging_presets.map((i, idx) => ({
const items = bodyshop.md_messaging_presets.map((i, idx) => ({
key: idx,
label: i.label,
label: (i.label),
onClick: () => setMessage(i.text),
}));
const menu = (
<Menu items={menuItems} />
);
return (
<div className={className}>
<Dropdown trigger={["click"]} menu={menu}>
<Dropdown trigger={["click"]} menu={{items}}>
<PlusCircleOutlined />
</Dropdown>
</div>