+11
-7
apps/web/src/components/SongCover/InteractionBar/InteractionBar.tsx
+11
-7
apps/web/src/components/SongCover/InteractionBar/InteractionBar.tsx
···
1
1
import HeartOutline from "../../Icons/HeartOutline";
2
+
import HeartFilled from "../../Icons/Heart";
2
3
3
4
function InteractionBar() {
4
-
return (
5
-
<div className="absolute bottom-[-1px] left-0 h-[100px] w-full bg-[linear-gradient(rgba(22,24,35,0)_2.92%,rgba(22,24,35,0.5)_98.99%)] flex justify-start items-end p-[10px] rounded-b-[8px]">
6
-
<div className="h-[40px] w-full flex items-center">
7
-
<HeartOutline color="#fff" />
8
-
</div>
9
-
</div>
10
-
);
5
+
return (
6
+
<div className="absolute bottom-[-1px] left-0 h-[100px] w-full bg-[linear-gradient(rgba(22,24,35,0)_2.92%,rgba(22,24,35,0.5)_98.99%)] flex justify-start items-end p-[10px] rounded-b-[8px]">
7
+
<div className="h-[40px] w-full flex items-center">
8
+
<span className="cursor-pointer" onClick={(e) => e.preventDefault()}>
9
+
{true && <HeartOutline color="#fff" />}
10
+
{false && <HeartFilled color="#fff" />}
11
+
</span>
12
+
</div>
13
+
</div>
14
+
);
11
15
}
12
16
13
17
export default InteractionBar;
apps/web/src/components/SongCover/InteractionBar/index.tsx
apps/web/src/components/SongCover/InteractionBar/index.tsx
This file has not been changed.
apps/web/src/components/SongCover/SongCover.tsx
apps/web/src/components/SongCover/SongCover.tsx
This patch was likely rebased, as context lines do not match.
+2
-2
apps/web/src/pages/home/feed/Feed.tsx
+2
-2
apps/web/src/pages/home/feed/Feed.tsx
···
76
76
}
77
77
console.log(">> WebSocket connection closed");
78
78
};
79
-
}, [queryClient]);
79
+
}, [queryClient, feedUri]);
80
80
81
81
return (
82
82
<Container>
···
89
89
cover={song.cover}
90
90
artist={song.artist}
91
91
title={song.title}
92
-
withLikeButton
93
92
/>
94
93
</Link>
95
94
<div className="flex">
···
130
129
cover={song.cover}
131
130
artist={song.artist}
132
131
title={song.title}
132
+
withLikeButton
133
133
/>
134
134
</Link>
135
135
<div className="flex">
Submissions
4 commits
expand
collapse
feat: add InteractionBar component and integrate with SongCover for like functionality
work in progress
Add likes support to feed and SongCover
Update feed API types to include trackUri, likesCount and liked Show
like button and counts in InteractionBar and expose onLike handler Use
useLike in SongCover to call like/unlike and pass uri/liked/likesCount
Forward like state from Feed to SongCover
Prompt sign-in for likes and stop click propagation
Show SignInModal (with a `like` flag) when a user attempts to like
without a token. Add optimistic local state for liked and likesCount to
update UI immediately. Stop event propagation on the like button and
cover to prevent parent click handlers.
pull request successfully merged