fix(Challenges): Add child container for challenges

Add a central point for the completion modal to open
This commit is contained in:
Berkeley Martinez
2018-01-08 16:19:17 -08:00
parent 552f51624e
commit c372bd3cc5
8 changed files with 27 additions and 13 deletions

View File

@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import CompletionModal from './Completion-Modal.jsx';
import AppChildContainer from '../../Child-Container.jsx';
const propTypes = {
children: PropTypes.node
};
export default function ChildContainer({ children, ...props }) {
return (
<AppChildContainer { ...props }>
{ children }
<CompletionModal />
</AppChildContainer>
);
}
ChildContainer.propTypes = propTypes;

View File

@ -5,7 +5,6 @@ import { createSelector } from 'reselect';
import { challengeMetaSelector } from './redux'; import { challengeMetaSelector } from './redux';
import CompletionModal from './Completion-Modal.jsx';
import Classic from './views/classic'; import Classic from './views/classic';
import Step from './views/step'; import Step from './views/step';
import Project from './views/project'; import Project from './views/project';
@ -108,12 +107,7 @@ export class Show extends PureComponent {
render() { render() {
const { viewType } = this.props; const { viewType } = this.props;
const View = views[viewType] || Classic; const View = views[viewType] || Classic;
return ( return <View />;
<div>
<View />
<CompletionModal />
</div>
);
} }
} }

View File

@ -7,12 +7,12 @@ import { addNS } from 'berkeleys-redux-utils';
import ns from './ns.json'; import ns from './ns.json';
import Editor from './Editor.jsx'; import Editor from './Editor.jsx';
import ChildContainer from '../../Child-Container.jsx';
import { showPreviewSelector, types } from '../../redux'; import { showPreviewSelector, types } from '../../redux';
import SidePanel from '../../Side-Panel.jsx'; import SidePanel from '../../Side-Panel.jsx';
import Preview from '../../Preview.jsx'; import Preview from '../../Preview.jsx';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import ChildContainer from '../../../../Child-Container.jsx';
import { filesSelector } from '../../../../files'; import { filesSelector } from '../../../../files';
const createModernEditorToggleType = fileKey => const createModernEditorToggleType = fileKey =>

View File

@ -1,11 +1,11 @@
import React from 'react'; import React from 'react';
import { addNS } from 'berkeleys-redux-utils'; import { addNS } from 'berkeleys-redux-utils';
import ChildContainer from '../../Child-Container.jsx';
import BackEnd from './Back-End.jsx'; import BackEnd from './Back-End.jsx';
import { types } from '../../redux'; import { types } from '../../redux';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import ChildContainer from '../../../../Child-Container.jsx';
const propTypes = {}; const propTypes = {};

View File

@ -2,12 +2,12 @@ import React from 'react';
import { addNS } from 'berkeleys-redux-utils'; import { addNS } from 'berkeleys-redux-utils';
import Editor from './Editor.jsx'; import Editor from './Editor.jsx';
import ChildContainer from '../../Child-Container.jsx';
import { types, showPreviewSelector } from '../../redux'; import { types, showPreviewSelector } from '../../redux';
import Preview from '../../Preview.jsx'; import Preview from '../../Preview.jsx';
import SidePanel from '../../Side-Panel.jsx'; import SidePanel from '../../Side-Panel.jsx';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import ChildContainer from '../../../../Child-Container.jsx';
const propTypes = {}; const propTypes = {};

View File

@ -3,10 +3,10 @@ import { addNS } from 'berkeleys-redux-utils';
import ns from './ns.json'; import ns from './ns.json';
import Main from './Project.jsx'; import Main from './Project.jsx';
import ChildContainer from '../../Child-Container.jsx';
import { types } from '../../redux'; import { types } from '../../redux';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import ChildContainer from '../../../../Child-Container.jsx';
const propTypes = {}; const propTypes = {};
export const mapStateToPanes = addNS( export const mapStateToPanes = addNS(

View File

@ -3,10 +3,10 @@ import { addNS } from 'berkeleys-redux-utils';
import ns from './ns.json'; import ns from './ns.json';
import Main from './Quiz.jsx'; import Main from './Quiz.jsx';
import ChildContainer from '../../Child-Container.jsx';
import { types } from '../../redux'; import { types } from '../../redux';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import ChildContainer from '../../../../Child-Container.jsx';
const propTypes = {}; const propTypes = {};
export const mapStateToPanes = addNS( export const mapStateToPanes = addNS(

View File

@ -3,10 +3,10 @@ import { addNS } from 'berkeleys-redux-utils';
import ns from './ns.json'; import ns from './ns.json';
import Step from './Step.jsx'; import Step from './Step.jsx';
import ChildContainer from '../../Child-Container.jsx';
import { types } from '../../redux'; import { types } from '../../redux';
import Panes from '../../../../Panes'; import Panes from '../../../../Panes';
import _Map from '../../../../Map'; import _Map from '../../../../Map';
import ChildContainer from '../../../../Child-Container.jsx';
const propTypes = {}; const propTypes = {};
export const mapStateToPanes = addNS( export const mapStateToPanes = addNS(