* chore(packages): Update redux utils * feat(Panes): Invert control of panes map creation * feat(Modern): Add view * feat(Panes): Decouple panes from Challenges * fix(Challenges): Decouple challenge views from panes map * fix(Challenge/views): PanesMap => mapStateToPanesMap This clarifies what these functions are doing * fix(Challenges): Add view type * fix(Panes): Remove unneeded panes container * feat(Panes): Invert control of pane content render This decouples the Panes from the content they render, allowing for greater flexibility. * feat(Modern): Add side panel This is common between modern and classic * feat(seed): Array to string file content * fix(files): Modern files should be polyvinyls * feat(Modern): Create editors per file * fix(seed/React): Incorrect keyfile name * feat(Modern): Highligh jsx correctly This adds highlighting for jsx. Unfortunately, this disables linting for non-javascript files as jshint will only work for those * feat(rechallenge): Add jsx ext to babel transformer * feat(seed): Normalize challenge files head/tail/content * refactor(rechallenge/build): Rename function * fix(code-storage): Pull in files from localStorage * feat(Modern/React): Add Enzyme to test runner This enables testing of React challenges * feat(Modern): Add submission type * refactor(Panes): Rename panes map update action
40 lines
875 B
JavaScript
40 lines
875 B
JavaScript
import React from 'react';
|
|
import { addNS } from 'berkeleys-redux-utils';
|
|
|
|
import BackEnd from './Back-End.jsx';
|
|
import { types } from '../../redux';
|
|
import Panes from '../../../../Panes';
|
|
import _Map from '../../../../Map';
|
|
import ChildContainer from '../../../../Child-Container.jsx';
|
|
|
|
const propTypes = {};
|
|
|
|
export const mapStateToPanes = addNS(
|
|
'backend',
|
|
() => ({
|
|
[types.toggleMap]: 'Map',
|
|
[types.toggleMain]: 'Main'
|
|
})
|
|
);
|
|
|
|
const nameToComponent = {
|
|
Map: _Map,
|
|
Main: BackEnd
|
|
};
|
|
|
|
const renderPane = name => {
|
|
const Comp = nameToComponent[name];
|
|
return Comp ? <Comp /> : <span>Pane { name } not found</span>;
|
|
};
|
|
|
|
export default function ShowBackEnd() {
|
|
return (
|
|
<ChildContainer isFullWidth={ true }>
|
|
<Panes render={ renderPane } />
|
|
</ChildContainer>
|
|
);
|
|
}
|
|
|
|
ShowBackEnd.displayName = 'ShowBackEnd';
|
|
ShowBackEnd.propTypes = propTypes;
|