generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the checkbox and update dateLastPurchased
- Loading branch information
1 parent
d119459
commit 67d9c01
Showing
4 changed files
with
45 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import './ListItem.css'; | ||
import { updateItem } from '../api'; | ||
|
||
export function ListItem({ name }) { | ||
return <li className="ListItem">{name}</li>; | ||
export function ListItem({ name, listPath, id }) { | ||
//console.log(listPath) | ||
const handleOnChange = async () => { | ||
await updateItem(listPath, id); | ||
}; | ||
|
||
return ( | ||
<li className="ListItem"> | ||
<input type="checkbox" id={id} onChange={handleOnChange} /> | ||
<label htmlFor={`${id}`}>{name}</label> | ||
</li> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters