diff --git a/recipes-app/.vscode/settings.json b/recipes-app/.vscode/settings.json new file mode 100644 index 0000000..414e82d --- /dev/null +++ b/recipes-app/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "prettier.tabWidth": 2 +} \ No newline at end of file diff --git a/recipes-app/public/favicon.ico b/recipes-app/public/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/recipes-app/public/favicon.ico and /dev/null differ diff --git a/recipes-app/public/logo192.png b/recipes-app/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/recipes-app/public/logo192.png and /dev/null differ diff --git a/recipes-app/public/logo512.png b/recipes-app/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/recipes-app/public/logo512.png and /dev/null differ diff --git a/recipes-app/public/manifest.json b/recipes-app/public/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/recipes-app/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/recipes-app/public/robots.txt b/recipes-app/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/recipes-app/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/recipes-app/src/App.css b/recipes-app/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/recipes-app/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/recipes-app/src/App.js b/recipes-app/src/App.js deleted file mode 100644 index 3784575..0000000 --- a/recipes-app/src/App.js +++ /dev/null @@ -1,25 +0,0 @@ -import logo from './logo.svg'; -import './App.css'; - -function App() { - return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
- ); -} - -export default App; diff --git a/recipes-app/src/App.test.js b/recipes-app/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/recipes-app/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/recipes-app/src/components/Ingredients.jsx b/recipes-app/src/components/Ingredients.jsx new file mode 100644 index 0000000..870f9b6 --- /dev/null +++ b/recipes-app/src/components/Ingredients.jsx @@ -0,0 +1,9 @@ +import Rreact from "react"; + +export default function Ingredient({ amount, measurement, name }) { + return ( +
  • + {amount} {measurement} {name} +
  • + ); +} diff --git a/recipes-app/src/components/IngredientsList.jsx b/recipes-app/src/components/IngredientsList.jsx new file mode 100644 index 0000000..f5542f9 --- /dev/null +++ b/recipes-app/src/components/IngredientsList.jsx @@ -0,0 +1,12 @@ +import React from "react"; +import Ingredient from "./Ingredients"; + +export default function IngredientsList({ list }) { + return ( + + ); +} \ No newline at end of file diff --git a/recipes-app/src/components/Instructions.jsx b/recipes-app/src/components/Instructions.jsx new file mode 100644 index 0000000..be888b0 --- /dev/null +++ b/recipes-app/src/components/Instructions.jsx @@ -0,0 +1,12 @@ +import React from "react"; + +export default function Instructions({ title, steps }) { + return ( +
    +

    {title}

    + {steps.map((s, i) => ( +

    {s}

    + ))} +
    + ); +} \ No newline at end of file diff --git a/recipes-app/src/components/Menu.jsx b/recipes-app/src/components/Menu.jsx new file mode 100644 index 0000000..482efe5 --- /dev/null +++ b/recipes-app/src/components/Menu.jsx @@ -0,0 +1,17 @@ +import React from "react"; +import Recipe from "./Recipe"; + +export default function Menu({ recipes }) { + return ( +
    +
    +

    Delicious Recipes

    +
    +
    + {recipes.map((recipe, i) => ( + + ))} +
    +
    + ); +} diff --git a/recipes-app/src/components/Recipe.jsx b/recipes-app/src/components/Recipe.jsx new file mode 100644 index 0000000..1035b4c --- /dev/null +++ b/recipes-app/src/components/Recipe.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import Instructions from "./Instructions"; +import IngredientsList from "./IngredientsList"; + +export default function Recipe({ name, ingredients, steps }) { + return ( +
    +

    {name}

    + + +
    + ); +} diff --git a/recipes-app/src/data/recipes.json b/recipes-app/src/data/recipes.json new file mode 100644 index 0000000..2715185 --- /dev/null +++ b/recipes-app/src/data/recipes.json @@ -0,0 +1,36 @@ +[ + { + "name": "Baked Salmon", + "ingredients": [ + { "name": "Salmon", "amount": 1, "measurement": "lb" }, + { "name": "Pine Nuts", "amount": 1, "measurement": "cup" }, + { "name": "Butter Lettuce", "amount": 2, "measurement": "cups" }, + { "name": "Yellow Squash", "amount": 1, "measurement": "med" }, + { "name": "Olive Oil", "amount": 0.5, "measurement": "cup" }, + { "name": "Garlic", "amount": 3, "measurement": "cloves" } + ], + "steps": [ + "Preheat the oven to 350 degrees.", + "Spread the olive oil around a glass baking dish.", + "Add the yellow squash and place in the oven for 30 mins.", + "Add the salmon, garlic, and pine nuts to the dish.", + "Bake for 15 minutes.", + "Remove from oven. Add the lettuce and serve." + ] + }, + { + "name": "Fish Tacos", + "ingredients": [ + { "name": "Whitefish", "amount": 1, "measurement": "lb" }, + { "name": "Cheese", "amount": 1, "measurement": "cup" }, + { "name": "Iceberg Lettuce", "amount": 2, "measurement": "cups" }, + { "name": "Tomatoes", "amount": 2, "measurement": "large" }, + { "name": "Tortillas", "amount": 3, "measurement": "med" } + ], + "steps": [ + "Cook the fish on the grill until cooked through.", + "Place the fish on the 3 tortillas.", + "Top them with lettuce, tomatoes, and cheese." + ] + } +] diff --git a/recipes-app/src/index.css b/recipes-app/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/recipes-app/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/recipes-app/src/index.js b/recipes-app/src/index.js index ef2edf8..8c7250a 100644 --- a/recipes-app/src/index.js +++ b/recipes-app/src/index.js @@ -1,17 +1,6 @@ import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import { render } from "react-dom"; +import Menu from "./components/Menu"; +import data from "./data/recipes.json" -ReactDOM.render( - - - , - document.getElementById('root') -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); +render(, document.getElementById("root")); \ No newline at end of file diff --git a/recipes-app/src/logo.svg b/recipes-app/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/recipes-app/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/recipes-app/src/reportWebVitals.js b/recipes-app/src/reportWebVitals.js deleted file mode 100644 index 5253d3a..0000000 --- a/recipes-app/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/recipes-app/src/setupTests.js b/recipes-app/src/setupTests.js deleted file mode 100644 index 8f2609b..0000000 --- a/recipes-app/src/setupTests.js +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom';