@bikiran/utils 2.3.7 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,7 +23,11 @@ const TooltipUserInfo = ({ user, ImageComponent, redirectClick, }) => {
|
|
|
23
23
|
document.addEventListener("mousedown", handleClickOutside);
|
|
24
24
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
25
25
|
}, [setShow]);
|
|
26
|
-
return (_jsxs("div", { className: cn(style.toolTipParentComp, "parentComp"), ref: tooltipRef, children: [_jsx("div", { onClick: () =>
|
|
26
|
+
return (_jsxs("div", { className: cn(style.toolTipParentComp, "parentComp"), ref: tooltipRef, children: [_jsx("div", { onClick: (e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
setShow(show === (user === null || user === void 0 ? void 0 : user.id) ? null : user === null || user === void 0 ? void 0 : user.id);
|
|
30
|
+
}, className: cn(style.imageDiv, "imageDiv"), children: (user === null || user === void 0 ? void 0 : user.photoUrl) ? (_jsx(ImageComponent, { src: user === null || user === void 0 ? void 0 : user.photoUrl, alt: "user", width: 0, height: 0, sizes: "100vw", className: cn(style.userImage, "userImage") })) : (_jsx(IconUser, {})) }), _jsxs("button", { className: cn(style.btnRedirect, "btnRedirect", show === (user === null || user === void 0 ? void 0 : user.id) ? style.show : "show" // Show when active
|
|
27
31
|
), onClick: handleRedirectClick, children: [_jsxs("div", { className: cn(style.showImg, "showImg"), children: [(user === null || user === void 0 ? void 0 : user.photoUrl) ? (_jsx(ImageComponent, { src: user === null || user === void 0 ? void 0 : user.photoUrl, alt: "user", width: 0, height: 0, sizes: "100vw", className: cn(style.userImage, "userImage") })) : (_jsx(IconUser, {})), _jsxs("div", { children: [_jsx("div", { className: cn(style.displayName, "displayName"), children: (user === null || user === void 0 ? void 0 : user.displayName) || "-----" }), _jsx("div", { className: cn(style.email, "email"), children: (user === null || user === void 0 ? void 0 : user.email) || "-----" })] })] }), _jsx("div", { className: cn(style.tooltipArrow, "tooltipArrow") })] })] }));
|
|
28
32
|
};
|
|
29
33
|
export default TooltipUserInfo;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@apply cursor-pointer;
|
|
6
6
|
}
|
|
7
7
|
.userImage {
|
|
8
|
-
@apply size-7 xl:size-10 rounded-full;
|
|
8
|
+
@apply size-7 xl:size-10 rounded-full !flex-shrink-0;
|
|
9
9
|
}
|
|
10
10
|
.btnRedirect {
|
|
11
11
|
@apply absolute left-1/2 bottom-full mb-3 -translate-x-1/2 z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none transition-all duration-200 opacity-0 scale-95 pointer-events-none;
|