File size: 1,769 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import {
	CLOSE_PANEL,
	EDIT_COMMENT,
	NOTES_LOADED,
	NOTES_LOADING,
	SELECT_NOTE,
	SET_LAYOUT,
	UNDO_ACTION,
	VIEW_SETTINGS,
	CLOSE_SHORTCUTS_POPOVER,
	TOGGLE_SHORTCUTS_POPOVER,
	SET_FILTER,
	ENABLE_KEYBOARD_SHORTCUTS,
	DISABLE_KEYBOARD_SHORTCUTS,
	ANSWER_PROMPT,
} from '../action-types';

export const closePanel = () => ( {
	type: CLOSE_PANEL,
} );

export const loadNotes = () => ( {
	type: NOTES_LOADING,
} );

export const loadedNotes = () => ( {
	type: NOTES_LOADED,
} );

export const selectNote = ( noteId ) => ( {
	type: SELECT_NOTE,
	noteId,
} );

export const setLayout = ( layout ) => ( {
	type: SET_LAYOUT,
	layout,
} );

export const undoAction = ( noteId ) => ( {
	type: UNDO_ACTION,
	noteId,
} );

export const unselectNote = () => selectNote( null );

export const viewSettings = () => ( {
	type: VIEW_SETTINGS,
} );

export const closeShortcutsPopover = () => ( {
	type: CLOSE_SHORTCUTS_POPOVER,
} );
export const toggleShortcutsPopover = () => ( {
	type: TOGGLE_SHORTCUTS_POPOVER,
} );

export const setFilter = ( filterName ) => ( {
	type: SET_FILTER,
	filterName,
} );

export const editComment = ( siteId, postId, commentId, href ) => ( {
	type: EDIT_COMMENT,
	siteId,
	postId,
	commentId,
	href,
} );

export const answerPrompt = ( siteId, href ) => ( {
	type: ANSWER_PROMPT,
	siteId,
	href,
} );

export const enableKeyboardShortcuts = () => ( { type: ENABLE_KEYBOARD_SHORTCUTS } );

export const disableKeyboardShortcuts = () => ( { type: DISABLE_KEYBOARD_SHORTCUTS } );

export default {
	closePanel,
	loadNotes,
	loadedNotes,
	selectNote,
	setLayout,
	undoAction,
	unselectNote,
	viewSettings,
	closeShortcutsPopover,
	toggleShortcutsPopover,
	setFilter,
	editComment,
	enableKeyboardShortcuts,
	disableKeyboardShortcuts,
	answerPrompt,
};