scratch-www/src/views/preview/studio-list.jsx

38 lines
1.1 KiB
React
Raw Normal View History

const React = require('react');
const PropTypes = require('prop-types');
const FlexRow = require('../../components/flex-row/flex-row.jsx');
const ThumbnailColumn = require('../../components/thumbnailcolumn/thumbnailcolumn.jsx');
const projectShape = require('./projectshape.jsx').projectShape;
const StudioList = props => {
const studios = props.studios;
if (studios.length === 0) return null;
return (
2018-08-24 09:05:08 -04:00
<FlexRow className="studio-list">
2018-08-28 17:01:36 -04:00
<div className="list-title">
Studios
2018-08-28 17:01:36 -04:00
</div>
{studios.length === 0 ? (
// TODO: style remix invitation
<span>Invite user to add to studio</span>
) : (
<ThumbnailColumn
cards
showAvatar
itemType="studio"
items={studios.slice(0, 5)}
showFavorites={false}
showLoves={false}
showViews={false}
/>
)}
</FlexRow>
);
};
StudioList.propTypes = {
studios: PropTypes.arrayOf(projectShape)
};
module.exports = StudioList;