A decentralized music tracking and discovery platform built on AT Protocol ๐ŸŽต
listenbrainz spotify atproto lastfm musicbrainz scrobbling

feat(web): add InteractionBar component and integrate with SongCover for 'like' functionality #11

merged opened by tsiry-sandratraina.com targeting main from feat/like-scrobble
Labels

None yet.

Participants 1
AT URI
at://did:plc:7vdlgi2bflelz7mmuxoqjfcr/sh.tangled.repo.pull/3lzw6bsiobj22
+31 -5
Diff #3
+17
apps/web/src/components/SongCover/InteractionBar/InteractionBar.tsx
···
··· 1 + import HeartOutline from "../../Icons/HeartOutline"; 2 + import HeartFilled from "../../Icons/Heart"; 3 + 4 + function InteractionBar() { 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 + ); 15 + } 16 + 17 + export default InteractionBar;
+3
apps/web/src/components/SongCover/InteractionBar/index.tsx
···
··· 1 + import InteractionBar from "./InteractionBar"; 2 + 3 + export default InteractionBar;
+9 -4
apps/web/src/components/SongCover/SongCover.tsx
··· 1 import { css } from "@emotion/react"; 2 import styled from "@emotion/styled"; 3 4 const Cover = styled.img<{ size?: number }>` 5 border-radius: 8px; 6 height: 240px; 7 width: 240px; 8 - margin-bottom: 10px; 9 ${(props) => 10 props.size && 11 css` ··· 53 title?: string; 54 artist?: string; 55 size?: number; 56 }; 57 58 function SongCover(props: SongCoverProps) { 59 - const { title, artist, cover, size } = props; 60 return ( 61 <CoverWrapper> 62 - <Cover src={cover} size={size} /> 63 - <div className="mb-[13px]"> 64 <SongTitle className="!text-[var(--color-text-primary)]"> 65 {title} 66 </SongTitle>
··· 1 import { css } from "@emotion/react"; 2 import styled from "@emotion/styled"; 3 + import InteractionBar from "./InteractionBar"; 4 5 const Cover = styled.img<{ size?: number }>` 6 border-radius: 8px; 7 height: 240px; 8 width: 240px; 9 + margin-bottom: -5px; 10 ${(props) => 11 props.size && 12 css` ··· 54 title?: string; 55 artist?: string; 56 size?: number; 57 + withLikeButton?: boolean; 58 }; 59 60 function SongCover(props: SongCoverProps) { 61 + const { title, artist, cover, size, withLikeButton } = props; 62 return ( 63 <CoverWrapper> 64 + <div className={`relative h-[100%] w-[92%]`}> 65 + {withLikeButton && <InteractionBar />} 66 + <Cover src={cover} size={size} /> 67 + </div> 68 + <div className="mb-[13px] mt-[10px]"> 69 <SongTitle className="!text-[var(--color-text-primary)]"> 70 {title} 71 </SongTitle>
+2 -1
apps/web/src/pages/home/feed/Feed.tsx
··· 76 } 77 console.log(">> WebSocket connection closed"); 78 }; 79 - }, [queryClient]); 80 81 return ( 82 <Container> ··· 129 cover={song.cover} 130 artist={song.artist} 131 title={song.title} 132 /> 133 </Link> 134 <div className="flex">
··· 76 } 77 console.log(">> WebSocket connection closed"); 78 }; 79 + }, [queryClient, feedUri]); 80 81 return ( 82 <Container> ··· 129 cover={song.cover} 130 artist={song.artist} 131 title={song.title} 132 + withLikeButton 133 /> 134 </Link> 135 <div className="flex">

History

5 rounds 0 comments
sign up or login to add to the discussion
4 commits
expand
feat: add InteractionBar component and integrate with SongCover for like functionality
work in progress
Add likes support to feed and SongCover
Prompt sign-in for likes and stop click propagation
expand 0 comments
pull request successfully merged
2 commits
expand
feat: add InteractionBar component and integrate with SongCover for like functionality
work in progress
expand 0 comments
1 commit
expand
feat: add InteractionBar component and integrate with SongCover for like functionality
expand 0 comments
1 commit
expand
feat: add InteractionBar component and integrate with SongCover for like functionality
expand 0 comments
1 commit
expand
feat: add InteractionBar component and integrate with SongCover for like functionality
expand 0 comments