add hover render of post quoted by user

This commit is contained in:
plebeius.eth
2023-06-22 14:59:30 +02:00
parent 92479406c0
commit b04b96c12c
6 changed files with 701 additions and 62 deletions
+26
View File
@@ -0,0 +1,26 @@
import React, { useEffect } from "react";
import { Link } from "react-router-dom";
const ForwardRefLink = React.forwardRef((props, ref) => {
const { children, setRefAndCid, onMouseOver, onMouseLeave, onClick, ...otherProps } = props;
useEffect(() => {
if (ref.current && typeof setRefAndCid === 'function') {
setRefAndCid(ref.current);
}
}, [ref, setRefAndCid]);
return (
<Link
ref={ref}
{...otherProps}
onMouseOver={onMouseOver}
onMouseLeave={onMouseLeave}
onClick={onClick}
>
{children}
</Link>
);
});
export default ForwardRefLink;