Skip to content

Commit

Permalink
YIM23: Add 'stats' style shareable image
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed Dec 19, 2023
1 parent 248efb7 commit 31cf244
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions frontend/js/src/explore/year-in-music/2023/YearInMusic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ export default class YearInMusic extends React.Component<

const linkToUserProfile = `https://listenbrainz.org/user/${user.name}`;
const linkToThisPage = `${linkToUserProfile}/year-in-music/2023`;
const imageShareCustomStyles = `.background {\nfill: ${selectedColor};\n}\n`;
return (
<div
id="year-in-music"
Expand Down Expand Up @@ -679,7 +680,7 @@ export default class YearInMusic extends React.Component<
// shareText="Check out my"
shareTitle="My top albums of 2023"
fileName={`${user.name}-top-albums-2023`}
customStyles={`.background {\nfill: ${selectedColor};\n}\n`}
customStyles={imageShareCustomStyles}
/>
</div>
</div>
Expand Down Expand Up @@ -749,7 +750,7 @@ export default class YearInMusic extends React.Component<
// shareText="Check out my"
shareTitle="My top tracks of 2023"
fileName={`${user.name}-top-tracks-2023`}
customStyles={`.background {\nfill: ${selectedColor};\n}\n`}
customStyles={imageShareCustomStyles}
/>
</div>
</div>
Expand Down Expand Up @@ -813,7 +814,7 @@ export default class YearInMusic extends React.Component<
// shareText="Check out my"
shareTitle="My top artists of 2023"
fileName={`${user.name}-top-artists-2023`}
customStyles={`.background {\nfill: ${selectedColor};\n}\n`}
customStyles={imageShareCustomStyles}
/>
</div>
</div>
Expand All @@ -827,14 +828,6 @@ export default class YearInMusic extends React.Component<
Statistics
<div className="subheader">You are a wonderful human being</div>
</div>
{/* <div className="yim-share-button-container">
<MagicShareButton
svgURL={`${APIService.APIBaseURI}/art/year-in-music/2023/${user.name}?image=stats`}
shareUrl={`${linkToThisPage}#stats`}
shareTitle="My music listening in 2023"
fileName={`${user.name}-stats-2023`}
/>
</div> */}
<div className="card content-card">
<div className="small-stats">
{yearInMusicData.total_listen_count && (
Expand Down Expand Up @@ -1042,6 +1035,15 @@ export default class YearInMusic extends React.Component<
</div>
</div>
)}
<div className="yim-share-button-container">
<ImageShareButtons
svgURL={`${APIService.APIBaseURI}/art/year-in-music/2023/${user.name}?image=stats`}
shareUrl={`${linkToThisPage}#stats`}
shareTitle="My music listening in 2023"
fileName={`${user.name}-stats-2023`}
customStyles={imageShareCustomStyles}
/>
</div>
</div>
</div>
{(Boolean(topDiscoveriesPlaylist) ||
Expand Down

0 comments on commit 31cf244

Please sign in to comment.