Skip to content

Commit 9b4ceed

Browse files
committed
add frontend-react for grabdish
1 parent d1cbf7b commit 9b4ceed

38 files changed

+925
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/home/mark/src/react-course/grabdish/src/index.js":"1","/home/mark/src/react-course/grabdish/src/App.js":"2","/home/mark/src/react-course/grabdish/src/components/Layout/Header.js":"3","/home/mark/src/react-course/grabdish/src/components/Layout/HeaderCartButton.js":"4","/home/mark/src/react-course/grabdish/src/components/Cart/CartIcon.js":"5","/home/mark/src/react-course/grabdish/src/components/Meals/Meals.js":"6","/home/mark/src/react-course/grabdish/src/components/Meals/MealsSummary.js":"7","/home/mark/src/react-course/grabdish/src/components/Meals/AvailableMeals.js":"8","/home/mark/src/react-course/grabdish/src/components/UI/Card.js":"9","/home/mark/src/react-course/grabdish/src/components/Meals/MealItem/MealItem.js":"10","/home/mark/src/react-course/grabdish/src/components/Meals/MealItem/MealItemForm.js":"11","/home/mark/src/react-course/grabdish/src/components/UI/Input.js":"12","/home/mark/src/react-course/grabdish/src/components/Cart/Cart.js":"13","/home/mark/src/react-course/grabdish/src/components/UI/Modal.js":"14","/home/mark/src/react-course/grabdish/src/store/CartProvider.js":"15","/home/mark/src/react-course/grabdish/src/store/cart-context.js":"16","/home/mark/src/react-course/grabdish/src/components/Cart/CartItem.js":"17"},{"size":179,"mtime":1648642748000,"results":"18","hashOfConfig":"19"},{"size":655,"mtime":1654785875033,"results":"20","hashOfConfig":"19"},{"size":607,"mtime":1654718560024,"results":"21","hashOfConfig":"19"},{"size":1170,"mtime":1654792222073,"results":"22","hashOfConfig":"19"},{"size":511,"mtime":1654714394324,"results":"23","hashOfConfig":"19"},{"size":264,"mtime":1654715554524,"results":"24","hashOfConfig":"19"},{"size":528,"mtime":1654715083704,"results":"25","hashOfConfig":"19"},{"size":1117,"mtime":1654717231294,"results":"26","hashOfConfig":"19"},{"size":153,"mtime":1654715917964,"results":"27","hashOfConfig":"19"},{"size":889,"mtime":1654788515083,"results":"28","hashOfConfig":"19"},{"size":1186,"mtime":1654788507983,"results":"29","hashOfConfig":"19"},{"size":305,"mtime":1654787822753,"results":"30","hashOfConfig":"19"},{"size":1924,"mtime":1654793523593,"results":"31","hashOfConfig":"19"},{"size":700,"mtime":1654719011264,"results":"32","hashOfConfig":"19"},{"size":2555,"mtime":1654792413903,"results":"33","hashOfConfig":"19"},{"size":190,"mtime":1654785615193,"results":"34","hashOfConfig":"19"},{"size":612,"mtime":1616590017000,"results":"35","hashOfConfig":"19"},{"filePath":"36","messages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1hpx26z",{"filePath":"38","messages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/mark/src/react-course/grabdish/src/index.js",[],"/home/mark/src/react-course/grabdish/src/App.js",[],"/home/mark/src/react-course/grabdish/src/components/Layout/Header.js",[],"/home/mark/src/react-course/grabdish/src/components/Layout/HeaderCartButton.js",[],"/home/mark/src/react-course/grabdish/src/components/Cart/CartIcon.js",[],"/home/mark/src/react-course/grabdish/src/components/Meals/Meals.js",[],"/home/mark/src/react-course/grabdish/src/components/Meals/MealsSummary.js",[],"/home/mark/src/react-course/grabdish/src/components/Meals/AvailableMeals.js",[],"/home/mark/src/react-course/grabdish/src/components/UI/Card.js",[],"/home/mark/src/react-course/grabdish/src/components/Meals/MealItem/MealItem.js",[],"/home/mark/src/react-course/grabdish/src/components/Meals/MealItem/MealItemForm.js",[],"/home/mark/src/react-course/grabdish/src/components/UI/Input.js",[],"/home/mark/src/react-course/grabdish/src/components/Cart/Cart.js",[],"/home/mark/src/react-course/grabdish/src/components/UI/Modal.js",[],"/home/mark/src/react-course/grabdish/src/store/CartProvider.js",[],"/home/mark/src/react-course/grabdish/src/store/cart-context.js",[],"/home/mark/src/react-course/grabdish/src/components/Cart/CartItem.js",[]]

grabdish/frontend-react/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
3.78 KB
Binary file not shown.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
</head>
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="overlays"></div>
32+
<div id="root"></div>
33+
<!--
34+
This HTML file is a template.
35+
If you open it directly in the browser, you will see an empty page.
36+
37+
You can add webfonts, meta tags, or analytics to this file.
38+
The build step will place the bundled scripts into the <body> tag.
39+
40+
To begin the development, run `npm start` or `yarn start`.
41+
To create a production bundle, use `npm run build` or `yarn build`.
42+
-->
43+
</body>
44+
</html>
5.22 KB
Loading
9.44 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

grabdish/frontend-react/src/App.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useState } from "react";
2+
import Header from "./components/Layout/Header";
3+
import Meals from "./components/Meals/Meals";
4+
import Cart from "./components/Cart/Cart";
5+
import CartProvider from "./store/CartProvider";
6+
7+
function App() {
8+
const [cartIsShown, setCartIsShown] = useState(false);
9+
10+
const showCartHandler = () => {
11+
setCartIsShown(true);
12+
}
13+
14+
const hideCardHandler = () => {
15+
setCartIsShown(false);
16+
}
17+
18+
return (
19+
<CartProvider>
20+
{cartIsShown && <Cart onClose={hideCardHandler} />}
21+
<Header onShowCart={showCartHandler} />
22+
<main>
23+
<Meals />
24+
</main>
25+
</CartProvider>
26+
);
27+
}
28+
29+
export default App;
407 KB
Loading

0 commit comments

Comments
 (0)