Feature(map): add super block message logic

This commit is contained in:
Berkeley Martinez
2016-06-23 16:08:01 -07:00
parent 566ad4fd24
commit b434ef6e43
5 changed files with 12 additions and 10 deletions

View File

@@ -11,11 +11,10 @@ import { toggleThisPanel } from '../../redux/actions';
const dispatchActions = { toggleThisPanel };
const mapStateToProps = createSelector(
(_, props) => props.dashedName,
state => state.entities.block,
(state, props) => state.entities.block[props.dashedName],
state => state.entities.challenge,
(state, props) => state.challengesApp.mapUi[props.dashedName],
(dashedName, blockMap, challengeMap, isOpen) => {
const block = blockMap[dashedName];
(dashedName, block, challengeMap, isOpen) => {
return {
isOpen,
dashedName,

View File

@@ -11,12 +11,14 @@ import { toggleThisPanel } from '../../redux/actions';
const dispatchActions = { toggleThisPanel };
const mapStateToProps = createSelector(
(_, props) => props.dashedName,
state => state.entities.superBlock,
(state, props) => state.entities.superBlock[props.dashedName],
(state, props) => state.challengesApp.mapUi[props.dashedName],
(dashedName, superBlockMap, isOpen) => ({
(dashedName, superBlock, isOpen) => ({
isOpen,
title: superBlockMap[dashedName].title,
blocks: superBlockMap[dashedName].blocks
dashedName,
title: superBlock.title,
blocks: superBlock.blocks,
message: superBlock.message
})
);
export class SuperBlock extends PureComponent {