Issue #5: Creacion de boton AddToList

This commit is contained in:
Daniel Cortes
2020-06-19 05:56:55 -04:00
parent 5fea207523
commit ebda82edb3
6 changed files with 13 additions and 12 deletions

View File

@@ -0,0 +1,5 @@
import React from "react";
export const AddToList = (props) => {
return <button className='button'>Agregar a mi lista</button>
}

View File

@@ -1,10 +1,12 @@
import React from "react";
import "./Entity.scss"
import "./Entity.scss";
import {AddToList} from "./AddToList";
export const Entity = (props) => {
const hasCover = props.cover;
const hasTags = props.tags && props.tags.length > 0;
const hasButton = props.onButtonClick || props.buttonText
return (
<div className='entity'>
@@ -20,9 +22,7 @@ export const Entity = (props) => {
</ul>
}
</div>
{hasButton &&
<button className='button' onClick={props.onButtonClick}>{props.buttonText}</button>
}
<AddToList/>
</div>
{hasCover &&

View File

@@ -61,8 +61,7 @@ const Artist = (props) => {
if (artist){
return <Entity title={artist.name}
subtitle={[artist.type, artist.country].filter(Boolean).join(' - ')}
tags={artist.tags.map((tag) => (tag.name))}
buttonText='Agregar a mi lista'/>
tags={artist.tags.map((tag) => (tag.name))}/>
}else {
return <Fragment/>
}

View File

@@ -68,7 +68,6 @@ const Disc = (props) => {
)
return <Entity title={disc.title}
subtitle={subtitle}
buttonText='Agregar a mi lista'
cover={<CoverArt disc={disc} popup={true} size={4}/>}/>
}else {
return <Fragment></Fragment>

View File

@@ -31,8 +31,7 @@ const Recordings = (props) => {
{recording.disambiguation &&
<div>{capitalize(recording.disambiguation)}</div>}
</Fragment>),
'selected': props.selected === recording.id,
'widget': <button className='button'>Agregar a mi lista</button>
'selected': props.selected === recording.id
}))
}));
@@ -57,7 +56,6 @@ const Release = (props) => {
)
return <Entity title={release.title}
subtitle={subtitle}
buttonText='Agregar a mi lista'
cover={<CoverArt release={release} popup={true} size={4}/>}/>
}else {
return <Fragment></Fragment>

View File

@@ -23,7 +23,7 @@ const Song = (props) => {
subtitle = <span>[{toDuration(song.length)}]</span>
}
return <Entity title={song.title} subtitle={subtitle} buttonText='Agregar a mi lista'/>
return <Entity title={song.title} subtitle={subtitle}/>
}