diff --git a/src/components/cards/card.css b/src/components/cards/card.css
index 9589590d4..04e63a6a6 100644
--- a/src/components/cards/card.css
+++ b/src/components/cards/card.css
@@ -34,6 +34,10 @@
border-bottom-right-radius: 0.75rem;
}
+.right-card-hidden {
+ display: none;
+}
+
.left-card::after, .right-card::after {
content: "";
position: absolute;
@@ -62,6 +66,10 @@
transition: all 0.25s ease;
}
+.right-button-hidden {
+ display: none;
+}
+
.left-button:hover, .right-button:hover {
box-shadow: 0 0 0 6px $extensions-transparent;
transform: scale(1.125);
@@ -155,6 +163,10 @@
text-align: center;
}
+.step-body-hidden {
+ display: none;
+}
+
.step-video {
height: 256px;
}
diff --git a/src/components/cards/cards.jsx b/src/components/cards/cards.jsx
index dec0605f1..ae67cc8fb 100644
--- a/src/components/cards/cards.jsx
+++ b/src/components/cards/cards.jsx
@@ -14,7 +14,7 @@ import closeIcon from './icon--close.svg';
import {translateVideo} from '../../lib/libraries/decks/translate-video.js';
import {translateImage} from '../../lib/libraries/decks/translate-image.js';
-const CardHeader = ({onCloseCards, onToggleCards, onShowAll, totalSteps, step}) => (
+const CardHeader = ({onCloseCards, onToggleCards, onShowAll, totalSteps, step, toggle}) => (
- {'Shrink'}
+ {toggle ? 'Shrink' : 'Expand'}
(
+const NextPrevButtons = ({isRtl, onNextStep, onPrevStep, toggle}) => (
{onNextStep ? (
-
+
![]()
(
NextPrevButtons.propTypes = {
isRtl: PropTypes.bool,
onNextStep: PropTypes.func,
- onPrevStep: PropTypes.func
+ onPrevStep: PropTypes.func,
+ toggle: PropTypes.bool.isRequired
};
CardHeader.propTypes = {
onCloseCards: PropTypes.func.isRequired,
onShowAll: PropTypes.func.isRequired,
onToggleCards: PropTypes.func.isRequired,
step: PropTypes.number,
+ toggle: PropTypes.bool.isRequired,
totalSteps: PropTypes.number
};
@@ -236,6 +238,7 @@ const Cards = props => {
onNextStep,
onPrevStep,
step,
+ toggle,
...posProps
} = props;
let {x, y} = posProps;
@@ -266,12 +269,13 @@ const Cards = props => {
-
+
{steps[step].deckIds ? (
({
content: state.scratchGui.cards.content,
activeDeckId: state.scratchGui.cards.activeDeckId,
step: state.scratchGui.cards.step,
+ toggle: state.scratchGui.cards.toggle,
x: state.scratchGui.cards.x,
y: state.scratchGui.cards.y,
isRtl: state.locales.isRtl,
diff --git a/src/reducers/cards.js b/src/reducers/cards.js
index abd018906..ac0a0dced 100644
--- a/src/reducers/cards.js
+++ b/src/reducers/cards.js
@@ -19,6 +19,7 @@ const initialState = {
step: 0,
x: 0,
y: 0,
+ toggle: true,
dragging: false
};
@@ -31,7 +32,7 @@ const reducer = function (state, action) {
});
case TOGGLE_CARDS:
return Object.assign({}, state, {
- visible: false
+ toggle: !state.toggle // TODO: make clearer
});
case VIEW_CARDS:
return Object.assign({}, state, {
diff --git a/src/reducers/gui.js b/src/reducers/gui.js
index 071f9d93b..fa8b04317 100644
--- a/src/reducers/gui.js
+++ b/src/reducers/gui.js
@@ -107,6 +107,7 @@ const initTutorialCard = function (currentState, deckId) {
visible: true,
content: decks,
activeDeckId: deckId,
+ toggle: true,
step: 0,
x: 0,
y: 0,