Skip to content

Commit 2191ddd

Browse files
authored
Merge pull request #1420 from jwang1919/fix-instructions-bar-maximize-bug
#1398 Unhide instructions component on START_EDITING_INSTRUCTIONS state.
2 parents 7c0bf57 + 7026d59 commit 2191ddd

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/actions/ui.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export const closeTopBarMenu = createAction(
6161

6262
export const startEditingInstructions = createAction(
6363
'START_EDITING_INSTRUCTIONS',
64+
projectKey => ({projectKey}),
65+
(_projectKey, timestamp = Date.now()) => ({timestamp}),
6466
);
6567

6668
export const cancelEditingInstructions = createAction(

src/components/TopBar/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export default function TopBar({
107107
onExportGist={onExportGist}
108108
onExportRepo={onExportRepo}
109109
onExportToClassroom={onExportToClassroom}
110-
onStartEditingInstructions={onStartEditingInstructions}
110+
onStartEditingInstructions={
111+
partial(onStartEditingInstructions, currentProjectKey)}
111112
/>
112113
</header>
113114
);

src/containers/TopBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function mapDispatchToProps(dispatch) {
9595
dispatch(logOut());
9696
},
9797

98-
onStartEditingInstructions() {
99-
dispatch(startEditingInstructions());
98+
onStartEditingInstructions(projectKey) {
99+
dispatch(startEditingInstructions(projectKey));
100100
},
101101

102102
onStartLogIn() {

src/reducers/projects.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ export default function reduceProjects(stateIn, action) {
201201
action.meta.timestamp,
202202
);
203203

204+
case 'START_EDITING_INSTRUCTIONS':
205+
return unhideComponent(
206+
state,
207+
action.payload.projectKey,
208+
'instructions',
209+
action.meta.timestamp,
210+
);
211+
204212
default:
205213
return state;
206214
}

0 commit comments

Comments
 (0)