From 68c9f0d8ecb03ac86fb10022b5cdfa2328fdbdc9 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Wed, 4 Sep 2024 15:15:53 -0400 Subject: [PATCH] Make it so you can click on the Spotify activity to view the track on Spotify --- src/components/landing/discord-status.tsx | 32 ++++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/components/landing/discord-status.tsx b/src/components/landing/discord-status.tsx index 1f98dfd..4c284b1 100644 --- a/src/components/landing/discord-status.tsx +++ b/src/components/landing/discord-status.tsx @@ -15,6 +15,7 @@ import { cn, truncateText } from "@/lib/utils"; import moment from "moment"; import { PuzzlePieceIcon } from "@heroicons/react/24/outline"; import SimpleTooltip from "@/components/ui/simple-tooltip"; +import Link from "next/link"; const statusColors = { online: "bg-green-500", @@ -189,6 +190,7 @@ const Username = ({ ); const SpotifyActivity = ({ spotify }: { spotify: Spotify }): ReactElement => { + const trackUrl: string = `https://open.spotify.com/track/${spotify.track_id}`; const startTimestamp: number = spotify.timestamps.start; // Example start timestamp const endTimestamp: number = spotify.timestamps.end; // Example end timestamp const [songProgress, setSongProgress] = useState(); @@ -210,22 +212,26 @@ const SpotifyActivity = ({ spotify }: { spotify: Spotify }): ReactElement => {
{/* Artwork */} - {`Track + + {`Track + {/* Track Info */}
-

- {truncateText(spotify.song, 24)} -

-

- {truncateText(spotify.artist.replace(";", ","), 26)} -

+ +

+ {truncateText(spotify.song, 24)} +

+

+ {truncateText(spotify.artist.replace(";", ","), 26)} +

+

{songProgress} / {moment(songDuration).format("m:ss")}