From edec88f0ab31bc9bae08e52d9c93152ae8646587 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Tue, 18 Dec 2018 10:33:43 -0500 Subject: [PATCH] added author username to moderation info area --- src/views/preview/mod-info.jsx | 9 +++++++++ src/views/preview/mod-info.scss | 21 +++++++++++++++++++++ src/views/preview/presentation.jsx | 3 +++ src/views/preview/project-view.jsx | 1 + static/svgs/project/username.svg | 1 + 5 files changed, 35 insertions(+) create mode 100644 static/svgs/project/username.svg diff --git a/src/views/preview/mod-info.jsx b/src/views/preview/mod-info.jsx index 97e38b165..f2f64db09 100644 --- a/src/views/preview/mod-info.jsx +++ b/src/views/preview/mod-info.jsx @@ -14,6 +14,14 @@ const ModInfo = props => ( + {props.authorUsername && +
+ {/* @todo: these profile links should be made into a shared library function */} + + {props.authorUsername} + +
+ } {/* eslint-disable react/jsx-sort-props */} {props.revisedDate &&
@@ -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 diff --git a/src/views/preview/mod-info.scss b/src/views/preview/mod-info.scss index a03518013..0b3d1ced7 100644 --- a/src/views/preview/mod-info.scss +++ b/src/views/preview/mod-info.scss @@ -24,6 +24,27 @@ } } +.mod-username { + + display: inline; + padding-right: 2rem; + font-size: .875rem; + + &:before { + display: inline-block; + margin-right: .5rem; + background-repeat: no-repeat; + background-position: center center; + background-size: contain; + width: 1.5rem; + height: 1.5rem; + vertical-align: -.35rem; + content: ""; + opacity: .5; + background-image: url("/svgs/project/username.svg"); + } +} + .mod-date, .mod-sprites, .mod-scripts { diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index 7e08ac84d..c09dff80f 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -49,6 +49,7 @@ const PreviewPresentation = ({ adminModalOpen, adminPanelOpen, assetHost, + authorUsername, backpackHost, canAddToStudio, canDeleteComments, @@ -477,6 +478,7 @@ const PreviewPresentation = ({ {showModInfo && \ No newline at end of file