diff --git a/client/components/dropdown/dropdown.jsx b/client/components/dropdown/dropdown.jsx index e06015eae..e5562112f 100644 --- a/client/components/dropdown/dropdown.jsx +++ b/client/components/dropdown/dropdown.jsx @@ -22,7 +22,7 @@ import _ from 'lodash'; // use react context to keep track of the menu depth (menus in menus) const MenuDepthContext = React.createContext(0); -const Dropdown = ({ groupName, className = null, icon, children, color = null, customTrigger, ...props })=>{ +const Dropdown = ({ groupName, className = null, icon, children, color = null, customTrigger, disabled, ...props })=>{ const reactId = useId(); const safeId = reactId.replace(/[^a-zA-Z0-9_-]/g, ''); const menuId = `${_.kebabCase(groupName)}-${safeId}-menu`; @@ -35,6 +35,21 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c const triggerRef = useRef(null); const menuRef = useRef(null); + if(disabled){ + return ( +
  • + +
  • + ); +} + // use setAttribute instead of the React style prop because React strips unknown CSS // properties (like anchor-name) from inline styles in browsers that don't support them. // setAttribute writes raw CSS text that the anchor positioning polyfill can read @@ -92,7 +107,7 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c }; return ( -
  • +
  • +
  • + ); + })} + + ); }; - const renderEditorButtons =()=>{ if(!showEditButtons) return; return (
    {view !== 'meta' && view !== 'settings' && <>
    - + {renderHistoryMenu()}