76bd1b1630
* Add ability to delete projects from sketch list - Fixes #76 - Also gets rid of outdated Sketch module * Styling for Sketch List trash can * Merge all the stuff * Fix trash can line height
16 lines
367 B
JavaScript
16 lines
367 B
JavaScript
import * as ActionTypes from '../../../constants';
|
|
|
|
const sketches = (state = [], action) => {
|
|
switch (action.type) {
|
|
case ActionTypes.SET_PROJECTS:
|
|
return action.projects;
|
|
case ActionTypes.DELETE_PROJECT:
|
|
return state.filter((sketch) =>
|
|
sketch.id !== action.id
|
|
);
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default sketches;
|