Commit 23f7e563 authored by Paul Kaplan's avatar Paul Kaplan

Include deleted studio banner

parent 43b8b74d
...@@ -26,6 +26,7 @@ const getInitialState = () => ({ ...@@ -26,6 +26,7 @@ const getInitialState = () => ({
followers: 0, followers: 0,
managers: 0, managers: 0,
owner: null, owner: null,
public: null,
// BEWARE: classroomId is only loaded if the user is an educator // BEWARE: classroomId is only loaded if the user is an educator
classroomId: null, classroomId: null,
...@@ -111,6 +112,7 @@ const selectIsFetchingInfo = state => state.studio.infoStatus === Status.FETCHIN ...@@ -111,6 +112,7 @@ const selectIsFetchingInfo = state => state.studio.infoStatus === Status.FETCHIN
const selectIsFollowing = state => state.studio.following; const selectIsFollowing = state => state.studio.following;
const selectIsFetchingRoles = state => state.studio.rolesStatus === Status.FETCHING; const selectIsFetchingRoles = state => state.studio.rolesStatus === Status.FETCHING;
const selectClassroomId = state => state.studio.classroomId; const selectClassroomId = state => state.studio.classroomId;
const selectStudioPublic = state => state.studio.public;
// Thunks // Thunks
const getInfo = () => ((dispatch, getState) => { const getInfo = () => ((dispatch, getState) => {
...@@ -133,7 +135,8 @@ const getInfo = () => ((dispatch, getState) => { ...@@ -133,7 +135,8 @@ const getInfo = () => ((dispatch, getState) => {
followers: body.stats.followers, followers: body.stats.followers,
managers: body.stats.managers, managers: body.stats.managers,
projectCount: body.stats.projects, projectCount: body.stats.projects,
owner: body.owner owner: body.owner,
public: body.public
})); }));
}); });
}); });
...@@ -202,5 +205,6 @@ module.exports = { ...@@ -202,5 +205,6 @@ module.exports = {
selectIsFetchingInfo, selectIsFetchingInfo,
selectIsFetchingRoles, selectIsFetchingRoles,
selectIsFollowing, selectIsFollowing,
selectClassroomId selectClassroomId,
selectStudioPublic
}; };
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
"studio.tabNavCommentsWithCount": "Comments {commentCount}", "studio.tabNavCommentsWithCount": "Comments {commentCount}",
"studio.tabNavActivity": "Activity", "studio.tabNavActivity": "Activity",
"studio.showingDeleted": "Showing Deleted Studio",
"studio.title": "Title", "studio.title": "Title",
"studio.description": "Description", "studio.description": "Description",
"studio.thumbnail": "Thumbnail", "studio.thumbnail": "Thumbnail",
......
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import {FormattedMessage} from 'react-intl';
import {selectStudioPublic} from '../../redux/studio';
const StudioDeleted = ({deleted}) => {
if (!deleted) return null;
return (<div className="studio-deleted studio-info-box studio-info-box-error">
<FormattedMessage id="studio.showingDeleted" />
</div>);
};
StudioDeleted.propTypes = {
deleted: PropTypes.bool
};
export default connect(
state => ({
deleted: selectStudioPublic(state) === false
})
)(StudioDeleted);
...@@ -25,6 +25,7 @@ import StudioActivity from './studio-activity.jsx'; ...@@ -25,6 +25,7 @@ import StudioActivity from './studio-activity.jsx';
import StudioCuratorInvite from './studio-curator-invite.jsx'; import StudioCuratorInvite from './studio-curator-invite.jsx';
import StudioMeta from './studio-meta.jsx'; import StudioMeta from './studio-meta.jsx';
import StudioAdminPanel from './studio-admin-panel.jsx'; import StudioAdminPanel from './studio-admin-panel.jsx';
import StudioDeleted from './studio-deleted.jsx';
import { import {
projects, projects,
...@@ -57,6 +58,7 @@ const StudioShell = ({isAdmin, showCuratorMuteError, muteExpiresAtMs, studioLoad ...@@ -57,6 +58,7 @@ const StudioShell = ({isAdmin, showCuratorMuteError, muteExpiresAtMs, studioLoad
studioLoadFailed ? studioLoadFailed ?
<NotAvailable /> : <NotAvailable /> :
<div className="studio-shell"> <div className="studio-shell">
<StudioDeleted />
<StudioMeta /> <StudioMeta />
<div className="studio-info"> <div className="studio-info">
<StudioInfo /> <StudioInfo />
......
...@@ -46,6 +46,13 @@ $radius: 8px; ...@@ -46,6 +46,13 @@ $radius: 8px;
} }
} }
.studio-deleted {
/* Always make this box take up all the columns */
grid-column: 1 / -1;
padding: 1rem;
box-sizing: border-box;
}
.studio-info { .studio-info {
justify-self: center; justify-self: center;
width: 300px; width: 300px;
......
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