fallback to album art for artist cover

play top songs when pressed
This commit is contained in:
austinried
2021-07-17 11:27:34 +09:00
parent de342c0830
commit 62b27974a7
2 changed files with 52 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ interface ArtistArtXUpProps extends ArtistArtSizeProps {
interface ArtistArtProps extends ArtistArtSizeProps {
id: string
round?: boolean
}
const PlaceholderContainer: React.FC<ArtistArtSizeProps> = ({ height, width, children }) => {
@@ -135,9 +136,11 @@ const NoneUp = React.memo<ArtistArtSizeProps>(({ height, width }) => (
<PlaceholderContainer height={height} width={width} />
))
const ArtistArt = React.memo<ArtistArtProps>(({ id, height, width }) => {
const ArtistArt = React.memo<ArtistArtProps>(({ id, height, width, round }) => {
const artistArt = useAtomValue(artistArtAtomFamily(id))
round = round === undefined ? true : round
const Placeholder = () => {
const none = <NoneUp height={height} width={width} />
@@ -163,7 +166,7 @@ const ArtistArt = React.memo<ArtistArtProps>(({ id, height, width }) => {
}
return (
<View style={[styles.container, { borderRadius: height / 2 }]}>
<View style={[styles.container, round ? { borderRadius: height / 2 } : {}]}>
<CoverArt
PlaceholderComponent={Placeholder}
height={height}