Skip to content

Commit

Permalink
feat(library): add more informative subheaders for collections and fo…
Browse files Browse the repository at this point in the history
…lders
  • Loading branch information
harbassan committed Aug 14, 2024
1 parent 67dd6da commit 08d4c09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/src/pages/collections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const CollectionsPage = ({ collection, configWrapper }: { configWrapper: ConfigW
type={item.type}
uri={item.uri}
header={item.name}
subheader={item.type === "collection" ? "Collection" : item.artists?.[0]?.name}
subheader={item.type === "collection" ? `${item.items.length} Albums` : item.artists?.[0]?.name}
imageUrl={item.type === "collection" ? item.image : item.images?.[0]?.url}
/>
));
Expand Down
6 changes: 5 additions & 1 deletion library/src/pages/playlists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ const PlaylistsPage = ({ folder, configWrapper }: { configWrapper: ConfigWrapper
type={item.type}
uri={item.uri}
header={item.name}
subheader={item.type === "playlist" ? item.owner.name : "Folder"}
subheader={
item.type === "playlist"
? item.owner.name
: `${item.numberOfPlaylists} Playlists${item.numberOfFolders ? ` • ${item.numberOfFolders} Folders` : ""}`
}
imageUrl={item.images?.[0]?.url || images[item.uri]}
badge={item.pinned ? <PinIcon /> : undefined}
/>
Expand Down

0 comments on commit 08d4c09

Please sign in to comment.