From a6234913c0b0b6281ae1d7a61d184a4c377b9507 Mon Sep 17 00:00:00 2001 From: Daniel R Date: Mon, 27 Feb 2023 16:49:52 -0800 Subject: [PATCH] First release --- src/components/AddItemForm.js | 4 ++-- src/components/Item.js | 4 ++-- src/components/ItemsList.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/AddItemForm.js b/src/components/AddItemForm.js index f6ac0d7..205f3f2 100644 --- a/src/components/AddItemForm.js +++ b/src/components/AddItemForm.js @@ -2,7 +2,7 @@ import React, {useRef} from 'react'; -const AddItemForm = ({addItem, items}) => { +const AddItemForm = ({handleAddItem, items}) => { const itemInput = useRef(); @@ -19,7 +19,7 @@ const AddItemForm = ({addItem, items}) => { }); if (!dupe && input) { - addItem(itemInput.current.value.replace(/(^|\s)[a-z]/g, f => f.toUpperCase())); + handleAddItem(itemInput.current.value.replace(/(^|\s)[a-z]/g, f => f.toUpperCase())); e.currentTarget.reset(); } diff --git a/src/components/Item.js b/src/components/Item.js index c6c9a06..94af279 100644 --- a/src/components/Item.js +++ b/src/components/Item.js @@ -1,10 +1,10 @@ import React from 'react'; -const Item = ({item, id, removeItem}) => { +const Item = ({item, id, handleRemoveItem}) => { return ( - + {item} diff --git a/src/components/ItemsList.js b/src/components/ItemsList.js index 886e456..eae79a2 100644 --- a/src/components/ItemsList.js +++ b/src/components/ItemsList.js @@ -2,20 +2,20 @@ import React from 'react'; import Item from './Item'; import AddItemForm from './AddItemForm'; -const ItemsList = ({items, addItem, gameState, removeItem}) => { +const ItemsList = ({items, handleAddItem, gameState, handleRemoveItem}) => { if (gameState === 'start') { return (
{items.map(item =>