File size: 530 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { COMMAND_PALETTE_CLOSE, COMMAND_PALETTE_OPEN } from 'calypso/state/action-types';
import type { AnyAction } from 'redux';

const initialState = {
	isCommandPaletteOpen: false,
};

const commandPaletteReducer = ( state = initialState, action: AnyAction ) => {
	switch ( action.type ) {
		case COMMAND_PALETTE_OPEN:
			return { ...state, isCommandPaletteOpen: true };
		case COMMAND_PALETTE_CLOSE:
			return { ...state, isCommandPaletteOpen: false };
		default:
			return state;
	}
};

export default commandPaletteReducer;