From f08c108eeebb5ea5433e97dfffc48f618509f60c Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Tue, 16 Jun 2020 22:25:07 -0400 Subject: [PATCH] EntityList lee una lista que tiene items esto es para agregar mas metadata, como por ejemplo, poner headers y esas cosas --- src/components/EntityList.jsx | 65 +++++++++++++++++------------------ src/views/Artist.jsx | 5 ++- src/views/Disc.jsx | 5 ++- src/views/Release.jsx | 5 ++- src/views/Search.jsx | 16 +++++++-- 5 files changed, 57 insertions(+), 39 deletions(-) diff --git a/src/components/EntityList.jsx b/src/components/EntityList.jsx index 4980121..0aee37b 100644 --- a/src/components/EntityList.jsx +++ b/src/components/EntityList.jsx @@ -4,42 +4,43 @@ import "./EntityList.scss" const EntityPlaceholder = (props) => { return ( -
  • -
    - - {props.cover &&
    } -
    -   -   -
    - -
    -
  • +
  • +
    + + {props.cover &&
    } +
    +   +   +
    + +
    +
  • ) } const EntityItem = (props) => { + const item = props.item; return ( -
  • -
    - - {props.cover && -
    - {props.cover} -
    - } -
    - {props.title} - {props.subtitle} -
    - - { props.widget && -
    - +
  • +
    + + {item.cover && +
    + {item.cover}
    } -
    -
  • +
    + {item.title} + {item.subtitle} +
    + + { item.widget && +
    + +
    + } + + ) } @@ -52,10 +53,8 @@ export const EntityList = (props) => { entities.push() } }else{ - entities = props.items.map(item => ); - } + entities = props.list.items.map(item => ); + } const className = props.grid ? "grid" : "column"; return ( diff --git a/src/views/Artist.jsx b/src/views/Artist.jsx index 6928b38..3720bd1 100644 --- a/src/views/Artist.jsx +++ b/src/views/Artist.jsx @@ -26,7 +26,10 @@ const Discs = (props) => { 'title': disc.title, 'subtitle': disc.artist.name })); - discsComponent = + const list = { + 'items': items + } + discsComponent = }else{ discsComponent =

    El artista no tiene discos

    } diff --git a/src/views/Disc.jsx b/src/views/Disc.jsx index 641d3b2..1b7d234 100644 --- a/src/views/Disc.jsx +++ b/src/views/Disc.jsx @@ -31,7 +31,10 @@ const Versions = (props) => { })); - versionsComponent = + const list = { + 'items': items + } + versionsComponent = } let paginateContent; diff --git a/src/views/Release.jsx b/src/views/Release.jsx index 0bce784..caba231 100644 --- a/src/views/Release.jsx +++ b/src/views/Release.jsx @@ -26,7 +26,10 @@ const Recordings = (props) => { 'widget': })); - recordingsComponent = + const list = { + 'items': items + } + recordingsComponent = } return ( diff --git a/src/views/Search.jsx b/src/views/Search.jsx index 47be901..0e72180 100644 --- a/src/views/Search.jsx +++ b/src/views/Search.jsx @@ -49,7 +49,11 @@ const SearchSongs = (props) => { 'subtitle': song.artist.name }; }); - songsComponent = + const list = { + 'items': items + } + songsComponent = + } let paginateComponent; @@ -107,7 +111,10 @@ const SearchDiscs = (props) => { 'title': disc.title, 'subtitle': disc.artist.name })); - discsComponent = + const list = { + 'items': items + } + discsComponent = } let paginateComponent; @@ -165,7 +172,10 @@ const SearchArtists = (props) => { 'title': artist.name, 'subtitle': [artist.type, artist.country].filter(Boolean).join(' - ') })); - artistsContent = + const list = { + 'items': items + } + artistsContent = } let paginateContent;