2018-05-31 16:49:17 -04:00
|
|
|
const React = require('react');
|
|
|
|
const PropTypes = require('prop-types');
|
2018-10-23 11:37:59 -04:00
|
|
|
const FormattedMessage = require('react-intl').FormattedMessage;
|
2018-05-31 16:49:17 -04:00
|
|
|
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
|
|
|
const ThumbnailColumn = require('../../components/thumbnailcolumn/thumbnailcolumn.jsx');
|
|
|
|
const projectShape = require('./projectshape.jsx').projectShape;
|
|
|
|
|
|
|
|
const RemixList = props => {
|
|
|
|
const remixes = props.remixes;
|
|
|
|
if (remixes.length === 0) return null;
|
|
|
|
return (
|
|
|
|
<FlexRow className="remix-list">
|
2019-01-03 18:50:19 -05:00
|
|
|
<div className="list-header">
|
|
|
|
<div className="list-title">
|
|
|
|
<FormattedMessage id="project.remixes" />
|
|
|
|
</div>
|
|
|
|
<div className="list-header-link">
|
|
|
|
<a href={`/projects/${props.projectId}/remixes`}>
|
|
|
|
<FormattedMessage id="project.viewAllRemixes" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2018-08-28 17:01:36 -04:00
|
|
|
</div>
|
2018-05-31 16:49:17 -04:00
|
|
|
{remixes.length === 0 ? (
|
|
|
|
// TODO: style remix invitation
|
2018-10-24 09:35:30 -04:00
|
|
|
<FormattedMessage id="project.inviteToRemix" />
|
2018-05-31 16:49:17 -04:00
|
|
|
) : (
|
|
|
|
<ThumbnailColumn
|
|
|
|
cards
|
|
|
|
showAvatar
|
2018-12-11 14:46:05 -05:00
|
|
|
itemType="projects"
|
2018-05-31 16:49:17 -04:00
|
|
|
items={remixes.slice(0, 5)}
|
|
|
|
showFavorites={false}
|
|
|
|
showLoves={false}
|
|
|
|
showViews={false}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</FlexRow>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
RemixList.propTypes = {
|
2019-01-03 18:50:19 -05:00
|
|
|
projectId: PropTypes.string,
|
2018-05-31 16:49:17 -04:00
|
|
|
remixes: PropTypes.arrayOf(projectShape)
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = RemixList;
|