feat(web): pages without boxes: rows, underlined tabs, one title style
The fourth piece of the new look, first part. - One component for the title of a page, larger than before; the greeting of Home is larger still. - The cards of artists, albums, mixes, playlists and smart playlists are the picture and the words: no panel, no hover box, they still lift. - The lists of the admin area (libraries, users, friends), of Discover (the suggestions and the wishlist) and of Friends are rows separated by a line. The providers, the jobs and the costs are sections divided by a line. - The tabs of Discover, Admin and the music of a friend are underlined, in the colour of this server, or in the friend colour for a friend. - The page of a friend has a band in the friend colour at its top edge. - An artist with no picture is a quiet tile with its initial, not a loud one.
This commit is contained in:
parent
17a37b11f0
commit
1a03f70059
31 changed files with 131 additions and 41 deletions
|
|
@ -32,7 +32,7 @@ export default function ArtistPhoto({
|
|||
return (
|
||||
<div
|
||||
style={{ width: size, height: size }}
|
||||
className="relative flex shrink-0 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground"
|
||||
className="relative flex shrink-0 items-center justify-center overflow-hidden rounded-md bg-secondary text-primary"
|
||||
>
|
||||
{photo && failed !== src ? (
|
||||
<img
|
||||
|
|
|
|||
15
web/src/components/PageTitle.test.tsx
Normal file
15
web/src/components/PageTitle.test.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { render, screen } from '@testing-library/react'
|
||||
import { expect, test } from 'vitest'
|
||||
import PageTitle from './PageTitle'
|
||||
|
||||
test('it is the heading of the page, the largest text on it', () => {
|
||||
render(<PageTitle>Albums</PageTitle>)
|
||||
const h1 = screen.getByRole('heading', { level: 1, name: 'Albums' })
|
||||
expect(h1.className).toContain('text-4xl')
|
||||
expect(h1.className).toContain('font-extrabold')
|
||||
})
|
||||
|
||||
test('a greeting is larger still', () => {
|
||||
render(<PageTitle large>Good evening</PageTitle>)
|
||||
expect(screen.getByRole('heading', { level: 1 }).className).toContain('text-5xl')
|
||||
})
|
||||
11
web/src/components/PageTitle.tsx
Normal file
11
web/src/components/PageTitle.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import type { ReactNode } from 'react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/** The title of a page: the largest text on it. A greeting (`large`) is larger still. */
|
||||
export default function PageTitle({ children, large = false, className }: { children: ReactNode; large?: boolean; className?: string }) {
|
||||
return (
|
||||
<h1 className={cn('font-extrabold tracking-tight', large ? 'text-5xl leading-none sm:text-7xl' : 'text-4xl leading-tight sm:text-5xl', className)}>
|
||||
{children}
|
||||
</h1>
|
||||
)
|
||||
}
|
||||
23
web/src/components/cards.test.tsx
Normal file
23
web/src/components/cards.test.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { render, screen } from '@testing-library/react'
|
||||
import { MemoryRouter } from 'react-router-dom'
|
||||
import { beforeEach, expect, test, vi } from 'vitest'
|
||||
import { initI18n } from '@/i18n'
|
||||
import { AlbumCard, ArtistCard } from './cards'
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
|
||||
await initI18n()
|
||||
})
|
||||
|
||||
test('a card is the picture and the words, with no panel around them', () => {
|
||||
render(
|
||||
<MemoryRouter>
|
||||
<AlbumCard album={{ id: 1, title: 'Luce Sommersa', artist: { id: 2, name: 'Nora Valdes' }, track_count: 8, duration_ms: 2000 }} />
|
||||
<ArtistCard artist={{ id: 2, name: 'Nora Valdes', album_count: 2, track_count: 12 }} />
|
||||
</MemoryRouter>,
|
||||
)
|
||||
for (const link of screen.getAllByRole('link')) {
|
||||
expect(link.className).not.toMatch(/(^|\s)(bg-|p-3|rounded-xl)/)
|
||||
expect(link.className).toContain('lift') // it still answers the pointer
|
||||
}
|
||||
})
|
||||
|
|
@ -10,7 +10,7 @@ export const CARD_GRID = 'grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] g
|
|||
export function ArtistCard({ artist }: { artist: Artist }) {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Link to={`/artists/${artist.id}`} className="flex flex-col items-center gap-3 lift rounded-xl p-3 text-center hover:bg-secondary">
|
||||
<Link to={`/artists/${artist.id}`} className="flex flex-col items-center gap-3 lift text-center">
|
||||
<ArtistPhoto artistId={artist.id} name={artist.name} size={128} />
|
||||
<span className="flex min-w-0 max-w-full flex-col">
|
||||
<span className="truncate font-bold">{artist.name}</span>
|
||||
|
|
@ -24,7 +24,7 @@ export function ArtistCard({ artist }: { artist: Artist }) {
|
|||
|
||||
export function AlbumCard({ album }: { album: Album }) {
|
||||
return (
|
||||
<Link to={`/albums/${album.id}`} className="flex flex-col gap-3 lift rounded-xl p-3 hover:bg-secondary">
|
||||
<Link to={`/albums/${album.id}`} className="flex flex-col gap-3 lift">
|
||||
<Cover albumId={album.id} size={200} fluid />
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="truncate font-bold">{album.title}</span>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useAlbumList } from '@/api/catalog'
|
|||
import { AlbumCard, CARD_GRID } from '@/components/cards'
|
||||
import LoadMore from '@/components/LoadMore'
|
||||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
export default function AlbumsPage() {
|
||||
const { t } = useTranslation()
|
||||
|
|
@ -14,7 +15,7 @@ export default function AlbumsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.albums')}</h1>
|
||||
<PageTitle>{t('nav.albums')}</PageTitle>
|
||||
{query.isError ? (
|
||||
<ErrorMessage error={query.error} onRetry={() => query.refetch()} />
|
||||
) : query.isPending ? (
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useArtistList } from '@/api/catalog'
|
|||
import { ArtistCard, CARD_GRID } from '@/components/cards'
|
||||
import LoadMore from '@/components/LoadMore'
|
||||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
export default function ArtistsPage() {
|
||||
const { t } = useTranslation()
|
||||
|
|
@ -14,7 +15,7 @@ export default function ArtistsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.artists')}</h1>
|
||||
<PageTitle>{t('nav.artists')}</PageTitle>
|
||||
{query.isError ? (
|
||||
<ErrorMessage error={query.error} onRetry={() => query.refetch()} />
|
||||
) : query.isPending ? (
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useSearchParams } from 'react-router-dom'
|
|||
import { cn } from '@/lib/utils'
|
||||
import MarkedList from './discover/MarkedList'
|
||||
import SuggestionsTab from './discover/SuggestionsTab'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
const TABS = [
|
||||
{ id: 'suggestions', key: 'discover.tabs.suggestions' },
|
||||
|
|
@ -39,9 +40,9 @@ export default function DiscoverPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('discover.title')}</h1>
|
||||
<PageTitle>{t('discover.title')}</PageTitle>
|
||||
|
||||
<div role="tablist" aria-label={t('discover.tabs.label')} onKeyDown={onKeyDown} className="flex flex-wrap gap-2">
|
||||
<div role="tablist" aria-label={t('discover.tabs.label')} onKeyDown={onKeyDown} className="flex flex-wrap gap-1 border-b border-border">
|
||||
{TABS.map((tab) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
|
|
@ -56,8 +57,8 @@ export default function DiscoverPage() {
|
|||
tabIndex={current === tab.id ? 0 : -1}
|
||||
onClick={() => choose(tab.id)}
|
||||
className={cn(
|
||||
'min-h-11 rounded-lg px-4 font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',
|
||||
current === tab.id ? 'bg-secondary text-foreground' : 'text-muted-foreground hover:text-foreground',
|
||||
'-mb-px min-h-12 border-b-[3px] px-4 font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',
|
||||
current === tab.id ? 'border-primary text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground',
|
||||
)}
|
||||
>
|
||||
{t(tab.key)}
|
||||
|
|
|
|||
|
|
@ -184,3 +184,12 @@ test('the albums of a friend show their covers from this server’s route for th
|
|||
const row = (await screen.findByText('Shared Album')).closest('li') as HTMLElement
|
||||
expect(row.querySelector('img')!.getAttribute('src')).toContain('/api/v1/friends/3/albums/7/cover')
|
||||
})
|
||||
|
||||
test('the page of a friend has a band in the friend colour on top, and its tabs are underlined in that colour', async () => {
|
||||
mockFetch(routes())
|
||||
renderAt()
|
||||
await screen.findByRole('heading', { level: 1, name: 'Music of Anna' })
|
||||
expect(document.querySelector('[data-friend-band]')).toHaveClass('bg-friend')
|
||||
expect(screen.getByRole('tab', { name: 'Artists', selected: true })).toHaveClass('border-friend')
|
||||
expect(screen.getByRole('tab', { name: 'Albums' })).toHaveClass('border-transparent')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { formatTime } from '@/lib/time'
|
|||
import { trackKey } from '@/player/media'
|
||||
import { currentTrack, usePlayer } from '@/player/store'
|
||||
import { cn } from '@/lib/utils'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
const TABS = ['artists', 'albums', 'songs'] as const
|
||||
type Tab = (typeof TABS)[number]
|
||||
|
|
@ -120,8 +121,10 @@ export default function FriendPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
{/* What comes from elsewhere is marked at the top of the page, in its colour. */}
|
||||
<div data-friend-band aria-hidden="true" className="-mx-5 -mt-6 h-1 bg-friend sm:-mx-14 sm:-mt-11" />
|
||||
<div className="flex flex-col gap-2">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('friends.musicOf', { name })}</h1>
|
||||
<PageTitle>{t('friends.musicOf', { name })}</PageTitle>
|
||||
<p className="text-sm text-muted-foreground">{t('friends.whose', { name })}</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -139,7 +142,7 @@ export default function FriendPage() {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div role="tablist" aria-label={t('friends.tabsLabel', { name })} onKeyDown={onKeyDown} className="flex flex-wrap gap-2">
|
||||
<div role="tablist" aria-label={t('friends.tabsLabel', { name })} onKeyDown={onKeyDown} className="flex flex-wrap gap-1 border-b border-border">
|
||||
{TABS.map((id) => (
|
||||
<button
|
||||
key={id}
|
||||
|
|
@ -154,8 +157,8 @@ export default function FriendPage() {
|
|||
tabIndex={tab === id ? 0 : -1}
|
||||
onClick={() => go(id === 'artists' ? {} : { tab: id })}
|
||||
className={cn(
|
||||
'min-h-11 rounded-lg px-4 font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',
|
||||
tab === id ? 'bg-secondary text-foreground' : 'text-muted-foreground hover:text-foreground',
|
||||
'-mb-px min-h-12 border-b-[3px] px-4 font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',
|
||||
tab === id ? 'border-friend text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground',
|
||||
)}
|
||||
>
|
||||
{t(`friends.tabs.${id}`)}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { useTranslation } from 'react-i18next'
|
|||
import { Link } from 'react-router-dom'
|
||||
import { useFriends } from '@/api/friends'
|
||||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** The friends whose music can be browsed. Each is a way into the music that another Sonda server shares. */
|
||||
export default function FriendsPage() {
|
||||
|
|
@ -10,7 +11,7 @@ export default function FriendsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('friends.title')}</h1>
|
||||
<PageTitle>{t('friends.title')}</PageTitle>
|
||||
<p className="text-muted-foreground">{t('friends.intro')}</p>
|
||||
{friends.isError ? (
|
||||
<ErrorMessage error={friends.error} onRetry={() => void friends.refetch()} />
|
||||
|
|
@ -24,7 +25,7 @@ export default function FriendsPage() {
|
|||
<li key={friend.id}>
|
||||
<Link
|
||||
to={`/friends/${friend.id}`}
|
||||
className="flex min-h-14 items-center rounded-xl bg-card px-5 text-lg font-bold text-card-foreground hover:bg-secondary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
||||
className="flex min-h-14 items-center border-b border-border text-lg font-bold hover:text-friend focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
||||
>
|
||||
{friend.name}
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import Section from '@/components/Section'
|
|||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import { errorMessageKey } from '@/i18n'
|
||||
import { usePlayer } from '@/player/store'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** How many recent songs, albums and artists the page shows. */
|
||||
const RECENT = 6
|
||||
|
|
@ -55,7 +56,7 @@ export default function HomePage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-10">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t(greetingKey(hour))}</h1>
|
||||
<PageTitle large>{t(greetingKey(hour))}</PageTitle>
|
||||
|
||||
{libraryEmpty ? (
|
||||
<EmptyMessage>{t('home.emptyLibrary')}</EmptyMessage>
|
||||
|
|
@ -75,7 +76,7 @@ export default function HomePage() {
|
|||
<button
|
||||
type="button"
|
||||
onClick={() => play(track.id)}
|
||||
className="flex min-h-14 w-full items-center rounded-lg bg-secondary px-4 text-left font-bold hover:bg-accent"
|
||||
className="flex min-h-14 w-full items-center border-b border-border text-left font-bold hover:text-primary"
|
||||
>
|
||||
<span className="truncate">{track.title}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ import MixCover from '@/components/MixCover'
|
|||
import Section from '@/components/Section'
|
||||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import { mixTitle } from './mixTitle'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
function MixCard({ mix }: { mix: Mix }) {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Link to={`/mixes/${encodeURIComponent(mix.id)}`} className="flex flex-col gap-3 lift rounded-xl p-3 hover:bg-secondary">
|
||||
<Link to={`/mixes/${encodeURIComponent(mix.id)}`} className="flex flex-col gap-3 lift">
|
||||
<MixCover albumIds={mix.album_ids} size={200} fluid />
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="truncate font-bold">{mixTitle(t, mix)}</span>
|
||||
|
|
@ -29,7 +30,7 @@ export default function MixesPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-8">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.mixes')}</h1>
|
||||
<PageTitle>{t('nav.mixes')}</PageTitle>
|
||||
{query.isError ? (
|
||||
<ErrorMessage error={query.error} onRetry={() => query.refetch()} />
|
||||
) : query.isPending ? (
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { Link } from 'react-router-dom'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
export default function NotFoundPage() {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<div className="flex flex-col items-start gap-4">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('common.notFound')}</h1>
|
||||
<PageTitle>{t('common.notFound')}</PageTitle>
|
||||
<Link to="/" className="font-semibold text-primary underline-offset-4 hover:underline">
|
||||
{t('common.backHome')}
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { Input } from '@/components/ui/input'
|
|||
import { Label } from '@/components/ui/label'
|
||||
import { errorMessageKey } from '@/i18n'
|
||||
import { formatTime } from '@/lib/time'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** Your playlists, and a form to make another. */
|
||||
export default function PlaylistsPage() {
|
||||
|
|
@ -30,7 +31,7 @@ export default function PlaylistsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.playlists')}</h1>
|
||||
<PageTitle>{t('nav.playlists')}</PageTitle>
|
||||
|
||||
{query.isError ? (
|
||||
<ErrorMessage error={query.error} onRetry={() => query.refetch()} />
|
||||
|
|
@ -43,7 +44,7 @@ export default function PlaylistsPage() {
|
|||
<ul className={CARD_GRID}>
|
||||
{items.map((p) => (
|
||||
<li key={p.id}>
|
||||
<Link to={`/playlists/${p.id}`} className="flex flex-col gap-3 lift rounded-xl p-3 hover:bg-secondary">
|
||||
<Link to={`/playlists/${p.id}`} className="flex flex-col gap-3 lift">
|
||||
<MixCover albumIds={p.album_ids} size={200} fluid />
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="truncate font-bold">{p.name}</span>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import Section from '@/components/Section'
|
|||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import TrackList from '@/components/TrackList'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** Wait this long after the last keystroke before asking the server. */
|
||||
const DEBOUNCE_MS = 250
|
||||
|
|
@ -49,7 +50,7 @@ export default function SearchPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-8">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.search')}</h1>
|
||||
<PageTitle>{t('nav.search')}</PageTitle>
|
||||
<div className="max-w-xl">
|
||||
<label htmlFor="search" className="sr-only">
|
||||
{t('search.label')}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { Label } from '@/components/ui/label'
|
|||
import { errorMessageKey, useLanguage, type Lang } from '@/i18n'
|
||||
import { usePlayer } from '@/player/store'
|
||||
import { THEMES, useTheme, type ThemeId } from '@/theme/theme'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
const MIN_PASSWORD_BYTES = 8
|
||||
const MAX_PASSWORD_BYTES = 256
|
||||
|
|
@ -107,7 +108,7 @@ export default function SettingsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-10">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.settings')}</h1>
|
||||
<PageTitle>{t('nav.settings')}</PageTitle>
|
||||
|
||||
<Section title={t('settings.account')}>
|
||||
<div className="flex flex-wrap items-center gap-4">
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import { errorMessageKey } from '@/i18n'
|
|||
import { formatTime } from '@/lib/time'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { EMPTY_FORM, formFromRules, rulesFromForm, type RuleForm } from './smartRules'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** The editor of a new smart playlist, or of one that exists (`/smart-playlists/:id/edit`). */
|
||||
export default function SmartEditorPage() {
|
||||
|
|
@ -96,7 +97,7 @@ function SmartEditor({ existing }: { existing: SmartPlaylist | null }) {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t(existing ? 'smart.editor.titleEdit' : 'smart.editor.titleNew')}</h1>
|
||||
<PageTitle>{t(existing ? 'smart.editor.titleEdit' : 'smart.editor.titleNew')}</PageTitle>
|
||||
<div className="grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]">
|
||||
<form onSubmit={submit} className="flex max-w-2xl flex-col gap-6">
|
||||
<div className="flex flex-col gap-2">
|
||||
|
|
|
|||
|
|
@ -9,13 +9,14 @@ import Section from '@/components/Section'
|
|||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import { buttonVariants } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
/** A card for a suggested smart playlist; it asks for its own covers once it is on screen. */
|
||||
function SuggestedCard({ k }: { k: string }) {
|
||||
const { t } = useTranslation()
|
||||
const covers = useSuggestedCovers(k)
|
||||
return (
|
||||
<Link to={`/smart-playlists/suggested/${k}`} className="flex flex-col gap-3 lift rounded-xl p-3 hover:bg-secondary">
|
||||
<Link to={`/smart-playlists/suggested/${k}`} className="flex flex-col gap-3 lift">
|
||||
<MixCover albumIds={covers.data ?? []} size={200} fluid />
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="truncate font-bold">{t(`smart.suggested.${k}.name`)}</span>
|
||||
|
|
@ -29,7 +30,7 @@ function SuggestedCard({ k }: { k: string }) {
|
|||
function SmartCard({ id, name, meta }: { id: number; name: string; meta: string }) {
|
||||
const covers = useSmartCovers(id)
|
||||
return (
|
||||
<Link to={`/smart-playlists/${id}`} className="flex flex-col gap-3 lift rounded-xl p-3 hover:bg-secondary">
|
||||
<Link to={`/smart-playlists/${id}`} className="flex flex-col gap-3 lift">
|
||||
<MixCover albumIds={covers.data ?? []} size={200} fluid />
|
||||
<span className="flex min-w-0 flex-col">
|
||||
<span className="truncate font-bold">{name}</span>
|
||||
|
|
@ -49,7 +50,7 @@ export default function SmartPlaylistsPage() {
|
|||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.smartPlaylists')}</h1>
|
||||
<PageTitle>{t('nav.smartPlaylists')}</PageTitle>
|
||||
<Link to="/smart-playlists/new" className={cn(buttonVariants(), 'h-11 gap-2')}>
|
||||
<Plus />
|
||||
{t('smart.new')}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useTrackList } from '@/api/catalog'
|
|||
import LoadMore from '@/components/LoadMore'
|
||||
import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
|
||||
import TrackList from '@/components/TrackList'
|
||||
import PageTitle from '@/components/PageTitle'
|
||||
|
||||
export default function SongsPage() {
|
||||
const { t } = useTranslation()
|
||||
|
|
@ -14,7 +15,7 @@ export default function SongsPage() {
|
|||
|
||||
return (
|
||||
<div className="flex flex-col gap-6">
|
||||
<h1 className="text-3xl font-extrabold tracking-tight">{t('nav.songs')}</h1>
|
||||
<PageTitle>{t('nav.songs')}</PageTitle>
|
||||
{query.isError ? (
|
||||
<ErrorMessage error={query.error} onRetry={() => query.refetch()} />
|
||||
) : query.isPending ? (
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue