Added tag support + Post link and many more changes and optimizations.

This commit is contained in:
Daniel
2023-02-24 21:02:28 +03:30
parent e0f4c71eb2
commit 9b53608097
36 changed files with 1062 additions and 176 deletions
+3 -7
View File
@@ -20,19 +20,15 @@ function useOutsideAlerter(
}
}
// Bind the event listener
document.addEventListener("mousedown", handleClickOutside);
document.addEventListener("mouseup", handleClickOutside);
return () => {
// Unbind the event listener on clean up
document.removeEventListener("mousedown", handleClickOutside);
document.removeEventListener("mouseup", handleClickOutside);
};
}, [ref, onClickOutside]);
}
export default function OutsideAlerter({
children,
onClickOutside,
className,
}: Props) {
export default function ({ children, onClickOutside, className }: Props) {
const wrapperRef = useRef(null);
useOutsideAlerter(wrapperRef, onClickOutside);