Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: context menu not opening

thecodrrfe493e9c3791
diff --git a/apps/web/src/components/icons/index.js b/apps/web/src/components/icons/index.js
index 441210d99..2a0d79197 100644
--- a/apps/web/src/components/icons/index.js
+++ b/apps/web/src/components/icons/index.js
@@ -159,7 +159,7 @@ function Icon({ title, name, size = 24, color = "icon", stroke, rotate }) {
}
function createIcon(name, rotate = false) {
- return function NNIcon(props) {
+ const NNIcon = function NNIcon(props) {
const [isHovering, setIsHovering] = useState();
return (
<AnimatedFlex
@@ -190,6 +190,8 @@ function createIcon(name, rotate = false) {
</AnimatedFlex>
);
};
+ NNIcon.isReactComponent = true;
+ return NNIcon;
}
export const Plus = createIcon(mdiPlus);
diff --git a/apps/web/src/hooks/use-menu.js b/apps/web/src/hooks/use-menu.js
index c2f3e55f4..94aab788d 100644
--- a/apps/web/src/hooks/use-menu.js
+++ b/apps/web/src/hooks/use-menu.js
@@ -226,7 +226,7 @@ function mapMenuItems(items, data) {
function resolveProp(prop, data, item) {
const isFunction = typeof prop === "function";
if (isFunction) {
- return prop.name === "NNIcon" ? prop : prop(data, item);
+ return prop.isReactComponent ? prop : prop(data, item);
}
return prop;
}