Skip to content

Solution: Ricard Garcia & Victor Hugo Gomez #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
045a029
.eslintrc modified
labietelabiete May 19, 2021
2c01772
Commit Ricard
Ricard-Garcia May 19, 2021
f4d7ebe
Added missing dependencies (formik, yup, uuid)
Ricard-Garcia May 19, 2021
e60870e
Added notes
Ricard-Garcia May 19, 2021
42c563f
Added classnames dependency
Ricard-Garcia May 19, 2021
6b71733
Added styling folders
Ricard-Garcia May 20, 2021
0a360d1
Updated notes
Ricard-Garcia May 20, 2021
c6263c1
First cleaning code
labietelabiete May 20, 2021
9964a23
Structure done
labietelabiete May 20, 2021
b725580
labietelabiete May 20, 2021
66ae180
Added default todos
Ricard-Garcia May 20, 2021
15580ac
Updated notes
Ricard-Garcia May 20, 2021
6e769b1
Added initial styles
Ricard-Garcia May 20, 2021
ca24fc3
Added box shadow
Ricard-Garcia May 20, 2021
b2d74d1
Declared todos in App props
Ricard-Garcia May 20, 2021
6c3bf79
Form by html5
labietelabiete May 20, 2021
91e2d67
Added todo component
Ricard-Garcia May 20, 2021
1f892a9
Merge branch 'main' into develop
Ricard-Garcia May 20, 2021
8576962
Styled initially Todo comp
Ricard-Garcia May 20, 2021
81d3983
Added set state for done/not-done todos
Ricard-Garcia May 20, 2021
021a660
Removed onClick but kept onChange
Ricard-Garcia May 20, 2021
77522a3
AddTodo functionality done
labietelabiete May 20, 2021
2dd7ac3
Added set state for deleted todo
Ricard-Garcia May 20, 2021
249c26a
Input style
labietelabiete May 20, 2021
b256dca
Solved Todo component checkbox
Ricard-Garcia May 20, 2021
f0ef9e9
Merge branch 'F01-Create-Todo-Comp' into develop
Ricard-Garcia May 21, 2021
2dd4d27
Solved console.log problem
Ricard-Garcia May 21, 2021
e4f7473
Merge branch 'F02-Todo-Comp' into develop
Ricard-Garcia May 21, 2021
564a306
Unified styling
Ricard-Garcia May 21, 2021
97b3d9d
Changed Todo component to class
Ricard-Garcia May 21, 2021
0e2a6be
CreateToDo styles done
labietelabiete May 21, 2021
b0ef95e
Added forms to Todo component
Ricard-Garcia May 21, 2021
e00184b
Added disable input funcionality
Ricard-Garcia May 21, 2021
1c99b8b
Added disabled conditional class
Ricard-Garcia May 21, 2021
99aed33
Solved placeholder problem
Ricard-Garcia May 21, 2021
60ad6c9
Added new colors to disabled texts
Ricard-Garcia May 21, 2021
452ec08
Added empty todos illustration
Ricard-Garcia May 21, 2021
3e9c19d
Fixed console.log() problems
Ricard-Garcia May 21, 2021
841854a
MainFooter functionality done
labietelabiete May 21, 2021
6f6d667
Merge branch 'F02-Todo-Comp' into develop
Ricard-Garcia May 21, 2021
e07c49a
Added styling to main top part
Ricard-Garcia May 21, 2021
c209d25
Added lightMode property to App state
Ricard-Garcia May 23, 2021
80d1272
Solved checkboxes' border problem
Ricard-Garcia May 23, 2021
5c12749
Added min & max height to todo-list-section
Ricard-Garcia May 23, 2021
40f62ac
Solved initially list-wrapper scroll
Ricard-Garcia May 23, 2021
afdd86d
Added image & icon switch between mode
Ricard-Garcia May 24, 2021
828eb3e
Added dark mode swtich to Todo, TodoList & App
Ricard-Garcia May 24, 2021
56067aa
Added gradient to top background
Ricard-Garcia May 24, 2021
8b27ade
Footer styles
labietelabiete May 24, 2021
4d45efb
Merge branch 'F05-Light-Dark-Mode' into develop
Ricard-Garcia May 24, 2021
c60d1a8
Styled active class in navlinks
Ricard-Garcia May 24, 2021
6b17b5e
Solved width in small devices
Ricard-Garcia May 24, 2021
271959b
Added setLocalStorage function
Ricard-Garcia May 24, 2021
b750e31
Clear Completed done
labietelabiete May 24, 2021
f152878
Solved styling problems in main section
Ricard-Garcia May 24, 2021
fe5051e
Solved empty todo problem
Ricard-Garcia May 24, 2021
26bb2cf
Removed box shadow in dark mode
Ricard-Garcia May 24, 2021
003ed89
Added .blur() to createTodo and Todo forms
Ricard-Garcia May 24, 2021
8ab7a43
Added side paddings to MainFooter component
Ricard-Garcia May 24, 2021
00d0636
Merge branch 'F06-LocalStorage' into develop
labietelabiete May 25, 2021
4d892db
All merges done
labietelabiete May 25, 2021
5c220bc
Cleaning code
labietelabiete May 25, 2021
4a55c76
labietelabiete Oct 4, 2021
a608480
labietelabiete Oct 4, 2021
8f5b8ab
labietelabiete Oct 5, 2021
9c17f4a
Merge branch 'main' of https://github.com/labietelabiete/reactjs-todo…
labietelabiete Oct 9, 2021
90c96c2
labietelabiete Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ module.exports = {
},
],
rules: {
"prettier/prettier": "error",
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
"react/jsx-filename-extension": "off",
"import/prefer-default-export": "off",
"prefer-destructuring": "off",
Expand All @@ -59,5 +64,10 @@ module.exports = {
"no-underscore-dangle": "off",
"react/forbid-prop-types": "off",
"react/prop-types": "off",
"jsx-a11y/label-has-for": ["error", {
"required": {
"some": ["nesting", "id"]
}
}],
},
};
247 changes: 124 additions & 123 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,124 +1,125 @@

