diff --git a/src/reducers/cards.js b/src/reducers/cards.js index 37319cbea06d82c0e2ac65e97d7a211eb5e18db9..abd0189069e1b4d677af3e30bd6f95c54addf4ae 100644 --- a/src/reducers/cards.js +++ b/src/reducers/cards.js @@ -3,6 +3,7 @@ import analytics from '../lib/analytics'; import decks from '../lib/libraries/decks/index.jsx'; const CLOSE_CARDS = 'scratch-gui/cards/CLOSE_CARDS'; +const TOGGLE_CARDS = 'scratch-gui/cards/TOGGLE_CARDS'; const VIEW_CARDS = 'scratch-gui/cards/VIEW_CARDS'; const ACTIVATE_DECK = 'scratch-gui/cards/ACTIVATE_DECK'; const NEXT_STEP = 'scratch-gui/cards/NEXT_STEP'; @@ -28,6 +29,10 @@ const reducer = function (state, action) { return Object.assign({}, state, { visible: false }); + case TOGGLE_CARDS: + return Object.assign({}, state, { + visible: false + }); case VIEW_CARDS: return Object.assign({}, state, { visible: true @@ -92,6 +97,10 @@ const closeCards = function () { return {type: CLOSE_CARDS}; }; +const toggleCards = function () { + return {type: TOGGLE_CARDS}; +}; + const nextStep = function () { return {type: NEXT_STEP}; }; @@ -118,6 +127,7 @@ export { activateDeck, viewCards, closeCards, + toggleCards, nextStep, prevStep, dragCard,