Issue #5: Creacion de boton AddToList
This commit is contained in:
5
src/components/AddToList.jsx
Normal file
5
src/components/AddToList.jsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export const AddToList = (props) => {
|
||||
return <button className='button'>Agregar a mi lista</button>
|
||||
}
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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/>
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}/>
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user