From 1735b64d7672e820a51cc92c71138401fb405a67 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 19 Nov 2025 02:30:01 -0800 Subject: [PATCH] move genre buttons to album detail header --- .../components/album-detail-content.tsx | 69 ++++--------------- .../albums/components/album-detail-header.tsx | 67 ++++++++++++++++-- 2 files changed, 74 insertions(+), 62 deletions(-) diff --git a/src/renderer/features/albums/components/album-detail-content.tsx b/src/renderer/features/albums/components/album-detail-content.tsx index 77c6da1af..dd40f8115 100644 --- a/src/renderer/features/albums/components/album-detail-content.tsx +++ b/src/renderer/features/albums/components/album-detail-content.tsx @@ -1,7 +1,7 @@ import { useQuery } from '@tanstack/react-query'; import { Suspense, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { generatePath, Link, useParams } from 'react-router'; +import { useParams } from 'react-router'; import styles from './album-detail-content.module.css'; @@ -19,7 +19,6 @@ import { ListConfigMenu } from '/@/renderer/features/shared/components/list-conf import { PlayButton } from '/@/renderer/features/shared/components/play-button'; import { searchLibraryItems } from '/@/renderer/features/shared/utils'; import { useContainerQuery } from '/@/renderer/hooks'; -import { useGenreRoute } from '/@/renderer/hooks/use-genre-route'; import { useCurrentServer } from '/@/renderer/store'; import { useGeneralSettings, @@ -28,7 +27,6 @@ import { } from '/@/renderer/store/settings.store'; import { replaceURLWithHTMLLinks } from '/@/renderer/utils/linkify'; import { ActionIcon } from '/@/shared/components/action-icon/action-icon'; -import { Button } from '/@/shared/components/button/button'; import { Checkbox } from '/@/shared/components/checkbox/checkbox'; import { Group } from '/@/shared/components/group/group'; import { Icon } from '/@/shared/components/icon/icon'; @@ -54,7 +52,6 @@ export const AlbumDetailContent = ({ background }: AlbumDetailContentProps) => { const { ref, ...cq } = useContainerQuery(); const { externalLinks, lastFM, musicBrainz } = useGeneralSettings(); - const genreRoute = useGenreRoute(); const carousels = [ { @@ -94,23 +91,13 @@ export const AlbumDetailContent = ({ background }: AlbumDetailContentProps) => { ]; const playButtonBehavior = usePlayButtonBehavior(); - const { addToQueueByFetch, setFavorite } = usePlayer(); + const { addToQueueByFetch } = usePlayer(); const handlePlay = () => { if (!server?.id) return; addToQueueByFetch(server.id, [albumId], LibraryItem.ALBUM, playButtonBehavior); }; - const handleFavorite = () => { - if (!detailQuery?.data) return; - setFavorite( - detailQuery.data._serverId, - [detailQuery.data.id], - LibraryItem.ALBUM, - !detailQuery.data.userFavorite, - ); - }; - const handleMoreOptions = (e: React.MouseEvent) => { if (!detailQuery?.data) return; ContextMenuController.call({ @@ -119,7 +106,6 @@ export const AlbumDetailContent = ({ background }: AlbumDetailContentProps) => { }); }; - const showGenres = detailQuery?.data?.genres ? detailQuery?.data?.genres.length !== 0 : false; const comment = detailQuery?.data?.comment; const mbzId = detailQuery?.data?.mbzId; @@ -132,48 +118,15 @@ export const AlbumDetailContent = ({ background }: AlbumDetailContentProps) => { - - - - + - {showGenres && ( -
- - {detailQuery?.data?.genres?.map((genre) => ( - - ))} - -
- )} {externalLinks && (lastFM || musicBrainz) ? (
@@ -435,6 +388,12 @@ const AlbumDetailSongsTable = ({ songs }: AlbumDetailSongsTableProps) => { /> ) : null } + styles={{ + input: { + background: 'transparent', + border: '1px solid rgba(255, 255, 255, 0.05)', + }, + }} value={searchTerm} /> { + if (!detailQuery?.data) return; + setFavorite( + detailQuery.data._serverId, + [detailQuery.data.id], + LibraryItem.ALBUM, + !detailQuery.data.userFavorite, + ); + }; const handleUpdateRating = (rating: number) => { if (!detailQuery?.data) return; @@ -133,13 +151,48 @@ export const AlbumDetailHeader = forwardRef - {showRating && ( - + {showGenres && ( + + {detailQuery?.data?.genres?.map((genre) => ( + + ))} + )} + + + {showRating && ( + + )} +