Widget en entityitem
This commit is contained in:
@@ -5,6 +5,7 @@ import "./EntityList.scss"
|
|||||||
const EntityPlaceholder = (props) => {
|
const EntityPlaceholder = (props) => {
|
||||||
return (
|
return (
|
||||||
<li className={'entity-item ' + (props.cover ? '' : 'pulsating')}>
|
<li className={'entity-item ' + (props.cover ? '' : 'pulsating')}>
|
||||||
|
<div class="entity-container">
|
||||||
<Link to={props.link}>
|
<Link to={props.link}>
|
||||||
{props.cover && <div className='cover pulsating'/>}
|
{props.cover && <div className='cover pulsating'/>}
|
||||||
<div className='body'>
|
<div className='body'>
|
||||||
@@ -12,6 +13,7 @@ const EntityPlaceholder = (props) => {
|
|||||||
<span className='subtitle'> </span>
|
<span className='subtitle'> </span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -19,6 +21,7 @@ const EntityPlaceholder = (props) => {
|
|||||||
const EntityItem = (props) => {
|
const EntityItem = (props) => {
|
||||||
return (
|
return (
|
||||||
<li className={'entity-item ' + (props.selected ? 'selected' : '')} id={props.id}>
|
<li className={'entity-item ' + (props.selected ? 'selected' : '')} id={props.id}>
|
||||||
|
<div class="entity-container">
|
||||||
<Link to={props.link}>
|
<Link to={props.link}>
|
||||||
{props.cover &&
|
{props.cover &&
|
||||||
<div className='cover'>
|
<div className='cover'>
|
||||||
@@ -30,6 +33,12 @@ const EntityItem = (props) => {
|
|||||||
<span className='subtitle'>{props.subtitle}</span>
|
<span className='subtitle'>{props.subtitle}</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
{ props.widget &&
|
||||||
|
<div class="widget">
|
||||||
|
<button class='button'>Agregar a mi lista</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -45,7 +54,7 @@ export const EntityList = (props) => {
|
|||||||
}else{
|
}else{
|
||||||
entities = props.items.map(item => <EntityItem id={item.id} cover={item.cover} link={item.link}
|
entities = props.items.map(item => <EntityItem id={item.id} cover={item.cover} link={item.link}
|
||||||
title={item.title} subtitle={item.subtitle}
|
title={item.title} subtitle={item.subtitle}
|
||||||
selected={item.selected}/>);
|
selected={item.selected} widget={item.widget}/>);
|
||||||
}
|
}
|
||||||
|
|
||||||
const className = props.grid ? "grid" : "column";
|
const className = props.grid ? "grid" : "column";
|
||||||
|
|||||||
@@ -29,19 +29,31 @@
|
|||||||
|
|
||||||
// Column mode
|
// Column mode
|
||||||
.entity-list.column {
|
.entity-list.column {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.entity-item a {
|
.entity-item .entity-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
a {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
padding: 1em 1em;
|
padding: 1em 1em;
|
||||||
|
|
||||||
|
flex-grow: 2;
|
||||||
.body {
|
.body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-right: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grid mode
|
// Grid mode
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ button.button {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: var(--font-5);
|
font-size: var(--font-5);
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ const Recordings = (props) => {
|
|||||||
{recording.length && <div>[{toDuration(recording.length)}]</div>}
|
{recording.length && <div>[{toDuration(recording.length)}]</div>}
|
||||||
{recording.disambiguation && <div>{capitalize(recording.disambiguation)}</div>}
|
{recording.disambiguation && <div>{capitalize(recording.disambiguation)}</div>}
|
||||||
</Fragment>),
|
</Fragment>),
|
||||||
'selected': props.selected === recording.id
|
'selected': props.selected === recording.id,
|
||||||
|
'widget': <button className='button'>Agregar a mi lista</button>
|
||||||
|
|
||||||
}));
|
}));
|
||||||
recordingsComponent = <EntityList items={items}/>
|
recordingsComponent = <EntityList items={items}/>
|
||||||
|
|||||||
Reference in New Issue
Block a user