├── .gitignore
├── Ideation report.pdf
├── LICENSE
├── README.md
├── json-server
├── db.json
└── images
│ ├── alberto.png
│ ├── buffet.png
│ ├── elaicheesecake.png
│ ├── logo.png
│ ├── uthappizza.png
│ ├── vadonut.png
│ └── zucchipakoda.png
├── package-lock.json
├── package.json
├── public
├── assets
│ └── images
│ │ ├── alberto.png
│ │ ├── buffet.png
│ │ ├── elaicheesecake.png
│ │ ├── logo.png
│ │ ├── uthappizza.png
│ │ ├── vadonut.png
│ │ └── zucchipakoda.png
├── favicon.ico
├── index.html
└── manifest.json
└── src
├── App.css
├── App.js
├── App.test.js
├── components
├── AboutComponent.js
├── ContactComponent.js
├── DishdetailComponent.js
├── FooterComponent.js
├── HeaderComponent.js
├── HomeComponent.js
├── LoadingComponent.js
├── MainComponent.js
└── MenuComponent.js
├── index.css
├── index.js
├── logo.svg
├── redux
├── ActionCreators.js
├── ActionTypes.js
├── comments.js
├── configureStore.js
├── dishes.js
├── forms.js
├── leaders.js
└── promotions.js
├── serviceWorker.js
└── shared
├── baseUrl.js
├── comments.js
├── dishes.js
├── leaders.js
└── promotions.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
63 |
64 | # dependencies
65 | /node_modules
66 | /.pnp
67 | .pnp.js
68 |
69 | # testing
70 | /coverage
71 |
72 | # production
73 | /build
74 |
75 | # misc
76 | .DS_Store
77 | .env.local
78 | .env.development.local
79 | .env.test.local
80 | .env.production.local
81 |
82 | npm-debug.log*
83 | yarn-debug.log*
84 | yarn-error.log*
85 |
--------------------------------------------------------------------------------
/Ideation report.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/Ideation report.pdf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 coursera-learn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | server start(include /images):
2 |
3 | json-server --watch db.json -s ./ -p 3001 -d 2000
4 |
5 |
6 |
7 |
8 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
9 |
10 | ## Available Scripts
11 |
12 | In the project directory, you can run:
13 |
14 | ### `npm start`
15 |
16 | Runs the app in the development mode.
17 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
18 |
19 | The page will reload if you make edits.
20 | You will also see any lint errors in the console.
21 |
22 | ### `npm test`
23 |
24 | Launches the test runner in the interactive watch mode.
25 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
26 |
27 | ### `npm run build`
28 |
29 | Builds the app for production to the `build` folder.
30 | It correctly bundles React in production mode and optimizes the build for the best performance.
31 |
32 | The build is minified and the filenames include the hashes.
33 | Your app is ready to be deployed!
34 |
35 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
36 |
37 | ### `npm run eject`
38 |
39 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
40 |
41 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
42 |
43 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
44 |
45 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
46 |
47 | ## Learn More
48 |
49 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
50 |
51 | To learn React, check out the [React documentation](https://reactjs.org/).
52 |
53 | ### Code Splitting
54 |
55 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
56 |
57 | ### Analyzing the Bundle Size
58 |
59 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
60 |
61 | ### Making a Progressive Web App
62 |
63 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
64 |
65 | ### Advanced Configuration
66 |
67 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
68 |
69 | ### Deployment
70 |
71 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
72 |
73 | ### `npm run build` fails to minify
74 |
75 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
76 |
--------------------------------------------------------------------------------
/json-server/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "dishes": [
3 | {
4 | "id": 0,
5 | "name": "Uthappizza",
6 | "image": "images/uthappizza.png",
7 | "category": "mains",
8 | "label": "Hot",
9 | "price": "4.99",
10 | "featured": true,
11 | "description": "A unique combination of Indian Uthappam (pancake) and Italian pizza, topped with Cerignola olives, ripe vine cherry tomatoes, Vidalia onion, Guntur chillies and Buffalo Paneer."
12 | },
13 | {
14 | "id": 1,
15 | "name": "Zucchipakoda",
16 | "image": "images/zucchipakoda.png",
17 | "category": "appetizer",
18 | "label": "",
19 | "price": "1.99",
20 | "featured": false,
21 | "description": "Deep fried Zucchini coated with mildly spiced Chickpea flour batter accompanied with a sweet-tangy tamarind sauce"
22 | },
23 | {
24 | "id": 2,
25 | "name": "Vadonut",
26 | "image": "images/vadonut.png",
27 | "category": "appetizer",
28 | "label": "New",
29 | "price": "1.99",
30 | "featured": false,
31 | "description": "A quintessential ConFusion experience, is it a vada or is it a donut?"
32 | },
33 | {
34 | "id": 3,
35 | "name": "ElaiCheese Cake",
36 | "image": "images/elaicheesecake.png",
37 | "category": "dessert",
38 | "label": "",
39 | "price": "2.99",
40 | "featured": false,
41 | "description": "A delectable, semi-sweet New York Style Cheese Cake, with Graham cracker crust and spiced with Indian cardamoms"
42 | }
43 | ],
44 | "comments": [
45 | {
46 | "id": 0,
47 | "dishId": 0,
48 | "rating": 5,
49 | "comment": "Imagine all the eatables, living in conFusion!",
50 | "author": "John Lemon",
51 | "date": "2012-10-16T17:57:28.556094Z"
52 | },
53 | {
54 | "id": 1,
55 | "dishId": 0,
56 | "rating": 4,
57 | "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
58 | "author": "Paul McVites",
59 | "date": "2014-09-05T17:57:28.556094Z"
60 | },
61 | {
62 | "id": 2,
63 | "dishId": 0,
64 | "rating": 3,
65 | "comment": "Eat it, just eat it!",
66 | "author": "Michael Jaikishan",
67 | "date": "2015-02-13T17:57:28.556094Z"
68 | },
69 | {
70 | "id": 3,
71 | "dishId": 0,
72 | "rating": 4,
73 | "comment": "Ultimate, Reaching for the stars!",
74 | "author": "Ringo Starry",
75 | "date": "2013-12-02T17:57:28.556094Z"
76 | },
77 | {
78 | "id": 4,
79 | "dishId": 0,
80 | "rating": 2,
81 | "comment": "It's your birthday, we're gonna party!",
82 | "author": "25 Cent",
83 | "date": "2011-12-02T17:57:28.556094Z"
84 | },
85 | {
86 | "id": 5,
87 | "dishId": 1,
88 | "rating": 5,
89 | "comment": "Imagine all the eatables, living in conFusion!",
90 | "author": "John Lemon",
91 | "date": "2012-10-16T17:57:28.556094Z"
92 | },
93 | {
94 | "id": 6,
95 | "dishId": 1,
96 | "rating": 4,
97 | "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
98 | "author": "Paul McVites",
99 | "date": "2014-09-05T17:57:28.556094Z"
100 | },
101 | {
102 | "id": 7,
103 | "dishId": 1,
104 | "rating": 3,
105 | "comment": "Eat it, just eat it!",
106 | "author": "Michael Jaikishan",
107 | "date": "2015-02-13T17:57:28.556094Z"
108 | },
109 | {
110 | "id": 8,
111 | "dishId": 1,
112 | "rating": 4,
113 | "comment": "Ultimate, Reaching for the stars!",
114 | "author": "Ringo Starry",
115 | "date": "2013-12-02T17:57:28.556094Z"
116 | },
117 | {
118 | "id": 9,
119 | "dishId": 1,
120 | "rating": 2,
121 | "comment": "It's your birthday, we're gonna party!",
122 | "author": "25 Cent",
123 | "date": "2011-12-02T17:57:28.556094Z"
124 | },
125 | {
126 | "id": 10,
127 | "dishId": 2,
128 | "rating": 5,
129 | "comment": "Imagine all the eatables, living in conFusion!",
130 | "author": "John Lemon",
131 | "date": "2012-10-16T17:57:28.556094Z"
132 | },
133 | {
134 | "id": 11,
135 | "dishId": 2,
136 | "rating": 4,
137 | "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
138 | "author": "Paul McVites",
139 | "date": "2014-09-05T17:57:28.556094Z"
140 | },
141 | {
142 | "id": 12,
143 | "dishId": 2,
144 | "rating": 3,
145 | "comment": "Eat it, just eat it!",
146 | "author": "Michael Jaikishan",
147 | "date": "2015-02-13T17:57:28.556094Z"
148 | },
149 | {
150 | "id": 13,
151 | "dishId": 2,
152 | "rating": 4,
153 | "comment": "Ultimate, Reaching for the stars!",
154 | "author": "Ringo Starry",
155 | "date": "2013-12-02T17:57:28.556094Z"
156 | },
157 | {
158 | "id": 14,
159 | "dishId": 2,
160 | "rating": 2,
161 | "comment": "It's your birthday, we're gonna party!",
162 | "author": "25 Cent",
163 | "date": "2011-12-02T17:57:28.556094Z"
164 | },
165 | {
166 | "id": 15,
167 | "dishId": 3,
168 | "rating": 5,
169 | "comment": "Imagine all the eatables, living in conFusion!",
170 | "author": "John Lemon",
171 | "date": "2012-10-16T17:57:28.556094Z"
172 | },
173 | {
174 | "id": 16,
175 | "dishId": 3,
176 | "rating": 4,
177 | "comment": "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
178 | "author": "Paul McVites",
179 | "date": "2014-09-05T17:57:28.556094Z"
180 | },
181 | {
182 | "id": 17,
183 | "dishId": 3,
184 | "rating": 3,
185 | "comment": "Eat it, just eat it!",
186 | "author": "Michael Jaikishan",
187 | "date": "2015-02-13T17:57:28.556094Z"
188 | },
189 | {
190 | "id": 18,
191 | "dishId": 3,
192 | "rating": 4,
193 | "comment": "Ultimate, Reaching for the stars!",
194 | "author": "Ringo Starry",
195 | "date": "2013-12-02T17:57:28.556094Z"
196 | },
197 | {
198 | "id": 19,
199 | "dishId": 3,
200 | "rating": 2,
201 | "comment": "It's your birthday, we're gonna party!",
202 | "author": "25 Cent",
203 | "date": "2011-12-02T17:57:28.556094Z"
204 | },
205 | {
206 | "dishId": 0,
207 | "rating": "4",
208 | "author": "bailong",
209 | "comment": "feedback",
210 | "date": "2022-03-16T05:54:54.992Z",
211 | "id": 20
212 | },
213 | {
214 | "dishId": 1,
215 | "rating": "5",
216 | "author": "123",
217 | "comment": "123123",
218 | "date": "2022-03-16T06:14:25.670Z",
219 | "id": 21
220 | },
221 | {
222 | "dishId": 1,
223 | "rating": "5",
224 | "author": "test",
225 | "comment": "test",
226 | "date": "2022-03-16T06:21:05.052Z",
227 | "id": 22
228 | }
229 | ],
230 | "promotions": [
231 | {
232 | "id": 0,
233 | "name": "Weekend Grand Buffet",
234 | "image": "images/buffet.png",
235 | "label": "New",
236 | "price": "19.99",
237 | "featured": true,
238 | "description": "Featuring mouthwatering combinations with a choice of five different salads, six enticing appetizers, six main entrees and five choicest desserts. Free flowing bubbly and soft drinks. All for just $19.99 per person "
239 | }
240 | ],
241 | "leaders": [
242 | {
243 | "id": 0,
244 | "name": "Peter Pan",
245 | "image": "images/alberto.png",
246 | "designation": "Chief Epicurious Officer",
247 | "abbr": "CEO",
248 | "featured": false,
249 | "description": "Our CEO, Peter, credits his hardworking East Asian immigrant parents who undertook the arduous journey to the shores of America with the intention of giving their children the best future. His mother's wizardy in the kitchen whipping up the tastiest dishes with whatever is available inexpensively at the supermarket, was his first inspiration to create the fusion cuisines for which The Frying Pan became well known. He brings his zeal for fusion cuisines to this restaurant, pioneering cross-cultural culinary connections."
250 | },
251 | {
252 | "id": 1,
253 | "name": "Dhanasekaran Witherspoon",
254 | "image": "images/alberto.png",
255 | "designation": "Chief Food Officer",
256 | "abbr": "CFO",
257 | "featured": false,
258 | "description": "Our CFO, Danny, as he is affectionately referred to by his colleagues, comes from a long established family tradition in farming and produce. His experiences growing up on a farm in the Australian outback gave him great appreciation for varieties of food sources. As he puts it in his own words, Everything that runs, wins, and everything that stays, pays!"
259 | },
260 | {
261 | "id": 2,
262 | "name": "Agumbe Tang",
263 | "image": "images/alberto.png",
264 | "designation": "Chief Taste Officer",
265 | "abbr": "CTO",
266 | "featured": false,
267 | "description": "Blessed with the most discerning gustatory sense, Agumbe, our CFO, personally ensures that every dish that we serve meets his exacting tastes. Our chefs dread the tongue lashing that ensues if their dish does not meet his exacting standards. He lives by his motto, You click only if you survive my lick."
268 | },
269 | {
270 | "id": 3,
271 | "name": "Alberto Somayya",
272 | "image": "images/alberto.png",
273 | "designation": "Executive Chef",
274 | "abbr": "EC",
275 | "featured": true,
276 | "description": "Award winning three-star Michelin chef with wide International experience having worked closely with whos-who in the culinary world, he specializes in creating mouthwatering Indo-Italian fusion experiences. He says, Put together the cuisines from the two craziest cultures, and you get a winning hit! Amma Mia!"
277 | }
278 | ],
279 | "feedback": [
280 | {
281 | "firstname": "fdas",
282 | "lastname": "afds",
283 | "telnum": "134113",
284 | "email": "dafdads@daffas.dfdafd",
285 | "agree": true,
286 | "contactType": "Email",
287 | "message": "afadsfds",
288 | "date": "2017-12-04T09:41:49.890Z",
289 | "id": 1
290 | },
291 | {
292 | "firstname": "123123",
293 | "lastname": "123123123",
294 | "telnum": "1231232131",
295 | "email": "qq@qq.com",
296 | "agree": true,
297 | "contactType": "Tel",
298 | "message": "123123",
299 | "date": "2022-03-16T08:59:36.514Z",
300 | "id": 2
301 | }
302 | ]
303 | }
--------------------------------------------------------------------------------
/json-server/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/alberto.png
--------------------------------------------------------------------------------
/json-server/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/buffet.png
--------------------------------------------------------------------------------
/json-server/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/elaicheesecake.png
--------------------------------------------------------------------------------
/json-server/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/logo.png
--------------------------------------------------------------------------------
/json-server/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/uthappizza.png
--------------------------------------------------------------------------------
/json-server/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/vadonut.png
--------------------------------------------------------------------------------
/json-server/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/json-server/images/zucchipakoda.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "bootstrap": "^4.0.0",
7 | "cross-fetch": "^2.1.0",
8 | "prop-types": "^15.8.1",
9 | "react": "^16.7.0",
10 | "react-animation-components": "^3.0.0",
11 | "react-dom": "^16.7.0",
12 | "react-popper": "^0.9.2",
13 | "react-redux": "^5.0.7",
14 | "react-redux-form": "^1.16.8",
15 | "react-scripts": "^2.1.5",
16 | "react-transition-group": "^4.4.2",
17 | "reactstrap": "^5.0.0",
18 | "redux": "^3.7.2"
19 | },
20 | "scripts": {
21 | "start": "react-scripts start",
22 | "build": "react-scripts build",
23 | "test": "react-scripts test",
24 | "eject": "react-scripts eject"
25 | },
26 | "eslintConfig": {
27 | "extends": "react-app"
28 | },
29 | "browserslist": [
30 | ">0.2%",
31 | "not dead",
32 | "not ie <= 11",
33 | "not op_mini all"
34 | ],
35 | "devDependencies": {
36 | "bootstrap-social": "^5.1.1",
37 | "font-awesome": "^4.7.0",
38 | "react-router-dom": "^4.2.2",
39 | "redux-logger": "^3.0.6",
40 | "redux-thunk": "^2.2.0"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/logo.png
--------------------------------------------------------------------------------
/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coursera-learn/Front-End-Web-Development-with-React/89fd9ca58d1d68cd67079884d259f9f2662daed9/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
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 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .page-enter {
2 | opacity: 0.01;
3 | transform: translateX(-100%);
4 | }
5 |
6 | .page-enter-active {
7 | opacity: 1;
8 | transform: translateX(0%);
9 | transition: all 300ms ease-in;
10 | }
11 |
12 | .page-exit {
13 | opacity: 1;
14 | transform: translateX(0%);
15 | }
16 |
17 | .page-exit-active {
18 | opacity: 0.01;
19 | transform: translateX(100%);
20 | transition: all 300ms ease-out;
21 | }
22 |
23 | .row-header{
24 | margin:0px auto;
25 | padding:0px auto;
26 | }
27 |
28 | .row-content {
29 | margin:0px auto;
30 | padding: 50px 0px 50px 0px;
31 | border-bottom: 1px ridge;
32 | min-height:400px;
33 | }
34 |
35 | .footer{
36 | background-color: #D1C4E9;
37 | margin:0px auto;
38 | padding: 20px 0px 20px 0px;
39 | }
40 | .jumbotron {
41 | padding:70px 30px 70px 30px;
42 | margin:0px auto;
43 | background: #9575CD ;
44 | color:floralwhite;
45 | }
46 |
47 | address{
48 | font-size:80%;
49 | margin:0px;
50 | color:#0f0f0f;
51 | }
52 |
53 | .navbar-dark {
54 | background-color: #512DA8;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Main from "./components/MainComponent";
3 | import { BrowserRouter } from 'react-router-dom';
4 | import './App.css';
5 |
6 | import { Provider } from 'react-redux';
7 | import { ConfigureStore } from './redux/configureStore';
8 |
9 | const store = ConfigureStore();
10 |
11 |
12 | class App extends Component {
13 |
14 | render() {
15 | return (
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | );
24 | }
25 | }
26 |
27 | export default App;
28 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render( , div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/src/components/AboutComponent.js:
--------------------------------------------------------------------------------
1 |
2 | import React from 'react';
3 | import { Breadcrumb, BreadcrumbItem, Card, CardBody, CardHeader, Media } from 'reactstrap';
4 | import { Link } from 'react-router-dom';
5 | import { baseUrl } from '../shared/baseUrl';
6 | import { Loading } from './LoadingComponent';
7 | import { FadeTransform, Fade, Stagger } from 'react-animation-components';
8 |
9 | function About(props) {
10 | console.log(props)
11 | console.log(props.leaders)
12 |
13 | function RenderLeader({leader}) {
14 | console.log(leader)
15 | return(
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | {leader.name}
25 | {leader.designation}
26 | {leader.description}
27 |
28 |
29 |
30 | );
31 | }
32 |
33 | function RenderLeaders({leaders, isLoading, errMess}) {
34 | if (isLoading) {
35 | return(
36 |
41 | );
42 | }
43 | else if (errMess) {
44 | return(
45 |
46 |
47 |
{errMess}
48 |
49 |
50 | );
51 | }
52 | else {
53 | return(
54 |
55 | {leaders.map(leader => (
56 |
57 |
58 |
59 | ))}
60 |
61 | )
62 | }
63 | }
64 | return(
65 |
66 |
67 |
68 | Home
69 | About Us
70 |
71 |
72 |
About Us
73 |
74 |
75 |
76 |
77 |
78 |
Our History
79 |
Started in 2010, Ristorante con Fusion quickly established itself as a culinary icon par excellence in Hong Kong. With its unique brand of world fusion cuisine that can be found nowhere else, it enjoys patronage from the A-list clientele in Hong Kong. Featuring four of the best three-star Michelin chefs in the world, you never know what will arrive on your plate the next time you visit us.
80 |
The restaurant traces its humble beginnings to The Frying Pan , a successful chain started by our CEO, Mr. Peter Pan, that featured for the first time the world's best cuisines in a pan.
81 |
82 |
83 |
84 | Facts At a Glance
85 |
86 |
87 | Started
88 | 3 Feb. 2013
89 | Major Stake Holder
90 | HK Fine Foods Inc.
91 | Last Year's Turnover
92 | $1,250,375
93 | Employees
94 | 40
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | You better cut the pizza in four pieces because
104 | I'm not hungry enough to eat six.
105 | Yogi Berra,
106 | The Wit and Wisdom of Yogi Berra,
107 | P. Pepe, Diversion Books, 2014
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
Corporate Leadership
117 |
118 |
119 |
120 |
125 |
126 |
127 |
128 |
129 | );
130 | }
131 |
132 | export default About;
--------------------------------------------------------------------------------
/src/components/ContactComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Breadcrumb, BreadcrumbItem, Button, Row, Col, Label } from 'reactstrap';
3 | import { Control, Form, Errors } from 'react-redux-form';
4 |
5 | const required = (val) => val && val.length;
6 | const maxLength = (len) => (val) => !(val) || (val.length <= len);
7 | const minLength = (len) => (val) => val && (val.length >= len);
8 | const isNumber = (val) => !isNaN(Number(val));
9 | const validEmail = (val) => /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(val);
10 |
11 | class Contact extends Component {
12 |
13 | constructor(props) {
14 | super(props);
15 |
16 |
17 | this.handleSubmit = this.handleSubmit.bind(this);
18 | }
19 |
20 |
21 | handleSubmit(values) {
22 |
23 | console.log('Current State is: ' + JSON.stringify(values));
24 | alert('Current State is: ' + JSON.stringify(values));
25 |
26 | this.props.postFeedback(values.firstname, values.lastname, values.telnum, values.email, values.agree, values.contactType, values.message);
27 | this.props.resetFeedBackForm();
28 | // event.preventDefault();
29 | }
30 |
31 | render() {
32 | return(
33 |
34 |
35 |
Send us your Feedback
36 |
37 |
163 |
164 | );
165 | }
166 | }
167 |
168 | export default Contact;
--------------------------------------------------------------------------------
/src/components/DishdetailComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Card, CardImg, CardText, CardBody,
3 | CardTitle, Button, Breadcrumb, BreadcrumbItem, Modal, ModalHeader, ModalBody, Form, FormGroup, Input, Label, Row, Col } from 'reactstrap';
4 | import { Link } from 'react-router-dom';
5 | import { Control, LocalForm, Errors } from 'react-redux-form';
6 | import { Loading } from './LoadingComponent';
7 | import { baseUrl } from '../shared/baseUrl';
8 | import { FadeTransform, Fade, Stagger } from 'react-animation-components';
9 |
10 | //渲染点击Card
11 | function RenderDish({dish}) {
12 | return(
13 |
14 |
18 |
19 | {/* */}
20 |
21 |
22 | {dish.name}
23 | {dish.description}
24 |
25 |
26 |
27 |
28 | )
29 | }
30 |
31 | function RenderComments({comments, postComment, dishId}){
32 | // console.log(comments)
33 | if (comments != null) {
34 |
35 |
36 |
37 | return(
38 |
39 |
Comments
40 |
41 |
42 | {
43 | comments.map((comments)=>{
44 |
45 | return(
46 |
47 |
48 |
{comments.comment}
49 |
--{comments.author},
50 | {new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'short', day: '2-digit'}).format(new Date(Date.parse(comments.date)))}
51 |
52 |
53 |
54 | )
55 | })
56 | }
57 |
58 |
59 |
60 |
61 |
62 |
63 | )
64 | }
65 | else{
66 | return(
67 |
68 | )
69 | }
70 | }
71 |
72 | const DishDetail = (props) => {
73 | if (props.isLoading) {
74 | return(
75 |
80 | );
81 | }
82 | else if (props.errMess) {
83 | return(
84 |
85 |
86 |
{props.errMess}
87 |
88 |
89 | );
90 | }
91 | else if (props.dish != null) {
92 | return(
93 |
94 |
95 |
96 |
97 | Menu
98 |
99 | {props.dish.name}
100 |
101 |
102 |
{props.dish.name}
103 |
104 |
105 |
106 |
107 |
108 |
113 |
114 |
115 | )
116 | }else{
117 | return(
118 |
119 | )
120 | }
121 |
122 | }
123 |
124 |
125 | const required = (val) => val && val.length;
126 | const maxLength = (len) => (val) => !(val) || (val.length <= len);
127 | const minLength = (len) => (val) => val && (val.length >= len);
128 |
129 |
130 | class CommentForm extends Component {
131 | constructor(props) {
132 | super(props);
133 |
134 | this.state = {
135 | isModalOpen: false
136 | };
137 | this.toggleModal = this.toggleModal.bind(this);
138 | this.handleSubmit = this.handleSubmit.bind(this);
139 | }
140 |
141 | // 弹窗按钮
142 | toggleModal() {
143 | this.setState({
144 | isModalOpen: !this.state.isModalOpen
145 | });
146 | }
147 |
148 | // 提交评论
149 | handleSubmit(values) {
150 |
151 | this.toggleModal();
152 |
153 | console.log('Current State is: ' + JSON.stringify(values));
154 | //
155 | this.props.postComment(this.props.dishId, values.rating, values.author, values.comment);
156 |
157 | }
158 |
159 | render() {
160 | return(
161 |
162 | Submit Comment
163 |
164 |
165 | Submit Comment
166 |
167 | this.handleSubmit(values)}>
168 |
169 | Rating
170 |
171 |
172 | 1
173 | 2
174 | 3
175 | 4
176 | 5
177 |
178 |
179 |
180 |
181 | Your Name
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 | Your feedback
190 |
191 |
192 |
193 |
194 |
195 |
196 | Submit
197 |
198 |
199 |
200 |
201 |
202 | )
203 | }
204 | }
205 |
206 |
207 |
208 | export default DishDetail
--------------------------------------------------------------------------------
/src/components/FooterComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Link } from 'react-router-dom';
3 |
4 | function Footer(props) {
5 | return(
6 |
7 |
8 |
9 |
10 |
Links
11 |
12 | Home
13 | About Us
14 | Menu
15 | Contact Us
16 |
17 |
18 |
19 |
Our Address
20 |
21 | 121, Clear Water Bay Road
22 | Clear Water Bay, Kowloon
23 | HONG KONG
24 | : +852 1234 5678
25 | : +852 8765 4321
26 | :
27 | confusion@food.net
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
© Copyright 2018 Ristorante Con Fusion
44 |
45 |
46 |
47 |
48 | )
49 | }
50 |
51 | export default Footer;
--------------------------------------------------------------------------------
/src/components/HeaderComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Navbar, NavbarBrand, Nav, NavbarToggler, Collapse, NavItem, Jumbotron,
3 | Button, Modal, ModalHeader, ModalBody,
4 | Form, FormGroup, Input, Label } from 'reactstrap';
5 | import { NavLink } from 'react-router-dom';
6 | import { baseUrl } from '../shared/baseUrl';
7 |
8 |
9 | class Header extends Component {
10 |
11 | constructor(props) {
12 | super(props);
13 |
14 | this.state = {
15 | isNavOpen: false,
16 | isModalOpen: false
17 | };
18 |
19 | this.toggleModal = this.toggleModal.bind(this);
20 | this.toggleNav = this.toggleNav.bind(this);
21 | this.handleLogin = this.handleLogin.bind(this);
22 |
23 | }
24 |
25 | // 移动端菜单
26 | toggleNav() {
27 | this.setState({
28 | isNavOpen: !this.state.isNavOpen
29 | });
30 | }
31 |
32 | // 弹窗按钮
33 | toggleModal() {
34 | this.setState({
35 | isModalOpen: !this.state.isModalOpen
36 | });
37 | }
38 |
39 | handleLogin(event) {
40 | this.toggleModal();
41 | alert("Username: " + this.username.value + " Password: " + this.password.value
42 | + " Remember: " + this.remember.checked);
43 | event.preventDefault();
44 |
45 | }
46 |
47 | render() {
48 | return(
49 |
50 |
51 |
52 |
53 | Login
54 |
55 |
56 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | {/*
*/}
84 |
85 |
86 |
87 |
88 | Home
89 |
90 |
91 | About Us
92 |
93 |
94 | Menu
95 |
96 |
97 | Contact Us
98 |
99 |
100 |
101 |
102 |
103 |
104 | Login
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
Ristorante con Fusion
115 |
We take inspiration from the World's best cuisines, and create a unique fusion experience. Our lipsmacking creations will tickle your culinary senses!
116 |
117 |
118 |
119 |
120 |
121 | );
122 | }
123 | }
124 |
125 | export default Header;
--------------------------------------------------------------------------------
/src/components/HomeComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card, CardImg, CardText, CardBody,
3 | CardTitle, CardSubtitle} from 'reactstrap';
4 | import { Loading } from './LoadingComponent';
5 | import { baseUrl } from '../shared/baseUrl';
6 | import { FadeTransform } from 'react-animation-components';
7 |
8 |
9 | function RenderCard({item, isLoading, errMess}) {
10 |
11 | if (isLoading) {
12 | return(
13 |
14 | );
15 | }
16 | else if (errMess) {
17 | return(
18 | {errMess}
19 | );
20 | }
21 | else
22 | return(
23 |
27 |
28 |
29 | {/* */}
30 |
31 |
32 | {item.name}
33 | {item.designation ? {item.designation} : null }
34 | {item.description}
35 |
36 |
37 |
38 | );
39 |
40 | }
41 |
42 | function Home(props) {
43 | return(
44 |
45 |
46 |
47 |
52 |
53 |
54 |
55 |
60 |
61 |
62 |
66 |
67 |
68 |
69 | );
70 | }
71 |
72 | export default Home;
--------------------------------------------------------------------------------
/src/components/LoadingComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const Loading = () => {
4 | return(
5 |
6 |
7 |
Loading . . .
8 |
9 | );
10 | };
--------------------------------------------------------------------------------
/src/components/MainComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Navbar, NavbarBrand } from 'reactstrap';
3 | import Home from './HomeComponent';
4 | import Header from './HeaderComponent';
5 | import Footer from './FooterComponent';
6 | import Menu from './MenuComponent';
7 | import DishDetail from './DishdetailComponent';
8 | import Contact from './ContactComponent';
9 | import About from './AboutComponent'
10 |
11 | import { Switch, Route, Redirect, withRouter } from 'react-router-dom'
12 | import { connect } from 'react-redux';
13 | import { postComment, fetchDishes, fetchComments, fetchPromos, fetchLeaders,postFeedback } from '../redux/ActionCreators';
14 | import { actions } from "react-redux-form";
15 | import { TransitionGroup, CSSTransition } from 'react-transition-group';
16 |
17 |
18 |
19 |
20 | const mapStateToProps = state => {
21 | return {
22 | dishes: state.dishes,
23 | comments: state.comments,
24 | promotions: state.promotions,
25 | leaders: state.leaders
26 | }
27 | }
28 | const mapDispatchToProps = dispatch => ({
29 | fetchDishes: () => {dispatch(fetchDishes())},
30 | resetFeedBackForm: () => {dispatch(actions.reset('feedback'))},
31 | fetchComments: () => dispatch(fetchComments()),
32 | fetchPromos: () => dispatch(fetchPromos()),
33 | fetchLeaders: () => dispatch(fetchLeaders()),
34 |
35 | postComment: (dishId, rating, author, comment) => dispatch(postComment(dishId, rating, author, comment)),
36 | postFeedback: (firstname, lastname, telnum, email, agree, contactType, message) => dispatch(postFeedback(firstname, lastname, telnum, email, agree, contactType, message)),
37 |
38 | });
39 |
40 |
41 |
42 | class Main extends Component {
43 |
44 | componentDidMount(){
45 | // 请求数据
46 | this.props.fetchDishes();
47 | this.props.fetchComments();
48 | this.props.fetchPromos();
49 | this.props.fetchLeaders();
50 | }
51 |
52 | render() {
53 |
54 | // Home
55 | const HomePage = () => {
56 | console.log(this.props.leaders)
57 | return(
58 | dish.featured)[0]}
60 | dishesLoading={this.props.dishes.isLoading}
61 | dishesErrMess={this.props.dishes.errMess}
62 |
63 | promotion={this.props.promotions.promotions.filter((promo) => promo.featured)[0]}
64 | promoLoading={this.props.promotions.isLoading}
65 | promoErrMess={this.props.promotions.errMess}
66 |
67 | leader={this.props.leaders.leaders.filter((leader) => leader.featured)[0]}
68 | leaderLoading={this.props.leaders.isLoading}
69 | leaderErrMess={this.props.leaders.errMess}
70 | />
71 | );
72 | }
73 | // AboutUs
74 | const AboutPage = () => {
75 | return(
76 |
81 | );
82 | }
83 | // Contact
84 | const ContactPage = () => {
85 | return(
86 |
90 | );
91 | }
92 |
93 | const DishWithId = ({match}) => {
94 | return(
95 | dish.id === parseInt(match.params.dishId,10))[0]}
97 | isLoading={this.props.dishes.isLoading}
98 | errMess={this.props.dishes.errMess}
99 | comments={this.props.comments.comments.filter((comment) => comment.dishId === parseInt(match.params.dishId,10))}
100 | commentsErrMess={this.props.comments.errMess}
101 | postComment={this.props.postComment}
102 | />
103 | );
104 | }
105 |
106 | return (
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | } />
116 |
117 | } />
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | );
126 | }
127 | }
128 |
129 | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Main));
--------------------------------------------------------------------------------
/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay,
3 | CardTitle, Breadcrumb, BreadcrumbItem } from 'reactstrap';
4 | import { Link } from 'react-router-dom';
5 | import { Loading } from './LoadingComponent';
6 | import { baseUrl } from '../shared/baseUrl';
7 |
8 | function RednerMenuItem({dish, onClick}) {
9 | return(
10 |
11 |
12 |
13 |
14 | {dish.name}
15 |
16 |
17 |
18 | );
19 | }
20 |
21 | const Menu = (props) => {
22 |
23 | const menu = props.dishes.dishes.map((dish) =>{
24 |
25 | return(
26 |
27 |
28 |
29 | )
30 | });
31 |
32 | if (props.dishes.isLoading) {
33 | return(
34 |
39 | );
40 | }
41 | else if (props.dishes.errMess) {
42 | return(
43 |
44 |
45 |
46 |
{props.dishes.errMess}
47 |
48 |
49 |
50 | );
51 | }
52 | else
53 | return(
54 |
55 |
56 |
57 | Home
58 | Menu
59 |
60 |
61 |
Menu
62 |
63 |
64 |
65 |
66 | {menu}
67 |
68 |
69 | );
70 | }
71 |
72 | export default Menu;
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
6 | sans-serif;
7 | -webkit-font-smoothing: antialiased;
8 | -moz-osx-font-smoothing: grayscale;
9 | }
10 |
11 | code {
12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
13 | monospace;
14 | }
15 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import 'bootstrap/dist/css/bootstrap.min.css';
4 |
5 | import 'font-awesome/css/font-awesome.css';
6 | import 'bootstrap-social/bootstrap-social.css';
7 |
8 | import './index.css';
9 | import App from './App';
10 | import * as serviceWorker from './serviceWorker';
11 |
12 | ReactDOM.render( , document.getElementById('root'));
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: http://bit.ly/CRA-PWA
17 | serviceWorker.unregister();
18 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/redux/ActionCreators.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 | import { baseUrl } from '../shared/baseUrl';
3 |
4 | export const postComment = (dishId, rating, author, comment) => (dispatch) => {
5 |
6 | const newComment = {
7 | dishId: dishId,
8 | rating: rating,
9 | author: author,
10 | comment: comment
11 | };
12 | newComment.date = new Date().toISOString();
13 |
14 | return fetch(baseUrl + 'comments', {
15 | method: "POST",
16 | body: JSON.stringify(newComment),
17 | headers: {
18 | "Content-Type": "application/json"
19 | },
20 | credentials: "same-origin"
21 | })
22 | .then(response => {
23 | if (response.ok) {
24 | console.log(response);
25 | return response;
26 | } else {
27 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
28 | error.response = response;
29 | throw error;
30 | }
31 | },
32 | error => {
33 | throw error;
34 | })
35 | .then(response => response.json())
36 | .then(response => dispatch(addComment(response)))
37 | .catch(error => { console.log('post comments', error.message); alert('Your comment could not be posted\nError: '+error.message); });
38 | };
39 |
40 | // 菜谱相关
41 | export const fetchDishes = () => (dispatch) => {
42 | dispatch(dishesLoading(true));
43 |
44 | // setTimeout(() => {
45 | // dispatch(addDishes(DISHES));
46 | // }, 2000);
47 | return fetch(baseUrl + 'dishes')
48 | .then(response => {
49 | if(response.ok) {
50 | return response;
51 | }else{
52 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
53 | error.response = response;
54 | throw error;
55 | }
56 | },
57 | error => {
58 | var errmess = new Error(error.message);
59 | throw errmess;
60 | })
61 | .then(response => response.json())
62 | .then(dishes => dispatch(addDishes(dishes)))
63 | .catch(error => dispatch(dishesFailed(error.message)));
64 | }
65 |
66 | export const dishesLoading = () => ({
67 | type: ActionTypes.DISHES_LOADING
68 | });
69 |
70 | export const dishesFailed = (errmess) => ({
71 | type: ActionTypes.DISHES_FAILED,
72 | payload: errmess
73 | });
74 |
75 | export const addDishes = (dishes) => ({
76 | type: ActionTypes.ADD_DISHES,
77 | payload: dishes
78 | });
79 |
80 |
81 | // 评论
82 | export const fetchComments = () => (dispatch) => {
83 | return fetch(baseUrl + 'comments')
84 | .then(response => {
85 | if(response.ok) {
86 | return response;
87 | }else{
88 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
89 | error.response = response;
90 | throw error;
91 | }
92 | },
93 | error => {
94 | var errmess = new Error(error.message);
95 | throw errmess;
96 | })
97 | .then(response => response.json())
98 | .then(comments => dispatch(addComments(comments)))
99 | .catch(error => dispatch(commentsFailed(error.message)));
100 | };
101 |
102 | export const commentsFailed = (errmess) => ({
103 | type: ActionTypes.COMMENTS_FAILED,
104 | payload: errmess
105 | });
106 |
107 | export const addComment = (comment) => ({
108 | type: ActionTypes.ADD_COMMENT,
109 | payload: comment
110 | });
111 |
112 | export const addComments = (comments) => ({
113 | type: ActionTypes.ADD_COMMENTS,
114 | payload: comments
115 | });
116 |
117 |
118 |
119 | // Promos
120 | export const fetchPromos = () => (dispatch) => {
121 |
122 | dispatch(promosLoading());
123 |
124 | return fetch(baseUrl + 'promotions')
125 | .then(response => {
126 | if(response.ok) {
127 | return response;
128 | }else{
129 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
130 | error.response = response;
131 | throw error;
132 | }
133 | },
134 | error => {
135 | var errmess = new Error(error.message);
136 | throw errmess;
137 | })
138 | .then(response => response.json())
139 | .then(promos => dispatch(addPromos(promos)))
140 | .catch(error => dispatch(promosFailed(error.message)));
141 |
142 | }
143 | export const promosLoading = () => ({
144 | type: ActionTypes.PROMOS_LOADING
145 | });
146 | export const promosFailed = (errmess) => ({
147 | type: ActionTypes.PROMOS_FAILED,
148 | payload: errmess
149 | });
150 | export const addPromos = (promos) => ({
151 | type: ActionTypes.ADD_PROMOS,
152 | payload: promos
153 | });
154 |
155 | // leaders
156 | export const fetchLeaders = () => (dispatch) => {
157 | dispatch(leadersLoading(true));
158 |
159 | return fetch(baseUrl + 'leaders')
160 | .then(response => {
161 | if(response.ok) {
162 | return response;
163 | }else{
164 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
165 | error.response = response;
166 | throw error;
167 | }
168 | },
169 | error => {
170 | var errmess = new Error(error.message);
171 | throw errmess;
172 | })
173 | .then(response => response.json())
174 | .then(leaders => dispatch(addLeaders(leaders)))
175 | .catch(error => dispatch(leadersFailed(error.message)));
176 | }
177 | export const addLeaders = (leaders) => ({
178 | type: ActionTypes.ADD_LEADERS,
179 | payload: leaders
180 | });
181 | export const leadersLoading = () => ({
182 | type: ActionTypes.LEADERS_LOADING
183 | });
184 | export const leadersFailed = (errmess) => ({
185 | type: ActionTypes.LEADERS_FAILED,
186 | payload: errmess
187 | });
188 |
189 | export const postFeedback = (firstname, lastname, telnum, email, agree, contactType, message) => (dispatch) => {
190 | const newFeedback = {
191 | firstname: firstname,
192 | lastname: lastname,
193 | telnum: telnum,
194 | email: email,
195 | agree: agree,
196 | contactType: contactType,
197 | message: message
198 | };
199 | newFeedback.date = new Date().toISOString();
200 | return fetch(baseUrl + 'feedback', {
201 | method: "POST",
202 | body: JSON.stringify(newFeedback),
203 | headers: {
204 | "Content-Type": "application/json"
205 | },
206 | credentials: "same-origin"
207 | })
208 | .then(response => {
209 | if (response.ok) {
210 | console.log(response);
211 | return response;
212 | } else {
213 | var error = new Error('Error ' + response.status + ': ' + response.statusText);
214 | error.response = response;
215 | throw error;
216 | }
217 | },
218 | error => {
219 | throw error;
220 | })
221 | .then(response => response.json())
222 | .then(response => alert(JSON.stringify(response)))
223 | .catch(error => { console.log('post feedback', error.message); alert('Your feedback could not be posted\nError: '+error.message); });
224 | };
225 |
--------------------------------------------------------------------------------
/src/redux/ActionTypes.js:
--------------------------------------------------------------------------------
1 | export const ADD_COMMENT = 'ADD_COMMENT';
2 |
3 | export const DISHES_LOADING = 'DISHES_LOADING';
4 | export const DISHES_FAILED = 'DISHES_FAILED';
5 | export const ADD_DISHES = 'ADD_DISHES';
6 |
7 | export const ADD_COMMENTS = 'ADD_COMMENTS';
8 | export const COMMENTS_FAILED = 'COMMENTS_FAILED';
9 | export const PROMOS_LOADING = 'PROMOS_LOADING';
10 | export const ADD_PROMOS = 'ADD_PROMOS';
11 | export const PROMOS_FAILED = 'PROMOS_FAILED';
12 |
13 | export const LEADERS_LOADING = 'LEADERS_LOADING';
14 | export const LEADERS_FAILED = 'LEADERS_FAILED';
15 | export const ADD_LEADERS = 'ADD_LEADERS';
16 |
--------------------------------------------------------------------------------
/src/redux/comments.js:
--------------------------------------------------------------------------------
1 | // import { COMMENTS } from '../shared/comments';
2 | import * as ActionTypes from './ActionTypes';
3 |
4 | export const Comments = (state = {errMess: null, comments:[]}, action) => {
5 | switch (action.type) {
6 | // case ActionTypes.ADD_COMMENT:
7 | // var comment = action.payload;
8 | // comment.id = state.length;
9 | // comment.date = new Date().toISOString();
10 | // console.log("Comment: ", comment);
11 | // return state.concat(comment);
12 | case ActionTypes.ADD_COMMENTS:
13 | return {...state, errMess: null, comments: action.payload};
14 | case ActionTypes.COMMENTS_FAILED:
15 | return {...state, errMess: action.payload};
16 |
17 | // eslint-disable-next-line no-duplicate-case
18 | case ActionTypes.ADD_COMMENT:
19 | var comment = action.payload;
20 | // comment.id = state.comments.length;
21 | // comment.date = new Date().toISOString();
22 | return { ...state, comments: state.comments.concat(comment)};
23 |
24 | default:
25 | return state;
26 | }
27 | };
--------------------------------------------------------------------------------
/src/redux/configureStore.js:
--------------------------------------------------------------------------------
1 | import {createStore, combineReducers, applyMiddleware} from 'redux';
2 |
3 | import { Dishes } from './dishes';
4 | import { Comments } from './comments';
5 | import { Promotions } from './promotions';
6 | import { Leaders } from './leaders';
7 |
8 | import thunk from 'redux-thunk';
9 | import logger from 'redux-logger';
10 |
11 | import { createForms } from 'react-redux-form'
12 | import { InitialFeedback } from "./forms";
13 |
14 | export const ConfigureStore = () => {
15 | const store = createStore(
16 | // 把一个由多个不同 reducer 函数作为 value 的 object,合并成一个最终的 reducer 函数,然后就可以对这个 reducer 调用 createStore。
17 | combineReducers({
18 | dishes: Dishes,
19 | comments: Comments,
20 | promotions: Promotions,
21 | leaders: Leaders,
22 |
23 | ...createForms({
24 | feedback:InitialFeedback
25 | })
26 | }),
27 | // 添加 thunk和logger 中间件
28 | applyMiddleware(thunk, logger)
29 | );
30 |
31 | return store;
32 | }
--------------------------------------------------------------------------------
/src/redux/dishes.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 |
3 | export const Dishes = (state = { isLoading: true,
4 | errMess: null,
5 | dishes:[]}, action) => {
6 | switch (action.type) {
7 | case ActionTypes.ADD_DISHES:
8 | return {...state, isLoading: false, errMess: null, dishes: action.payload};
9 |
10 | case ActionTypes.DISHES_LOADING:
11 | return {...state, isLoading: true, errMess: null, dishes: []}
12 |
13 | case ActionTypes.DISHES_FAILED:
14 | return {...state, isLoading: false, errMess: action.payload};
15 |
16 | default:
17 | return state;
18 | }
19 | };
--------------------------------------------------------------------------------
/src/redux/forms.js:
--------------------------------------------------------------------------------
1 | export const InitialFeedback = {
2 | firstname: '',
3 | lastname: '',
4 | telnum: '',
5 | email: '',
6 | agree: false,
7 | contactType: 'Tel.',
8 | message: ''
9 | };
--------------------------------------------------------------------------------
/src/redux/leaders.js:
--------------------------------------------------------------------------------
1 | // import { LEADERS } from '../shared/leaders';
2 | import * as ActionTypes from './ActionTypes';
3 |
4 | export const Leaders = (state = {isLoading: true,
5 | errMess: null,
6 | leaders: []}, action) => {
7 | switch (action.type) {
8 | case ActionTypes.ADD_LEADERS:
9 | return { ...state, isLoading: false, errMess: null, leaders: action.payload };
10 | case ActionTypes.LEADERS_LOADING:
11 | return { ...state, isLoading: true, errMess: null, leaders: [] }
12 | case ActionTypes.LEADERS_FAILED:
13 | return { ...state, isLoading: false, errMess: action.payload, leaders: [] }
14 | default:
15 | return state;
16 | }
17 | };
--------------------------------------------------------------------------------
/src/redux/promotions.js:
--------------------------------------------------------------------------------
1 | // import { PROMOTIONS } from '../shared/promotions';
2 |
3 | // export const Promotions = (state = PROMOTIONS, action) => {
4 | // switch (action.type) {
5 | // default:
6 | // return state;
7 | // }
8 | // };
9 |
10 | import * as ActionTypes from './ActionTypes';
11 |
12 | export const Promotions = (state = { isLoading: true,
13 | errMess: null,
14 | promotions:[]}, action) => {
15 | switch (action.type) {
16 | case ActionTypes.ADD_PROMOS:
17 | return {...state, isLoading: false, errMess: null, promotions: action.payload};
18 |
19 | case ActionTypes.PROMOS_LOADING:
20 | return {...state, isLoading: true, errMess: null, promotions: []}
21 |
22 | case ActionTypes.PROMOS_FAILED:
23 | return {...state, isLoading: false, errMess: action.payload};
24 |
25 | default:
26 | return state;
27 | }
28 | };
--------------------------------------------------------------------------------
/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read http://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.1/8 is considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit http://bit.ly/CRA-PWA'
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.');
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl)
104 | .then(response => {
105 | // Ensure service worker exists, and that we really are getting a JS file.
106 | const contentType = response.headers.get('content-type');
107 | if (
108 | response.status === 404 ||
109 | (contentType != null && contentType.indexOf('javascript') === -1)
110 | ) {
111 | // No service worker found. Probably a different app. Reload the page.
112 | navigator.serviceWorker.ready.then(registration => {
113 | registration.unregister().then(() => {
114 | window.location.reload();
115 | });
116 | });
117 | } else {
118 | // Service worker found. Proceed as normal.
119 | registerValidSW(swUrl, config);
120 | }
121 | })
122 | .catch(() => {
123 | console.log(
124 | 'No internet connection found. App is running in offline mode.'
125 | );
126 | });
127 | }
128 |
129 | export function unregister() {
130 | if ('serviceWorker' in navigator) {
131 | navigator.serviceWorker.ready.then(registration => {
132 | registration.unregister();
133 | });
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/src/shared/baseUrl.js:
--------------------------------------------------------------------------------
1 | export const baseUrl = 'http://localhost:3001/';
--------------------------------------------------------------------------------
/src/shared/comments.js:
--------------------------------------------------------------------------------
1 |
2 | export const COMMENTS =
3 | [
4 | {
5 | id: 0,
6 | dishId: 0,
7 | rating: 5,
8 | comment: "Imagine all the eatables, living in conFusion!",
9 | author: "John Lemon",
10 | date: "2012-10-16T17:57:28.556094Z"
11 | },
12 | {
13 | id: 1,
14 | dishId: 0,
15 | rating: 4,
16 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
17 | author: "Paul McVites",
18 | date: "2014-09-05T17:57:28.556094Z"
19 | },
20 | {
21 | id: 2,
22 | dishId: 0,
23 | rating: 3,
24 | comment: "Eat it, just eat it!",
25 | author: "Michael Jaikishan",
26 | date: "2015-02-13T17:57:28.556094Z"
27 | },
28 | {
29 | id: 3,
30 | dishId: 0,
31 | rating: 4,
32 | comment: "Ultimate, Reaching for the stars!",
33 | author: "Ringo Starry",
34 | date: "2013-12-02T17:57:28.556094Z"
35 | },
36 | {
37 | id: 4,
38 | dishId: 0,
39 | rating: 2,
40 | comment: "It's your birthday, we're gonna party!",
41 | author: "25 Cent",
42 | date: "2011-12-02T17:57:28.556094Z"
43 | },
44 | {
45 | id: 5,
46 | dishId: 1,
47 | rating: 5,
48 | comment: "Imagine all the eatables, living in conFusion!",
49 | author: "John Lemon",
50 | date: "2012-10-16T17:57:28.556094Z"
51 | },
52 | {
53 | id: 6,
54 | dishId: 1,
55 | rating: 4,
56 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
57 | author: "Paul McVites",
58 | date: "2014-09-05T17:57:28.556094Z"
59 | },
60 | {
61 | id: 7,
62 | dishId: 1,
63 | rating: 3,
64 | comment: "Eat it, just eat it!",
65 | author: "Michael Jaikishan",
66 | date: "2015-02-13T17:57:28.556094Z"
67 | },
68 | {
69 | id: 8,
70 | dishId: 1,
71 | rating: 4,
72 | comment: "Ultimate, Reaching for the stars!",
73 | author: "Ringo Starry",
74 | date: "2013-12-02T17:57:28.556094Z"
75 | },
76 | {
77 | id: 9,
78 | dishId: 1,
79 | rating: 2,
80 | comment: "It's your birthday, we're gonna party!",
81 | author: "25 Cent",
82 | date: "2011-12-02T17:57:28.556094Z"
83 | },
84 | {
85 | id: 10,
86 | dishId: 2,
87 | rating: 5,
88 | comment: "Imagine all the eatables, living in conFusion!",
89 | author: "John Lemon",
90 | date: "2012-10-16T17:57:28.556094Z"
91 | },
92 | {
93 | id: 11,
94 | dishId: 2,
95 | rating: 4,
96 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
97 | author: "Paul McVites",
98 | date: "2014-09-05T17:57:28.556094Z"
99 | },
100 | {
101 | id: 12,
102 | dishId: 2,
103 | rating: 3,
104 | comment: "Eat it, just eat it!",
105 | author: "Michael Jaikishan",
106 | date: "2015-02-13T17:57:28.556094Z"
107 | },
108 | {
109 | id: 13,
110 | dishId: 2,
111 | rating: 4,
112 | comment: "Ultimate, Reaching for the stars!",
113 | author: "Ringo Starry",
114 | date: "2013-12-02T17:57:28.556094Z"
115 | },
116 | {
117 | id: 14,
118 | dishId: 2,
119 | rating: 2,
120 | comment: "It's your birthday, we're gonna party!",
121 | author: "25 Cent",
122 | date: "2011-12-02T17:57:28.556094Z"
123 | },
124 | {
125 | id: 15,
126 | dishId: 3,
127 | rating: 5,
128 | comment: "Imagine all the eatables, living in conFusion!",
129 | author: "John Lemon",
130 | date: "2012-10-16T17:57:28.556094Z"
131 | },
132 | {
133 | id: 16,
134 | dishId: 3,
135 | rating: 4,
136 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
137 | author: "Paul McVites",
138 | date: "2014-09-05T17:57:28.556094Z"
139 | },
140 | {
141 | id: 17,
142 | dishId: 3,
143 | rating: 3,
144 | comment: "Eat it, just eat it!",
145 | author: "Michael Jaikishan",
146 | date: "2015-02-13T17:57:28.556094Z"
147 | },
148 | {
149 | id: 18,
150 | dishId: 3,
151 | rating: 4,
152 | comment: "Ultimate, Reaching for the stars!",
153 | author: "Ringo Starry",
154 | date: "2013-12-02T17:57:28.556094Z"
155 | },
156 | {
157 | id: 19,
158 | dishId: 3,
159 | rating: 2,
160 | comment: "It's your birthday, we're gonna party!",
161 | author: "25 Cent",
162 | date: "2011-12-02T17:57:28.556094Z"
163 | }
164 | ]
--------------------------------------------------------------------------------
/src/shared/dishes.js:
--------------------------------------------------------------------------------
1 | export const DISHES =
2 | [
3 | {
4 | id: 0,
5 | name:'Uthappizza',
6 | image: '/assets/images/uthappizza.png',
7 | category: 'mains',
8 | label:'Hot',
9 | price:'4.99',
10 | featured: true,
11 | description:'A unique combination of Indian Uthappam (pancake) and Italian pizza, topped with Cerignola olives, ripe vine cherry tomatoes, Vidalia onion, Guntur chillies and Buffalo Paneer.'
12 | },
13 | {
14 | id: 1,
15 | name:'Zucchipakoda',
16 | image: '/assets/images/zucchipakoda.png',
17 | category: 'appetizer',
18 | label:'',
19 | price:'1.99',
20 | featured: false,
21 | description:'Deep fried Zucchini coated with mildly spiced Chickpea flour batter accompanied with a sweet-tangy tamarind sauce'
22 | },
23 | {
24 | id: 2,
25 | name:'Vadonut',
26 | image: '/assets/images/vadonut.png',
27 | category: 'appetizer',
28 | label:'New',
29 | price:'1.99',
30 | featured: false,
31 | description:'A quintessential ConFusion experience, is it a vada or is it a donut?'
32 | },
33 | {
34 | id: 3,
35 | name:'ElaiCheese Cake',
36 | image: '/assets/images/elaicheesecake.png',
37 | category: 'dessert',
38 | label:'',
39 | price:'2.99',
40 | featured: false,
41 | description:'A delectable, semi-sweet New York Style Cheese Cake, with Graham cracker crust and spiced with Indian cardamoms'
42 | }
43 | ];
--------------------------------------------------------------------------------
/src/shared/leaders.js:
--------------------------------------------------------------------------------
1 | export const LEADERS = [
2 | {
3 | id: 0,
4 | name: 'Peter Pan',
5 | image: '/assets/images/alberto.png',
6 | designation: 'Chief Epicurious Officer',
7 | abbr: 'CEO',
8 | featured: false,
9 | description: "Our CEO, Peter, credits his hardworking East Asian immigrant parents who undertook the arduous journey to the shores of America with the intention of giving their children the best future. His mother's wizardy in the kitchen whipping up the tastiest dishes with whatever is available inexpensively at the supermarket, was his first inspiration to create the fusion cuisines for which The Frying Pan became well known. He brings his zeal for fusion cuisines to this restaurant, pioneering cross-cultural culinary connections."
10 | },
11 | {
12 | id: 1,
13 | name: 'Dhanasekaran Witherspoon',
14 | image: '/assets/images/alberto.png',
15 | designation: 'Chief Food Officer',
16 | abbr: 'CFO',
17 | featured: false,
18 | description: 'Our CFO, Danny, as he is affectionately referred to by his colleagues, comes from a long established family tradition in farming and produce. His experiences growing up on a farm in the Australian outback gave him great appreciation for varieties of food sources. As he puts it in his own words, Everything that runs, wins, and everything that stays, pays!'
19 | },
20 | {
21 | id: 2,
22 | name: 'Agumbe Tang',
23 | image: '/assets/images/alberto.png',
24 | designation: 'Chief Taste Officer',
25 | abbr: 'CTO',
26 | featured: false,
27 | description: 'Blessed with the most discerning gustatory sense, Agumbe, our CFO, personally ensures that every dish that we serve meets his exacting tastes. Our chefs dread the tongue lashing that ensues if their dish does not meet his exacting standards. He lives by his motto, You click only if you survive my lick.'
28 | },
29 | {
30 | id: 3,
31 | name: 'Alberto Somayya',
32 | image: '/assets/images/alberto.png',
33 | designation: 'Executive Chef',
34 | abbr: 'EC',
35 | featured: true,
36 | description: 'Award winning three-star Michelin chef with wide International experience having worked closely with whos-who in the culinary world, he specializes in creating mouthwatering Indo-Italian fusion experiences. He says, Put together the cuisines from the two craziest cultures, and you get a winning hit! Amma Mia!'
37 | }
38 | ];
--------------------------------------------------------------------------------
/src/shared/promotions.js:
--------------------------------------------------------------------------------
1 | export const PROMOTIONS = [
2 | {
3 | id: 0,
4 | name: 'Weekend Grand Buffet',
5 | image: '/assets/images/buffet.png',
6 | label: 'New',
7 | price: '19.99',
8 | featured: true,
9 | description: 'Featuring mouthwatering combinations with a choice of five different salads, six enticing appetizers, six main entrees and five choicest desserts. Free flowing bubbly and soft drinks. All for just $19.99 per person'
10 | }
11 | ];
--------------------------------------------------------------------------------