mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Merge pull request #2419 from rschamp/admin-panel-only-admins
Fix admin panel visibility and style
This commit is contained in:
commit
c65ad06e91
3 changed files with 21 additions and 16 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue