Added "Create new" buttons to the header. Closes #49
Note that this is temp solution UI-wise since it won't scale.
This commit is contained in:
@ -10,14 +10,18 @@ export function run(commandName, payload) {
|
||||
return { type: RUN_COMMAND, command: commandName, payload };
|
||||
}
|
||||
|
||||
export function createNewEntryInCollection(collectionName) {
|
||||
return runCommand(CREATE_COLLECTION, { collectionName });
|
||||
}
|
||||
|
||||
export function runCommand(commandName, payload) {
|
||||
return (dispatch, getState) => {
|
||||
return dispatch => {
|
||||
switch (commandName) {
|
||||
case SHOW_COLLECTION:
|
||||
history.push(`/collections/${payload.collectionName}`);
|
||||
break;
|
||||
case CREATE_COLLECTION:
|
||||
window.alert(`Create a new ${payload.collectionName} - not supported yet`);
|
||||
history.push(`/collections/${payload.collectionName}/entries/new`);
|
||||
break;
|
||||
case HELP:
|
||||
window.alert('Find Bar Help (PLACEHOLDER)\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.');
|
||||
|
Reference in New Issue
Block a user