Feature(map): add super block message logic
This commit is contained in:
@ -11,11 +11,10 @@ import { toggleThisPanel } from '../../redux/actions';
|
|||||||
const dispatchActions = { toggleThisPanel };
|
const dispatchActions = { toggleThisPanel };
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
(_, props) => props.dashedName,
|
(_, props) => props.dashedName,
|
||||||
state => state.entities.block,
|
(state, props) => state.entities.block[props.dashedName],
|
||||||
state => state.entities.challenge,
|
state => state.entities.challenge,
|
||||||
(state, props) => state.challengesApp.mapUi[props.dashedName],
|
(state, props) => state.challengesApp.mapUi[props.dashedName],
|
||||||
(dashedName, blockMap, challengeMap, isOpen) => {
|
(dashedName, block, challengeMap, isOpen) => {
|
||||||
const block = blockMap[dashedName];
|
|
||||||
return {
|
return {
|
||||||
isOpen,
|
isOpen,
|
||||||
dashedName,
|
dashedName,
|
||||||
|
@ -11,12 +11,14 @@ import { toggleThisPanel } from '../../redux/actions';
|
|||||||
const dispatchActions = { toggleThisPanel };
|
const dispatchActions = { toggleThisPanel };
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
(_, props) => props.dashedName,
|
(_, props) => props.dashedName,
|
||||||
state => state.entities.superBlock,
|
(state, props) => state.entities.superBlock[props.dashedName],
|
||||||
(state, props) => state.challengesApp.mapUi[props.dashedName],
|
(state, props) => state.challengesApp.mapUi[props.dashedName],
|
||||||
(dashedName, superBlockMap, isOpen) => ({
|
(dashedName, superBlock, isOpen) => ({
|
||||||
isOpen,
|
isOpen,
|
||||||
title: superBlockMap[dashedName].title,
|
dashedName,
|
||||||
blocks: superBlockMap[dashedName].blocks
|
title: superBlock.title,
|
||||||
|
blocks: superBlock.blocks,
|
||||||
|
message: superBlock.message
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
export class SuperBlock extends PureComponent {
|
export class SuperBlock extends PureComponent {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"order": 23,
|
"order": 23,
|
||||||
"time": "70 Hours",
|
"time": "70 Hours",
|
||||||
"isLocked": true,
|
"isLocked": true,
|
||||||
"message": "To qualify for these nonprofit projects, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End",
|
"message": "To qualify for the coding interview preparation, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"title": "Soft Skill Training"
|
"title": "Soft Skill Training"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"order": 24,
|
"order": 24,
|
||||||
"time": "10 Hours",
|
"time": "10 Hours",
|
||||||
"isLocked": true,
|
"isLocked": true,
|
||||||
"message": "To qualify for these nonprofit projects, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End",
|
"message": "To qualify for the coding interview preparation, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"title": "Mock Interview #1"
|
"title": "Mock Interview #1"
|
||||||
|
@ -59,7 +59,8 @@ function cachedMap(Block) {
|
|||||||
order: block.superOrder,
|
order: block.superOrder,
|
||||||
name: nameify(_.startCase(block.superBlock)),
|
name: nameify(_.startCase(block.superBlock)),
|
||||||
dashedName: block.superBlock,
|
dashedName: block.superBlock,
|
||||||
blocks: [block]
|
blocks: [block],
|
||||||
|
message: block.superBlockMessage
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
|
Reference in New Issue
Block a user