mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-25 22:04:20 -05:00
Remove Debug component in studios
This commit is contained in:
parent
fa8aff5837
commit
ae202c7bcd
7 changed files with 53 additions and 40 deletions
|
@ -1,18 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
const Debug = ({label, data}) => (<div style={{padding: '2rem', border: '1px solid red', margin: '2rem'}}>
|
|
||||||
<small>{label}</small>
|
|
||||||
<code>
|
|
||||||
<pre style={{fontSize: '0.75rem'}}>
|
|
||||||
{JSON.stringify(data, null, ' ')}
|
|
||||||
</pre>
|
|
||||||
</code>
|
|
||||||
</div>);
|
|
||||||
|
|
||||||
Debug.propTypes = {
|
|
||||||
label: PropTypes.string,
|
|
||||||
data: PropTypes.any // eslint-disable-line react/forbid-prop-types
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Debug;
|
|
|
@ -21,6 +21,12 @@
|
||||||
"studio.followErrors.confirmEmail": "Please confirm your email address first",
|
"studio.followErrors.confirmEmail": "Please confirm your email address first",
|
||||||
"studio.followErrors.generic": "Something went wrong following the studio",
|
"studio.followErrors.generic": "Something went wrong following the studio",
|
||||||
|
|
||||||
|
"studio.sectionLoadError.projectsHeadline": "Something went wrong loading projects",
|
||||||
|
"studio.sectionLoadError.curatorsHeadline": "Something went wrong loading curators",
|
||||||
|
"studio.sectionLoadError.managersHeadline": "Something went wrong loading managers",
|
||||||
|
"studio.sectionLoadError.activityHeadline": "Something went wrong loading managers",
|
||||||
|
"studio.sectionLoadError.tryAgain": "Try again",
|
||||||
|
|
||||||
"studio.projectsHeader": "Projects",
|
"studio.projectsHeader": "Projects",
|
||||||
"studio.addProjectsHeader": "Add Projects",
|
"studio.addProjectsHeader": "Add Projects",
|
||||||
"studio.addProject": "Add",
|
"studio.addProject": "Add",
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {connect} from 'react-redux';
|
||||||
|
|
||||||
import {activity} from './lib/redux-modules';
|
import {activity} from './lib/redux-modules';
|
||||||
import {loadActivity} from './lib/studio-activity-actions';
|
import {loadActivity} from './lib/studio-activity-actions';
|
||||||
import Debug from './debug.jsx';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import SocialMessage from '../../components/social-message/social-message.jsx';
|
import SocialMessage from '../../components/social-message/social-message.jsx';
|
||||||
|
@ -181,10 +180,15 @@ const StudioActivity = ({items, loading, error, moreToLoad, onLoadMore}) => {
|
||||||
<h2><FormattedMessage id="studio.activityHeader" /></h2>
|
<h2><FormattedMessage id="studio.activityHeader" /></h2>
|
||||||
</div>
|
</div>
|
||||||
{loading && <div>Loading...</div>}
|
{loading && <div>Loading...</div>}
|
||||||
{error && <Debug
|
{error && <div className="studio-section-load-error studio-info-box studio-info-box-error">
|
||||||
label="Error"
|
<h3><FormattedMessage id="studio.sectionLoadError.activityHeadline" /></h3>
|
||||||
data={error}
|
<button
|
||||||
/>}
|
className="button"
|
||||||
|
onClick={onLoadMore}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="studio.sectionLoadError.tryAgain" />
|
||||||
|
</button>
|
||||||
|
</div>}
|
||||||
<ul
|
<ul
|
||||||
className="studio-messages-list"
|
className="studio-messages-list"
|
||||||
>
|
>
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {FormattedMessage} from 'react-intl';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import {curators} from './lib/redux-modules';
|
import {curators} from './lib/redux-modules';
|
||||||
import Debug from './debug.jsx';
|
|
||||||
import {CuratorTile} from './studio-member-tile.jsx';
|
import {CuratorTile} from './studio-member-tile.jsx';
|
||||||
import CuratorInviter from './studio-curator-inviter.jsx';
|
import CuratorInviter from './studio-curator-inviter.jsx';
|
||||||
import {loadCurators} from './lib/studio-member-actions';
|
import {loadCurators} from './lib/studio-member-actions';
|
||||||
|
@ -28,10 +27,15 @@ const StudioCurators = ({
|
||||||
<h2><FormattedMessage id="studio.curatorsHeader" /></h2>
|
<h2><FormattedMessage id="studio.curatorsHeader" /></h2>
|
||||||
</div>
|
</div>
|
||||||
{canInviteCurators && <CuratorInviter />}
|
{canInviteCurators && <CuratorInviter />}
|
||||||
{error && <Debug
|
{error && <div className="studio-section-load-error studio-info-box studio-info-box-error">
|
||||||
label="Error"
|
<h3><FormattedMessage id="studio.sectionLoadError.curatorsHeadline" /></h3>
|
||||||
data={error}
|
<button
|
||||||
/>}
|
className="button"
|
||||||
|
onClick={onLoadMore}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="studio.sectionLoadError.tryAgain" />
|
||||||
|
</button>
|
||||||
|
</div>}
|
||||||
<div className="studio-members-grid">
|
<div className="studio-members-grid">
|
||||||
{items.length === 0 && !loading ? (
|
{items.length === 0 && !loading ? (
|
||||||
<div className="studio-empty">
|
<div className="studio-empty">
|
||||||
|
|
|
@ -12,7 +12,6 @@ import {
|
||||||
selectStudioHasReachedManagerThreshold
|
selectStudioHasReachedManagerThreshold
|
||||||
} from '../../redux/studio.js';
|
} from '../../redux/studio.js';
|
||||||
import {loadManagers} from './lib/studio-member-actions';
|
import {loadManagers} from './lib/studio-member-actions';
|
||||||
import Debug from './debug.jsx';
|
|
||||||
import {ManagerTile} from './studio-member-tile.jsx';
|
import {ManagerTile} from './studio-member-tile.jsx';
|
||||||
import StudioInfoBox from './studio-info-box.jsx';
|
import StudioInfoBox from './studio-info-box.jsx';
|
||||||
import AlertProvider from '../../components/alert/alert-provider.jsx';
|
import AlertProvider from '../../components/alert/alert-provider.jsx';
|
||||||
|
@ -85,10 +84,15 @@ const StudioManagers = ({
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{error && <Debug
|
{error && <div className="studio-section-load-error studio-info-box studio-info-box-error">
|
||||||
label="Error"
|
<h3><FormattedMessage id="studio.sectionLoadError.managersHeadline" /></h3>
|
||||||
data={error}
|
<button
|
||||||
/>}
|
className="button"
|
||||||
|
onClick={onLoadMore}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="studio.sectionLoadError.tryAgain" />
|
||||||
|
</button>
|
||||||
|
</div>}
|
||||||
<div className="studio-members-grid">
|
<div className="studio-members-grid">
|
||||||
{items.map(item =>
|
{items.map(item =>
|
||||||
(<ManagerTile
|
(<ManagerTile
|
||||||
|
|
|
@ -7,7 +7,6 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import {projects} from './lib/redux-modules';
|
import {projects} from './lib/redux-modules';
|
||||||
import {selectCanAddProjects, selectCanEditOpenToAll, selectShowProjectMuteError} from '../../redux/studio-permissions';
|
import {selectCanAddProjects, selectCanEditOpenToAll, selectShowProjectMuteError} from '../../redux/studio-permissions';
|
||||||
import Debug from './debug.jsx';
|
|
||||||
import StudioProjectAdder from './studio-project-adder.jsx';
|
import StudioProjectAdder from './studio-project-adder.jsx';
|
||||||
import StudioProjectTile from './studio-project-tile.jsx';
|
import StudioProjectTile from './studio-project-tile.jsx';
|
||||||
import {loadProjects} from './lib/studio-project-actions.js';
|
import {loadProjects} from './lib/studio-project-actions.js';
|
||||||
|
@ -24,7 +23,7 @@ const StudioProjects = ({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (items.length === 0) onLoadMore();
|
if (items.length === 0) onLoadMore();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AlertProvider>
|
<AlertProvider>
|
||||||
<div className="studio-projects">
|
<div className="studio-projects">
|
||||||
|
@ -49,12 +48,19 @@ const StudioProjects = ({
|
||||||
</CommentingStatus>
|
</CommentingStatus>
|
||||||
}
|
}
|
||||||
{canAddProjects && <StudioProjectAdder />}
|
{canAddProjects && <StudioProjectAdder />}
|
||||||
{error && <Debug
|
|
||||||
label="Error"
|
{error && <div className="studio-section-load-error studio-info-box studio-info-box-error">
|
||||||
data={error}
|
<h3><FormattedMessage id="studio.sectionLoadError.projectsHeadline" /></h3>
|
||||||
/>}
|
<button
|
||||||
|
className="button"
|
||||||
|
onClick={onLoadMore}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="studio.sectionLoadError.tryAgain" />
|
||||||
|
</button>
|
||||||
|
</div>}
|
||||||
|
|
||||||
<div className="studio-projects-grid">
|
<div className="studio-projects-grid">
|
||||||
{items.length === 0 && !loading ? (
|
{items.length === 0 && !loading && !error ? (
|
||||||
<div className="studio-empty">
|
<div className="studio-empty">
|
||||||
{canAddProjects ? (
|
{canAddProjects ? (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|
|
@ -174,6 +174,13 @@ $radius: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.studio-section-load-error {
|
||||||
|
margin-top: 2rem;
|
||||||
|
padding: 1rem;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.studio-tab-nav {
|
.studio-tab-nav {
|
||||||
border-bottom: 1px solid $active-dark-gray;
|
border-bottom: 1px solid $active-dark-gray;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
|
|
Loading…
Reference in a new issue