Merge pull request #2419 from rschamp/admin-panel-only-admins

Fix admin panel visibility and style
This commit is contained in:
Ray Schamp 2018-12-06 22:50:22 -05:00 committed by GitHub
commit c65ad06e91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 16 deletions

View file

@ -110,6 +110,7 @@ const PreviewPresentation = ({
remixes,
replies,
reportOpen,
showAdminPanel,
showModInfo,
singleCommentId,
userOwnsProject,
@ -180,6 +181,7 @@ const PreviewPresentation = ({
return (
<div className="preview">
{showAdminPanel && (
<AdminPanel
className={classNames('project-admin-panel', {
'admin-panel-open': adminPanelOpen,
@ -196,6 +198,7 @@ const PreviewPresentation = ({
src={`/scratch2/${projectId}/adminpanel/`}
/>
</AdminPanel>
)}
{ projectInfo && projectInfo.author && projectInfo.author.id && (
<React.Fragment>
{banner}
@ -646,6 +649,7 @@ PreviewPresentation.propTypes = {
remixes: PropTypes.arrayOf(PropTypes.object),
replies: PropTypes.objectOf(PropTypes.array),
reportOpen: PropTypes.bool,
showAdminPanel: PropTypes.bool,
showModInfo: PropTypes.bool,
singleCommentId: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
userOwnsProject: PropTypes.bool,

View file

@ -43,7 +43,7 @@ $stage-width: 480px;
.project-admin-panel.admin-panel-open {
padding: 0;
width: 237px;
width: 250px;
}
.admin-iframe {
@ -53,7 +53,7 @@ $stage-width: 480px;
z-index: 100;
margin: 0;
border: 0;
width: 237px;
width: 250px;
height: 100%;
}

View file

@ -576,6 +576,7 @@ class Preview extends React.Component {
replies={this.props.replies}
reportOpen={this.state.reportOpen}
showModInfo={this.props.isAdmin}
showAdminPanel={this.props.isAdmin}
singleCommentId={this.state.singleCommentId}
userOwnsProject={this.props.userOwnsProject}
visibilityInfo={this.props.visibilityInfo}