Unverified Commit c65ad06e authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

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

Fix admin panel visibility and style
parents 5235cb2e 0957173c
......@@ -110,6 +110,7 @@ const PreviewPresentation = ({
remixes,
replies,
reportOpen,
showAdminPanel,
showModInfo,
singleCommentId,
userOwnsProject,
......@@ -180,22 +181,24 @@ const PreviewPresentation = ({
return (
<div className="preview">
<AdminPanel
className={classNames('project-admin-panel', {
'admin-panel-open': adminPanelOpen,
'modal-open': adminModalOpen
})}
isOpen={adminPanelOpen}
onClose={onCloseAdminPanel}
onOpen={onOpenAdminPanel}
>
<iframe
className={classNames('admin-iframe', {
{showAdminPanel && (
<AdminPanel
className={classNames('project-admin-panel', {
'admin-panel-open': adminPanelOpen,
'modal-open': adminModalOpen
})}
src={`/scratch2/${projectId}/adminpanel/`}
/>
</AdminPanel>
isOpen={adminPanelOpen}
onClose={onCloseAdminPanel}
onOpen={onOpenAdminPanel}
>
<iframe
className={classNames('admin-iframe', {
'modal-open': adminModalOpen
})}
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,
......
......@@ -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%;
}
......
......@@ -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}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment