From 943017bd1c3d6338981720353a9a0f63117d829b Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Mon, 15 Jun 2020 03:26:26 -0400 Subject: [PATCH] EntityList en pagina de artista --- src/components/Artist.jsx | 42 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/components/Artist.jsx b/src/components/Artist.jsx index ab2b516..2c5a5fa 100644 --- a/src/components/Artist.jsx +++ b/src/components/Artist.jsx @@ -1,7 +1,8 @@ -import React, {useEffect, useState} from 'react' +import React, {Fragment, useEffect, useState} from 'react' import {getArtist, getArtistDiscs} from "../services/entity_service"; -import {CoverWithCaption} from './CoverArt'; +import {CoverArt} from './CoverArt'; import {Paginate} from "./Paginate"; +import {EntityList} from "./EntityList"; import queryString from "query-string"; @@ -13,30 +14,15 @@ const Discs = (props) => { props.onPageChanged(page); } - const handleClick = (disc) => (evt) => { - evt.preventDefault(); - props.navigateToDisc(disc); - } - - let discContent; + let discsComponent = ; if (discs) { - discContent = ( - - ); - } else { - discContent = ( - - ); + const items = discs.map((disc) => ({ + 'cover': , + 'link': `/disc/${disc.id}`, + 'title': disc.title, + 'subtitle': disc.artist.name + })); + discsComponent = } let paginateContent; @@ -45,13 +31,15 @@ const Discs = (props) => { const currentPage = paginate.current_page; const pageLimit = paginate.per_page; - paginateContent = + paginateContent = } return (

Discos

- {discContent} + {discsComponent} {paginateContent}
)