mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Updated the react-menu library from v2 to v4. #8061
This commit is contained in:
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
||||
import {
|
||||
MenuItem,
|
||||
ControlledMenu,
|
||||
applyStatics,
|
||||
Menu,
|
||||
SubMenu,
|
||||
} from '@szhsin/react-menu';
|
||||
@@ -48,13 +47,17 @@ PgMenu.propTypes = {
|
||||
menuButton: PropTypes.element,
|
||||
};
|
||||
|
||||
export const PgSubMenu = applyStatics(SubMenu)(({label, ...props})=>{
|
||||
export const PgSubMenu = (({label, ...props})=>{
|
||||
return (
|
||||
<SubMenu label={label} itemProps={{'data-label': label}} {...props} />
|
||||
);
|
||||
});
|
||||
|
||||
export const PgMenuItem = applyStatics(MenuItem)(({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{
|
||||
PgSubMenu.propTypes = {
|
||||
label: PropTypes.string
|
||||
};
|
||||
|
||||
export const PgMenuItem = (({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{
|
||||
|
||||
let onClick = props.onClick;
|
||||
if(hasCheck) {
|
||||
@@ -83,7 +86,7 @@ PgMenuItem.propTypes = {
|
||||
children: CustomPropTypes.children,
|
||||
closeOnCheck: PropTypes.bool,
|
||||
onClick: PropTypes.func,
|
||||
dataLabel: PropTypes.string,
|
||||
datalabel: PropTypes.string,
|
||||
};
|
||||
|
||||
export function usePgMenuGroup() {
|
||||
|
||||
Reference in New Issue
Block a user