mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Merge pull request #2506 from benjiwheeler/mod-info
added author username to moderation info area
This commit is contained in:
commit
293b7beefc
5 changed files with 24 additions and 1 deletions
|
@ -14,6 +14,14 @@ const ModInfo = props => (
|
|||
<FormattedMessage id="project.moderationInfoLabel" />
|
||||
</div>
|
||||
<FlexRow className="mod-info">
|
||||
{props.authorUsername &&
|
||||
<div className="mod-username">
|
||||
{/* @todo: these profile links should be made into a shared library function */}
|
||||
<a href={`/users/${props.authorUsername}/`}>
|
||||
{props.authorUsername}
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
{/* eslint-disable react/jsx-sort-props */}
|
||||
{props.revisedDate &&
|
||||
<div className="mod-date">
|
||||
|
@ -54,6 +62,7 @@ const ModInfo = props => (
|
|||
);
|
||||
|
||||
ModInfo.propTypes = {
|
||||
authorUsername: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
||||
revisedDate: PropTypes.string,
|
||||
scripts: PropTypes.number,
|
||||
sprites: PropTypes.number
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
|
||||
.mod-date,
|
||||
.mod-sprites,
|
||||
.mod-scripts {
|
||||
.mod-scripts,
|
||||
.mod-username {
|
||||
|
||||
display: inline;
|
||||
padding-right: 2rem;
|
||||
|
@ -68,3 +69,11 @@
|
|||
background-image: url("/svgs/project/block-count.svg");
|
||||
}
|
||||
}
|
||||
|
||||
.mod-username {
|
||||
|
||||
&:before {
|
||||
opacity: .5;
|
||||
background-image: url("/svgs/project/username.svg");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ const PreviewPresentation = ({
|
|||
adminModalOpen,
|
||||
adminPanelOpen,
|
||||
assetHost,
|
||||
authorUsername,
|
||||
backpackHost,
|
||||
canAddToStudio,
|
||||
canDeleteComments,
|
||||
|
@ -479,6 +480,7 @@ const PreviewPresentation = ({
|
|||
{showModInfo &&
|
||||
<FlexRow className="preview-row">
|
||||
<ModInfo
|
||||
authorUsername={authorUsername}
|
||||
revisedDate={revisedDate}
|
||||
scripts={modInfo.scriptCount}
|
||||
sprites={modInfo.spriteCount}
|
||||
|
@ -588,6 +590,7 @@ PreviewPresentation.propTypes = {
|
|||
adminModalOpen: PropTypes.bool,
|
||||
adminPanelOpen: PropTypes.bool,
|
||||
assetHost: PropTypes.string,
|
||||
authorUsername: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
||||
backpackHost: PropTypes.string,
|
||||
canAddToStudio: PropTypes.bool,
|
||||
canDeleteComments: PropTypes.bool,
|
||||
|
|
|
@ -572,6 +572,7 @@ class Preview extends React.Component {
|
|||
adminModalOpen={this.state.adminModalOpen}
|
||||
adminPanelOpen={this.state.adminPanelOpen}
|
||||
assetHost={this.props.assetHost}
|
||||
authorUsername={this.props.authorUsername}
|
||||
backpackHost={this.props.backpackHost}
|
||||
canAddToStudio={this.props.canAddToStudio}
|
||||
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
|
||||
|
|
1
static/svgs/project/username.svg
Normal file
1
static/svgs/project/username.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g transform="translate(3 3)" fill="#575E75" fill-rule="evenodd"><path d="M3.37 9h7.088a3.105 3.105 0 0 1 3.046 2.5l.259 1.305A1 1 0 0 1 12.782 14H1.18a1 1 0 0 1-.986-1.165L.418 11.5A2.993 2.993 0 0 1 3.37 9z"/><circle cx="7" cy="4" r="4"/></g></svg>
|
After Width: | Height: | Size: 313 B |
Loading…
Reference in a new issue