diff --git a/README.md b/README.md index e25b793..f5fad5f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,13 @@ Todo/Goals application made with πŸ’œ and Redux πŸ† > Release v1.0.1. Sept' 2020 πŸ’ͺ (deploy a React app in GitHub pages) -## What is it and what can I do with it? +> Release v1.0.2 Oct' 2020 πŸ† (created and added new api that provides data persistance new feature) + +## Data persistance feature (new! πŸ₯³) +πŸš€ I have completely refactored the api, and created a new one, with support to localstorage, so now you get data persistance for free! 😎 +> πŸ‘‰ Check my home-baked api [todos-goals-localsotrage](https://www.npmjs.com/package/todos-goals-api-localstorage) in npm + +## What is it and what can I do with this app? Its name doesn't lie! This app is meant to keep your todos and goals in a cute list with which you can interact. Once running in your localhost, you can: - βž• Add a todo or a goal to an individual list @@ -16,7 +22,7 @@ Once running in your localhost, you can: AplicaciΓ³n Todo

-> As this app is open source and has a Affero AGPL license, you can fork it, change it, style it πŸ’…, etc +> As this app is open source and has a AGPL license, you can fork it, change it, style it πŸ’…, etc ## How to use it? ### ⚑️ Live @@ -47,6 +53,7 @@ Once running in your localhost, you can: ## Dependencies - Redux - Font-awesome +- πŸ‘‰ [todos-goals-api-localstorage](https://www.npmjs.com/package/todos-goals-api-localstorage) ### Dev-dependencies - gh-pages diff --git a/package-lock.json b/package-lock.json index 3af1b6a..3903300 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6101,11 +6101,6 @@ } } }, - "goals-todos-api": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/goals-todos-api/-/goals-todos-api-1.0.0.tgz", - "integrity": "sha512-mrKMYU7VCtz4a6K1Ba1CKxuNuyrnw0OyiMOgORm2p5WR1FvCA5JOOc3nBhEYgZFN2AEmnUSU/tmh0JmNJremlA==" - }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", @@ -12613,6 +12608,21 @@ "repeat-string": "^1.6.1" } }, + "todos-goals-api-localstorage": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/todos-goals-api-localstorage/-/todos-goals-api-localstorage-1.0.0.tgz", + "integrity": "sha512-hCgP9jMhclntZOUDoHNLAKCJXBlxC1846i9eQc70LTvLMVFDyehcvFPn0qiPJNd/68rpZfcDmofl4FR4zmJLpw==", + "requires": { + "uuid": "^8.3.1" + }, + "dependencies": { + "uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==" + } + } + }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", diff --git a/package.json b/package.json index 2b22bbd..a58bb30 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "@fortawesome/fontawesome-svg-core": "^1.2.31", "@fortawesome/free-solid-svg-icons": "^5.15.0", "@fortawesome/react-fontawesome": "^0.1.11", - "goals-todos-api": "^1.0.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-redux": "^7.2.0", "react-scripts": "^3.4.3", "redux": "^4.0.5", - "redux-thunk": "^2.3.0" + "redux-thunk": "^2.3.0", + "todos-goals-api-localstorage": "^1.0.0" }, "scripts": { "predeploy": "npm run build", diff --git a/src/actions/goals.js b/src/actions/goals.js index ca2b4cc..2d47491 100644 --- a/src/actions/goals.js +++ b/src/actions/goals.js @@ -1,4 +1,4 @@ -import API from 'goals-todos-api' +import API from 'todos-goals-api-localstorage' export const ADD_GOAL = 'ADD_GOAL' export const REMOVE_GOAL = 'REMOVE_GOAL' diff --git a/src/actions/shared.js b/src/actions/shared.js index 50e835f..9b401ee 100644 --- a/src/actions/shared.js +++ b/src/actions/shared.js @@ -1,4 +1,4 @@ -import API from 'goals-todos-api' +import API from 'todos-goals-api-localstorage' export const RECEIVE_DATA = 'RECEIVE_DATA' diff --git a/src/actions/todos.js b/src/actions/todos.js index fa5f398..fc42121 100644 --- a/src/actions/todos.js +++ b/src/actions/todos.js @@ -1,4 +1,4 @@ -import API from 'goals-todos-api' +import API from 'todos-goals-api-localstorage' export const ADD_TODO = 'ADD_TODO' export const REMOVE_TODO = 'REMOVE_TODO' diff --git a/src/components/List.js b/src/components/List.js index 3fb458a..026974c 100644 --- a/src/components/List.js +++ b/src/components/List.js @@ -11,7 +11,7 @@ export default function List(props){ props.toggle && props.toggle(item.id)} style={{textDecoration: - item.complete + item.completed ? 'line-through' : 'none' }} >{item.name} diff --git a/src/reducers/todos.js b/src/reducers/todos.js index e7c7c47..fa85155 100644 --- a/src/reducers/todos.js +++ b/src/reducers/todos.js @@ -14,7 +14,7 @@ export default function todos (state = [], action) { return state.filter(todo => todo.id !== action.id) case TOGGLE_TODO: return state.map(todo => todo.id !== action.id ? todo : - Object.assign({}, todo, {complete: !todo.complete}) + Object.assign({}, todo, {completed: !todo.completed}) ) case RECEIVE_DATA: return action.todos