scratch-www/src/views/preview/remix-credit.jsx
chrisgarrity 6872cfc51f FIxing PR #1900 comments
addresses most comments except modal refactor, and error response from sumitting report.
* restore gui as a dev dependency
* better separation of view container/presentation
* replace absolute heights for textareas with making all sub components `display: flex`
* start to make presentation more modular added subcomponents to the view folder:
  * share-banner (moved from components)
  * remix-credit
  * remix-list
  * studio-list
2018-05-31 21:04:11 -04:00

34 lines
1.1 KiB
JavaScript

const React = require('react');
const FlexRow = require('../../components/flex-row/flex-row.jsx');
const Avatar = require('../../components/avatar/avatar.jsx');
const projectShape = require('./projectshape.jsx').projectShape;
const RemixCredit = props => {
const projectInfo = props.projectInfo;
if (Object.keys(projectInfo).length === 0) return null;
return (
<FlexRow className="remix-credit">
<Avatar
className="remix"
src={`https://cdn2.scratch.mit.edu/get_image/user/${projectInfo.author.id}_48x48.png`}
/>
<div className="credit-text">
Thanks to <a
href={`/users/${projectInfo.author.username}`}
>
{projectInfo.author.username}
</a> for the original project <a
href={`/preview/${projectInfo.id}`}
>
{projectInfo.title}
</a>.
</div>
</FlexRow>
);
};
RemixCredit.propTypes = {
projectInfo: projectShape
};
module.exports = RemixCredit;