Artist Detail Page (first cut) (#1287)
* Configure fetching from API and route * pretty * Remove errors * Remove errors * Remove errors * Complete page for Desktop view * Fix error * Add xs Artist page * Remove unused import * Add styles for theme * Change route path * Remove artId useEffect array * Remove array * Fix cover load err * Add redirect on err * Remove route * What's in a name? consistency :) * Fix err * Fix UI changes * Fetch album from resource * Renaming done * Review changes * Some touch-up * Small refactor, to make naming and structure more consistent with AlbumShow * Make artist's album list similar to original implementation * Reuse AlbumGridView, to avoid duplication * Add feature flag to enable new Artist Page, default false * Better biography styling. Small refactorings, * Don't encode quotes and other symbols * Moved AlbumShow to correct folder Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Link } from 'react-admin'
|
||||
import { useAlbumsPerPage } from './index'
|
||||
import { withWidth } from '@material-ui/core'
|
||||
import { useAlbumsPerPage } from './index'
|
||||
import config from '../config'
|
||||
|
||||
export const useGetHandleArtistClick = (width) => {
|
||||
const [perPage] = useAlbumsPerPage(width)
|
||||
|
||||
return (id) => {
|
||||
return `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}`
|
||||
return config.devShowArtistPage
|
||||
? `/artist/${id}/show`
|
||||
: `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}`
|
||||
}
|
||||
}
|
||||
|
||||
export const ArtistLinkField = withWidth()(({ record, className, width }) => {
|
||||
const artistLink = useGetHandleArtistClick(width)
|
||||
|
||||
return (
|
||||
<Link
|
||||
to={artistLink(record.albumArtistId)}
|
||||
|
||||
Reference in New Issue
Block a user