# Created by https://www.toptal.com/developers/gitignore/api/react,node
# Edit at https://www.toptal.com/developers/gitignore?templates=react,node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### react ###
.DS_*
**/*.backup.*
**/*.back.*


# Created by https://www.toptal.com/developers/gitignore/api/react,node
# Edit at https://www.toptal.com/developers/gitignore?templates=react,node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### react ###
.DS_*
**/*.backup.*
**/*.back.*

node_modules
87 changes: 87 additions & 0 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
### First meeting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muy interesante la organización! 👏🏻


## 1. Layout

Using Bootstrap as much as possible

## 2. Structure (components & pages)

### App

Defining base elements:

- Title
- Light/Dark mode
- Create todo (component)
- Todolist (component via `BrowserRouter`. Has `filter` property)

· Route 1: Home

· Route 2: Completed

· Route 3: Active

- Todo

- NavBar (component & has `NavLinks` to filter)

## 3. App.state

- todos
- isLoading
- hasError

```
this.state{
todos: [];
isLoading: false;
hasError: false;
}
```

-

### 4. Methods & properties needed

**Create todo** (component)

Using a `formik` form with `yup` validation.

- handleSubmit(): **create todo object** once submitted form. **Add a new object
to state (todos)**.

Local storage:

```
componentDidUpdate() {
const { cartItems, products } = this.state;

localStorage.setItem(
LOCAL_STORAGE_KEY,
JSON.stringify({ cartItems, products }),
);
}

```

**Todo** (component)

Wrap all todo in a `<div>` to **hover** & show crossbar.

- handleClick(): **checkbox**
- handleRemove(): **crossbar**
- handleEdit(): when user clicks on todo.

- key: use `uuid` to create id.
- done: `boolean`
- text: `string`

**Todo list** (component)

**Navbar** (component)

## TODO

## DONE

Installed `yup`& `formik`
Loading