Skip to content

Commit 4bcf6f4

Browse files
committed
refactor: conditionally render share button in Profile component and adjust tooltip position
1 parent d4de1f3 commit 4bcf6f4

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/components/Profile/Profile.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ function Card({ data }) {
249249

250250
<div className="absolute right-0 top-0">
251251
<div className="relative" ref={shareBtnRef}>
252-
<FaShareAlt
253-
className="cursor-pointer text-xl text-blue-600 duration-300 hover:scale-125"
254-
onClick={() => setShowTooltip(true)}
255-
/>
252+
{!showTooltip && (
253+
<FaShareAlt
254+
className="cursor-pointer text-xl text-blue-600 duration-300 hover:scale-125"
255+
onClick={() => setShowTooltip(true)}
256+
/>
257+
)}
256258
{showTooltip && (
257259
<div className="profile-share-tooltip">
258260
<button className="profile-share-close" onClick={() => setShowTooltip(false)}>

src/components/Profile/ProfileShareTooltip.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Tooltip styles for Profile share button */
22
.profile-share-tooltip {
33
position: absolute;
4-
top: 40px;
5-
right: 0;
4+
top: -10px;
5+
right: -10px;
66
z-index: 50;
77
background: #091224;
88
color: #00a6fb;

0 commit comments

Comments
 (0)