diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..08b3923 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} diff --git a/src/components/addfoodform.jsx b/src/components/addfoodform.jsx new file mode 100644 index 0000000..204fc9c --- /dev/null +++ b/src/components/addfoodform.jsx @@ -0,0 +1,84 @@ +import React, { useState } from "react"; +import { Form, Input, Button } from "antd"; + +const AddFoodForm = ({ foods, addNewFood }) => { + const [showBtn, setShowBtn] = useState(false); + + const [form] = Form.useForm(); + + const onFinish = (newFood) => { + // Handle form submission logic here + + addNewFood([newFood, ...foods]); + form.resetFields(); + }; + + return ( +
Servings: {food.servings}
++ Total Calories: {food.calories} Kcal +
+ + + + ); +}; + +export default FoodBox; diff --git a/src/components/search.jsx b/src/components/search.jsx new file mode 100644 index 0000000..799e9bd --- /dev/null +++ b/src/components/search.jsx @@ -0,0 +1,33 @@ +import React from 'react' +import {Divider,Input} from "antd" +const Search = ({handleSearch}) => { + + function handleChange(e){ + const searchQuery= e.target.value ; + + handleSearch(searchQuery) + } + return ( + <> +