├── README.md
└── confusion
├── .gitignore
├── README.md
├── assignment2.png
├── assignment_1
├── .gitignore
├── README.md
├── package.json
├── public
│ ├── assets
│ │ └── images
│ │ │ ├── alberto.png
│ │ │ ├── buffet.png
│ │ │ ├── elaicheesecake.png
│ │ │ ├── logo.png
│ │ │ ├── uthappizza.png
│ │ │ ├── vadonut.png
│ │ │ └── zucchipakoda.png
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── components
│ │ ├── DishdetailComponent.js
│ │ ├── MenuComponent.js
│ │ └── test.html
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── serviceWorker.js
│ ├── setupTests.js
│ └── shared
│ │ └── dishes.js
└── yarn.lock
├── assignment_2
├── .gitignore
├── README.md
├── assignment2.png
├── package.json
├── public
│ ├── assets
│ │ └── images
│ │ │ ├── alberto.png
│ │ │ ├── buffet.png
│ │ │ ├── elaicheesecake.png
│ │ │ ├── logo.png
│ │ │ ├── uthappizza.png
│ │ │ ├── vadonut.png
│ │ │ └── zucchipakoda.png
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── components
│ │ ├── AboutComponent.js
│ │ ├── ContactComponent.js
│ │ ├── DishdetailComponent.js
│ │ ├── FooterComponent.js
│ │ ├── HeaderComponent.js
│ │ ├── HomeComponent.js
│ │ ├── MainComponent.js
│ │ ├── MenuComponent.js
│ │ └── test.html
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── serviceWorker.js
│ ├── setupTests.js
│ └── shared
│ │ ├── comments.js
│ │ ├── dishes.js
│ │ ├── leaders.js
│ │ └── promotions.js
└── yarn.lock
├── assignment_3
├── .gitignore
├── package.json
├── public
│ ├── assets
│ │ └── images
│ │ │ ├── alberto.png
│ │ │ ├── buffet.png
│ │ │ ├── elaicheesecake.png
│ │ │ ├── logo.png
│ │ │ ├── uthappizza.png
│ │ │ ├── vadonut.png
│ │ │ └── zucchipakoda.png
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── components
│ │ ├── AboutComponent.js
│ │ ├── CommentFormComponent.js
│ │ ├── ContactComponent.js
│ │ ├── DishdetailComponent.js
│ │ ├── FooterComponent.js
│ │ ├── HeaderComponent.js
│ │ ├── HomeComponent.js
│ │ ├── MainComponent.js
│ │ ├── MenuComponent.js
│ │ └── test.html
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── redux
│ │ ├── configureStore.js
│ │ └── reducer.js
│ ├── serviceWorker.js
│ ├── setupTests.js
│ └── shared
│ │ ├── comments.js
│ │ ├── dishes.js
│ │ ├── leaders.js
│ │ └── promotions.js
└── yarn.lock
├── assignment_4
├── .gitignore
├── README.md
├── assignment2.png
├── db.json
├── package.json
├── public
│ ├── assets
│ │ └── images
│ │ │ ├── alberto.png
│ │ │ ├── buffet.png
│ │ │ ├── elaicheesecake.png
│ │ │ ├── logo.png
│ │ │ ├── uthappizza.png
│ │ │ ├── vadonut.png
│ │ │ └── zucchipakoda.png
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── components
│ │ ├── AboutComponent.js
│ │ ├── CommentFormComponent.js
│ │ ├── ContactComponent.js
│ │ ├── DishdetailComponent.js
│ │ ├── FooterComponent.js
│ │ ├── HeaderComponent.js
│ │ ├── HomeComponent.js
│ │ ├── LoadingComponent.js
│ │ ├── MainComponent.js
│ │ ├── MenuComponent.js
│ │ └── test.html
│ ├── 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
│ ├── setupTests.js
│ └── shared
│ │ ├── baseUrl.js
│ │ ├── comments.js
│ │ ├── dishes.js
│ │ ├── leaders.js
│ │ └── promotions.js
└── yarn.lock
├── db.json
├── package.json
├── public
├── assets
│ └── images
│ │ ├── alberto.png
│ │ ├── buffet.png
│ │ ├── elaicheesecake.png
│ │ ├── logo.png
│ │ ├── uthappizza.png
│ │ ├── vadonut.png
│ │ └── zucchipakoda.png
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── App.css
├── App.js
├── App.test.js
├── components
│ ├── AboutComponent.js
│ ├── CommentFormComponent.js
│ ├── ContactComponent.js
│ ├── DishdetailComponent.js
│ ├── FooterComponent.js
│ ├── HeaderComponent.js
│ ├── HomeComponent.js
│ ├── LoadingComponent.js
│ ├── MainComponent.js
│ ├── MenuComponent.js
│ └── test.html
├── 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
├── setupTests.js
└── shared
│ ├── baseUrl.js
│ ├── comments.js
│ ├── dishes.js
│ ├── leaders.js
│ └── promotions.js
└── yarn.lock
/README.md:
--------------------------------------------------------------------------------
1 | # Front-End-Web-Development-with-React
2 |
3 | Assigment and lectures code of this course in Coursera.
4 |
5 | ## [Visit the Course](https://www.coursera.org/learn/front-end-react)
6 |
7 | ## Don't copy and paste. Use your brain. Believe me you are the best.
8 | ## Please respect the [Coursera Honor Code](https://learner.coursera.help/hc/en-us/articles/209818863)
9 |
--------------------------------------------------------------------------------
/confusion/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/confusion/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `yarn start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `yarn test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `yarn build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `yarn eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | 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.
35 |
36 | 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.
37 |
38 | 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.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `yarn build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/confusion/assignment2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment2.png
--------------------------------------------------------------------------------
/confusion/assignment_1/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/confusion/assignment_1/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `yarn start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `yarn test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `yarn build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `yarn eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | 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.
35 |
36 | 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.
37 |
38 | 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.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `yarn build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/confusion/assignment_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^4.2.4",
7 | "@testing-library/react": "^9.3.2",
8 | "@testing-library/user-event": "^7.1.2",
9 | "bootstrap": "4.0.0",
10 | "react": "^16.13.1",
11 | "react-dom": "^16.13.1",
12 | "react-popper": "0.9.2",
13 | "react-scripts": "3.4.1",
14 | "reactstrap": "5.0.0"
15 | },
16 | "scripts": {
17 | "start": "react-scripts start",
18 | "build": "react-scripts build",
19 | "test": "react-scripts test",
20 | "eject": "react-scripts eject"
21 | },
22 | "eslintConfig": {
23 | "extends": "react-app"
24 | },
25 | "browserslist": {
26 | "production": [
27 | ">0.2%",
28 | "not dead",
29 | "not op_mini all"
30 | ],
31 | "development": [
32 | "last 1 chrome version",
33 | "last 1 firefox version",
34 | "last 1 safari version"
35 | ]
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/logo.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/favicon.ico
--------------------------------------------------------------------------------
/confusion/assignment_1/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/confusion/assignment_1/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/logo192.png
--------------------------------------------------------------------------------
/confusion/assignment_1/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/public/logo512.png
--------------------------------------------------------------------------------
/confusion/assignment_1/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 | "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 | }
26 |
--------------------------------------------------------------------------------
/confusion/assignment_1/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_1/src/App.css
--------------------------------------------------------------------------------
/confusion/assignment_1/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | // import logo from './logo.svg';
3 | import { Navbar, NavbarBrand } from "reactstrap";
4 |
5 | import Menu from './components/MenuComponent';
6 |
7 | import './App.css';
8 | import { DISHES } from './shared/dishes'
9 |
10 | class App extends Component{
11 |
12 | constructor(props){
13 | super(props);
14 |
15 | this.state = {
16 | dishes: DISHES
17 | };
18 |
19 | }
20 |
21 | render(){
22 |
23 | return(
24 |
25 |
26 |
27 | Ristorante Con Fusion
28 |
29 |
30 |
31 |
32 |
33 | );
34 |
35 | }
36 |
37 | }
38 |
39 | export default App;
40 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/components/DishdetailComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { Card, CardImg, CardImgOverlay, CardText, CardBody, CardTitle } from "reactstrap";
3 |
4 | class DishDetail extends Component{
5 | constructor(props) {
6 | super(props);
7 |
8 | console.log(props);
9 |
10 | // stores iproperties of this component
11 | this.state = {
12 | selectedDishDetail: this.props.dsdetail
13 | };
14 |
15 |
16 | }
17 |
18 | renderDish(dish) {
19 |
20 | if (dish != null) {
21 | return (
22 |
23 |
24 |
25 |
26 | {dish.name}
27 | {dish.description}
28 |
29 |
30 |
31 | );
32 | }
33 | else {
34 | return (
35 |
36 | );
37 | }
38 | }
39 |
40 | renderComments(comments){
41 | if (comments == null) {
42 | return (
)
43 | }
44 | const cmnts = comments.map(comment => {
45 | return (
46 |
47 | {comment.comment}
48 | -- {comment.author},
49 |
50 | {new Intl.DateTimeFormat('en-US', {
51 | year: 'numeric',
52 | month: 'long',
53 | day: '2-digit'
54 | }).format(new Date(comment.date))}
55 |
56 |
57 | )
58 | })
59 | return (
60 |
61 |
Comments
62 |
65 |
66 |
67 | )
68 | }
69 |
70 |
71 | render(){
72 | const dish = this.props.dish
73 |
74 | console.log(dish);
75 |
76 | if (dish == null) {
77 | return (
);
78 | }
79 |
80 | const dishItem = this.renderDish(dish);
81 | const dishComment = this.renderComments(dish.comments);
82 |
83 | return (
84 |
85 | {dishItem}
86 | {dishComment}
87 |
88 | )
89 | }
90 |
91 | }
92 |
93 | export default DishDetail;
--------------------------------------------------------------------------------
/confusion/assignment_1/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { Card, CardImg, CardImgOverlay, CardText, CardBody, CardTitle } from "reactstrap";
3 | import DishDetail from './DishdetailComponent';
4 |
5 | class Menu extends Component{
6 |
7 | constructor(props){
8 | super(props);
9 |
10 | // stores iproperties of this component
11 | this.state = {
12 | selectedDish: null
13 | };
14 |
15 | console.log('Menu component constructed');
16 |
17 | }
18 |
19 | onDishSelect(dish){
20 |
21 | this.setState({
22 | selectedDish: dish
23 | });
24 |
25 | }
26 |
27 |
28 |
29 | render(){
30 | console.log('renders menu component');
31 |
32 | const menu = this.props.dishes.map((dish) => {
33 | return (
34 |
35 | this.onDishSelect( dish ) } >
36 |
37 |
38 |
39 | { dish.name }
40 |
41 |
42 |
43 | );
44 | });
45 |
46 | return(
47 |
48 |
49 | { menu }
50 |
51 |
52 |
53 |
54 |
55 |
56 | );
57 | }
58 |
59 | componentDidMount(){
60 | console.log('Menu component componentDidMounbt is invoked');
61 |
62 | }
63 | }
64 |
65 | export default Menu;
--------------------------------------------------------------------------------
/confusion/assignment_1/src/components/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Title
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | This is a Heading
19 | This is a paragraph.
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 | 001 - Środki trwałe x
31 | 001-001 - Środek trwały 1
32 | 001-002 - Środek trwały 2
33 | 002 - Kasa
34 | 04-33 - test
35 | 05 - dff
36 |
37 |
38 |
39 |
40 |
45 |
46 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import 'bootstrap/dist/css/bootstrap.min.css';
4 | import './index.css';
5 | import App from './App';
6 | import * as serviceWorker from './serviceWorker';
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
15 | // If you want your app to work offline and load faster, you can change
16 | // unregister() to register() below. Note this comes with some pitfalls.
17 | // Learn more about service workers: https://bit.ly/CRA-PWA
18 | // serviceWorker.unregister();
19 | serviceWorker.register();
20 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/confusion/assignment_1/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/confusion/assignment_2/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/confusion/assignment_2/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `yarn start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `yarn test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `yarn build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `yarn eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | 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.
35 |
36 | 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.
37 |
38 | 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.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `yarn build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/confusion/assignment_2/assignment2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/assignment2.png
--------------------------------------------------------------------------------
/confusion/assignment_2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^4.2.4",
7 | "@testing-library/react": "^9.3.2",
8 | "@testing-library/user-event": "^7.1.2",
9 | "bootstrap": "4.0.0",
10 | "bootstrap-social": "5.1.1",
11 | "font-awesome": "4.7.0",
12 | "react": "^16.13.1",
13 | "react-dom": "^16.13.1",
14 | "react-popper": "0.9.2",
15 | "react-router-dom": "4.2.2",
16 | "react-scripts": "3.4.1",
17 | "reactstrap": "5.0.0"
18 | },
19 | "scripts": {
20 | "start": "react-scripts start",
21 | "build": "react-scripts build",
22 | "test": "react-scripts test",
23 | "eject": "react-scripts eject"
24 | },
25 | "eslintConfig": {
26 | "extends": "react-app"
27 | },
28 | "browserslist": {
29 | "production": [
30 | ">0.2%",
31 | "not dead",
32 | "not op_mini all"
33 | ],
34 | "development": [
35 | "last 1 chrome version",
36 | "last 1 firefox version",
37 | "last 1 safari version"
38 | ]
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/logo.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/favicon.ico
--------------------------------------------------------------------------------
/confusion/assignment_2/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/confusion/assignment_2/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/logo192.png
--------------------------------------------------------------------------------
/confusion/assignment_2/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_2/public/logo512.png
--------------------------------------------------------------------------------
/confusion/assignment_2/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 | "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 | }
26 |
--------------------------------------------------------------------------------
/confusion/assignment_2/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/App.css:
--------------------------------------------------------------------------------
1 | .row-header{
2 | margin:0px auto;
3 | padding:0px auto;
4 | }
5 |
6 | .row-content {
7 | margin:0px auto;
8 | padding: 50px 0px 50px 0px;
9 | border-bottom: 1px ridge;
10 | min-height:400px;
11 | }
12 |
13 | .footer{
14 | background-color: #D1C4E9;
15 | margin:0px auto;
16 | padding: 20px 0px 20px 0px;
17 | }
18 | .jumbotron {
19 | padding:70px 30px 70px 30px;
20 | margin:0px auto;
21 | background: #9575CD ;
22 | color:floralwhite;
23 | }
24 |
25 | address{
26 | font-size:80%;
27 | margin:0px;
28 | color:#0f0f0f;
29 | }
30 |
31 | .navbar-dark {
32 | background-color: #512DA8;
33 | }
--------------------------------------------------------------------------------
/confusion/assignment_2/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Main from './components/MainComponent';
4 |
5 | import './App.css';
6 |
7 | import { BrowserRouter } from 'react-router-dom';
8 |
9 |
10 |
11 | class App extends Component{
12 |
13 |
14 | render(){
15 |
16 | return(
17 |
18 |
19 |
20 |
21 |
22 | );
23 |
24 | }
25 |
26 | }
27 |
28 | export default App;
29 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/AboutComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Breadcrumb, BreadcrumbItem, Card, CardBody, CardHeader, Media } from 'reactstrap';
3 | import { Link } from 'react-router-dom';
4 |
5 | function RenderLeader({ leader }) {
6 | return(
7 |
8 |
9 |
10 |
11 |
12 |
13 | {leader.name}
14 | {leader.description}
15 |
16 |
17 |
18 | );
19 | }
20 |
21 |
22 | function About(props) {
23 |
24 | const leaders = props.leaders.map((leader) => {
25 | return (
26 |
27 | );
28 | });
29 |
30 | return (
31 |
32 |
33 |
34 | Home
35 | About Us
36 |
37 |
38 |
About Us
39 |
40 |
41 |
42 |
43 |
44 |
Our History
45 |
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.
46 |
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.
47 |
48 |
49 |
50 | Facts At a Glance
51 |
52 |
53 | Started
54 | 3 Feb. 2013
55 | Major Stake Holder
56 | HK Fine Foods Inc.
57 | Last Year's Turnover
58 | $1,250,375
59 | Employees
60 | 40
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | You better cut the pizza in four pieces because
70 | I'm not hungry enough to eat six.
71 | Yogi Berra,
72 | The Wit and Wisdom of Yogi Berra,
73 | P. Pepe, Diversion Books, 2014
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
Corporate Leadership
85 |
86 |
87 |
88 |
89 |
90 | {leaders}
91 |
92 |
93 |
94 |
95 |
96 | );
97 | }
98 |
99 | export default About;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/ContactComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Breadcrumb, BreadcrumbItem } from 'reactstrap';
3 | import { Link } from 'react-router-dom';
4 |
5 | function Contact(props) {
6 | return (
7 |
8 |
9 |
10 |
11 | Home
12 |
13 |
14 | Contact Us
15 |
16 |
17 |
18 |
19 |
Contact Us
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Location Information
27 |
28 |
29 |
Our Address
30 |
31 | 121, Clear Water Bay Road
32 | Clear Water Bay, Kowloon
33 | HONG KONG
34 | : +852 1234 5678
35 | : +852 8765 4321
36 | : confusion@food.net
37 |
38 |
39 |
40 |
Map of our Location
41 |
42 |
49 |
50 |
51 | );
52 | }
53 |
54 | export default Contact;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/DishdetailComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay, CardTitle, Breadcrumb, BreadcrumbItem, CardBody, CardText } from "reactstrap";
3 | import { Link } from 'react-router-dom';
4 |
5 | function RenderDish({dish}) {
6 | if (dish != null) {
7 | return (
8 |
9 |
10 |
11 |
12 | {dish.name}
13 | {dish.description}
14 |
15 |
16 |
17 | );
18 | }
19 | else {
20 | return (
21 |
22 | );
23 | }
24 | }
25 |
26 | function RenderComments({comments}){
27 | if (comments == null) {
28 | return (
)
29 | }
30 | const cmnts = comments.map(comment => {
31 | return (
32 |
33 | {comment.comment}
34 | -- {comment.author},
35 |
36 | {new Intl.DateTimeFormat('en-US', {
37 | year: 'numeric',
38 | month: 'long',
39 | day: '2-digit'
40 | }).format(new Date(comment.date))}
41 |
42 |
43 | )
44 | })
45 | return (
46 |
47 |
Comments
48 |
51 |
52 |
53 | )
54 | }
55 |
56 |
57 | const DishDetail = (props) => {
58 |
59 | const dish = props.dish
60 |
61 |
62 | if (dish == null) {
63 | return (
);
64 | }
65 |
66 | return (
67 |
68 |
69 |
70 |
71 | Menu
72 |
73 |
74 | { props.dish.name }
75 |
76 |
77 |
78 |
79 |
{props.dish.menu}
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | )
90 | }
91 |
92 |
93 |
94 | export default DishDetail;
--------------------------------------------------------------------------------
/confusion/assignment_2/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 |
11 |
Links
12 |
13 | Home
14 | About
15 | Menu
16 | Contact
17 |
18 |
19 |
20 |
Our Address
21 |
22 | 121, Clear Water Bay Road
23 | Clear Water Bay, Kowloon
24 | HONG KONG
25 | : +852 1234 5678
26 | : +852 8765 4321
27 | :
28 | confusion@food.net
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
© Copyright 2018 Ristorante Con Fusion
45 |
46 |
47 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default Footer;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/HeaderComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Nav, Navbar, NavbarBrand, NavbarToggler, Collapse, NavItem, Jumbotron } from "reactstrap";
3 | import { NavLink } from 'react-router-dom';
4 |
5 | class Header extends Component{
6 |
7 | constructor(props){
8 | super(props);
9 |
10 | this.state={
11 | isNavOpen: false
12 | };
13 | this.toggleNav = this.toggleNav.bind(this);
14 | }
15 |
16 | toggleNav(){
17 | this.setState({
18 | isNavOpen: !this.state.isNavOpen
19 | });
20 | }
21 |
22 | render(){
23 | return(
24 | // react fragment
25 | // <>
26 | // >
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Home
42 |
43 |
44 |
45 |
46 |
47 | About Us
48 |
49 |
50 |
51 |
52 |
53 | Menu
54 |
55 |
56 |
57 |
58 |
59 | Contact Us
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
Ristorante Con Fusion
73 |
74 | We take inspiration from te World's best cuisines, and create a unique
75 | fusion experience. Our lipsmacking creations
76 | will ti ckle your culinary senses!
77 |
78 |
79 |
80 |
81 |
82 |
83 | );
84 | }
85 | }
86 |
87 | export default Header;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/HomeComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card, CardImg, CardText, CardBody, CardTitle, CardSubtitle} from 'reactstrap';
3 |
4 | function RenderCard({item}) {
5 | return(
6 |
7 |
8 |
9 |
10 | {item.name}
11 |
12 | {item.designation ? {item.designation} : null }
13 |
14 | {item.description}
15 |
16 |
17 |
18 | );
19 | }
20 |
21 |
22 |
23 | function Home(props) {
24 | return(
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | );
43 | }
44 |
45 | export default Home;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/MainComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Home from './HomeComponent';
4 | import Menu from './MenuComponent';
5 | import About from './AboutComponent';
6 | import Contact from './ContactComponent';
7 | import Header from './HeaderComponent';
8 | import Footer from './FooterComponent';
9 | import DishDetail from './DishdetailComponent';
10 |
11 | import { COMMENTS } from '../shared/comments'
12 | import { DISHES } from '../shared/dishes'
13 | import { LEADERS } from '../shared/leaders'
14 | import { PROMOTIONS } from '../shared/promotions'
15 |
16 | import { Switch, Route, Redirect } from 'react-router-dom';
17 |
18 |
19 | class Main extends Component {
20 |
21 | constructor(props) {
22 | super(props);
23 |
24 | this.state = {
25 | comments: COMMENTS,
26 | dishes: DISHES,
27 | leaders: LEADERS,
28 | promotions: PROMOTIONS,
29 | };
30 |
31 | }
32 |
33 | render() {
34 |
35 | const HomePage = () => {
36 | return(
37 | dish.featured )[0] }
39 | promotion={this.state.promotions.filter( (promotion)=>promotion.featured )[0] }
40 | leader={this.state.leaders.filter( (leader)=>leader.featured )[0] }
41 | />
42 | );
43 | };
44 |
45 | const AboutUsPage = () => {
46 | return(
47 |
50 | );
51 | };
52 |
53 |
54 | const DishWithId = ({match}) => {
55 | return(
56 | dish.id === parseInt(match.params.dishId, 10))[0] }
59 | comments={this.state.comments.filter( (comment) => comment.dishId === parseInt(match.params.dishId, 10)) }
60 |
61 |
62 | />
63 | );
64 | };
65 |
66 |
67 |
68 | return (
69 |
70 |
71 |
72 |
73 |
74 | }/>
75 |
76 |
77 |
78 |
79 |
80 |
81 | {/* if url dosesnt match, bydefault redirect to */}
82 |
83 |
84 |
85 |
86 |
87 | );
88 |
89 | }
90 |
91 | }
92 |
93 | export default Main;
94 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay, CardTitle, Breadcrumb, BreadcrumbItem } from "reactstrap";
3 | import {Link} from 'react-router-dom';
4 |
5 |
6 | function RenderMenuItem({ dish, onClick }) {
7 | return(
8 |
9 |
10 |
11 |
12 | {dish.name}
13 |
14 |
15 |
16 | );
17 | }
18 |
19 | const Menu = (props) => {
20 |
21 | const menu = props.dishes.map((dish) => {
22 | return (
23 |
24 |
25 |
26 | );
27 | });
28 |
29 | return(
30 |
31 |
32 |
33 |
34 | Home
35 |
36 |
37 | Menu
38 |
39 |
40 |
41 |
42 |
Menu
43 |
44 |
45 |
46 |
47 |
48 | { menu }
49 |
50 |
51 | );
52 |
53 | }
54 |
55 |
56 |
57 |
58 |
59 | export default Menu;
--------------------------------------------------------------------------------
/confusion/assignment_2/src/components/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Title
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | This is a Heading
19 | This is a paragraph.
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 | 001 - Środki trwałe x
31 | 001-001 - Środek trwały 1
32 | 001-002 - Środek trwały 2
33 | 002 - Kasa
34 | 04-33 - test
35 | 05 - dff
36 |
37 |
38 |
39 |
40 |
45 |
46 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/confusion/assignment_2/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.min.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(
13 |
14 |
15 | ,
16 | document.getElementById('root')
17 | );
18 |
19 | // If you want your app to work offline and load faster, you can change
20 | // unregister() to register() below. Note this comes with some pitfalls.
21 | // Learn more about service workers: https://bit.ly/CRA-PWA
22 | // serviceWorker.unregister();
23 | serviceWorker.register();
24 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/confusion/assignment_2/src/shared/comments.js:
--------------------------------------------------------------------------------
1 | export const COMMENTS =
2 | [
3 | {
4 | id: 0,
5 | dishId: 0,
6 | rating: 5,
7 | comment: "Imagine all the eatables, living in conFusion!",
8 | author: "John Lemon",
9 | date: "2012-10-16T17:57:28.556094Z"
10 | },
11 | {
12 | id: 1,
13 | dishId: 0,
14 | rating: 4,
15 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
16 | author: "Paul McVites",
17 | date: "2014-09-05T17:57:28.556094Z"
18 | },
19 | {
20 | id: 2,
21 | dishId: 0,
22 | rating: 3,
23 | comment: "Eat it, just eat it!",
24 | author: "Michael Jaikishan",
25 | date: "2015-02-13T17:57:28.556094Z"
26 | },
27 | {
28 | id: 3,
29 | dishId: 0,
30 | rating: 4,
31 | comment: "Ultimate, Reaching for the stars!",
32 | author: "Ringo Starry",
33 | date: "2013-12-02T17:57:28.556094Z"
34 | },
35 | {
36 | id: 4,
37 | dishId: 0,
38 | rating: 2,
39 | comment: "It's your birthday, we're gonna party!",
40 | author: "25 Cent",
41 | date: "2011-12-02T17:57:28.556094Z"
42 | },
43 | {
44 | id: 5,
45 | dishId: 1,
46 | rating: 5,
47 | comment: "Imagine all the eatables, living in conFusion!",
48 | author: "John Lemon",
49 | date: "2012-10-16T17:57:28.556094Z"
50 | },
51 | {
52 | id: 6,
53 | dishId: 1,
54 | rating: 4,
55 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
56 | author: "Paul McVites",
57 | date: "2014-09-05T17:57:28.556094Z"
58 | },
59 | {
60 | id: 7,
61 | dishId: 1,
62 | rating: 3,
63 | comment: "Eat it, just eat it!",
64 | author: "Michael Jaikishan",
65 | date: "2015-02-13T17:57:28.556094Z"
66 | },
67 | {
68 | id: 8,
69 | dishId: 1,
70 | rating: 4,
71 | comment: "Ultimate, Reaching for the stars!",
72 | author: "Ringo Starry",
73 | date: "2013-12-02T17:57:28.556094Z"
74 | },
75 | {
76 | id: 9,
77 | dishId: 1,
78 | rating: 2,
79 | comment: "It's your birthday, we're gonna party!",
80 | author: "25 Cent",
81 | date: "2011-12-02T17:57:28.556094Z"
82 | },
83 | {
84 | id: 10,
85 | dishId: 2,
86 | rating: 5,
87 | comment: "Imagine all the eatables, living in conFusion!",
88 | author: "John Lemon",
89 | date: "2012-10-16T17:57:28.556094Z"
90 | },
91 | {
92 | id: 11,
93 | dishId: 2,
94 | rating: 4,
95 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
96 | author: "Paul McVites",
97 | date: "2014-09-05T17:57:28.556094Z"
98 | },
99 | {
100 | id: 12,
101 | dishId: 2,
102 | rating: 3,
103 | comment: "Eat it, just eat it!",
104 | author: "Michael Jaikishan",
105 | date: "2015-02-13T17:57:28.556094Z"
106 | },
107 | {
108 | id: 13,
109 | dishId: 2,
110 | rating: 4,
111 | comment: "Ultimate, Reaching for the stars!",
112 | author: "Ringo Starry",
113 | date: "2013-12-02T17:57:28.556094Z"
114 | },
115 | {
116 | id: 14,
117 | dishId: 2,
118 | rating: 2,
119 | comment: "It's your birthday, we're gonna party!",
120 | author: "25 Cent",
121 | date: "2011-12-02T17:57:28.556094Z"
122 | },
123 | {
124 | id: 15,
125 | dishId: 3,
126 | rating: 5,
127 | comment: "Imagine all the eatables, living in conFusion!",
128 | author: "John Lemon",
129 | date: "2012-10-16T17:57:28.556094Z"
130 | },
131 | {
132 | id: 16,
133 | dishId: 3,
134 | rating: 4,
135 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
136 | author: "Paul McVites",
137 | date: "2014-09-05T17:57:28.556094Z"
138 | },
139 | {
140 | id: 17,
141 | dishId: 3,
142 | rating: 3,
143 | comment: "Eat it, just eat it!",
144 | author: "Michael Jaikishan",
145 | date: "2015-02-13T17:57:28.556094Z"
146 | },
147 | {
148 | id: 18,
149 | dishId: 3,
150 | rating: 4,
151 | comment: "Ultimate, Reaching for the stars!",
152 | author: "Ringo Starry",
153 | date: "2013-12-02T17:57:28.556094Z"
154 | },
155 | {
156 | id: 19,
157 | dishId: 3,
158 | rating: 2,
159 | comment: "It's your birthday, we're gonna party!",
160 | author: "25 Cent",
161 | date: "2011-12-02T17:57:28.556094Z"
162 | }
163 | ]
--------------------------------------------------------------------------------
/confusion/assignment_2/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_2/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_2/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_3/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/confusion/assignment_3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^4.2.4",
7 | "@testing-library/react": "^9.3.2",
8 | "@testing-library/user-event": "^7.1.2",
9 | "bootstrap": "4.0.0",
10 | "bootstrap-social": "5.1.1",
11 | "font-awesome": "4.7.0",
12 | "react": "^16.13.1",
13 | "react-dom": "^16.13.1",
14 | "react-popper": "0.9.2",
15 | "react-redux": "5.0.7",
16 | "react-redux-form": "1.16.8",
17 | "react-router-dom": "4.2.2",
18 | "react-scripts": "3.4.1",
19 | "reactstrap": "5.0.0",
20 | "redux": "3.7.2"
21 | },
22 | "scripts": {
23 | "start": "react-scripts start",
24 | "build": "react-scripts build",
25 | "test": "react-scripts test",
26 | "eject": "react-scripts eject"
27 | },
28 | "eslintConfig": {
29 | "extends": "react-app"
30 | },
31 | "browserslist": {
32 | "production": [
33 | ">0.2%",
34 | "not dead",
35 | "not op_mini all"
36 | ],
37 | "development": [
38 | "last 1 chrome version",
39 | "last 1 firefox version",
40 | "last 1 safari version"
41 | ]
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/logo.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/favicon.ico
--------------------------------------------------------------------------------
/confusion/assignment_3/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/confusion/assignment_3/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/logo192.png
--------------------------------------------------------------------------------
/confusion/assignment_3/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_3/public/logo512.png
--------------------------------------------------------------------------------
/confusion/assignment_3/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 | "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 | }
26 |
--------------------------------------------------------------------------------
/confusion/assignment_3/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/App.css:
--------------------------------------------------------------------------------
1 | .row-header{
2 | margin:0px auto;
3 | padding:0px auto;
4 | }
5 |
6 | .row-content {
7 | margin:0px auto;
8 | padding: 50px 0px 50px 0px;
9 | border-bottom: 1px ridge;
10 | min-height:400px;
11 | }
12 |
13 | .footer{
14 | background-color: #D1C4E9;
15 | margin:0px auto;
16 | padding: 20px 0px 20px 0px;
17 | }
18 | .jumbotron {
19 | padding:70px 30px 70px 30px;
20 | margin:0px auto;
21 | background: #9575CD ;
22 | color:floralwhite;
23 | }
24 |
25 | address{
26 | font-size:80%;
27 | margin:0px;
28 | color:#0f0f0f;
29 | }
30 |
31 | .navbar-dark {
32 | background-color: #512DA8;
33 | }
--------------------------------------------------------------------------------
/confusion/assignment_3/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Main from './components/MainComponent';
4 |
5 | import './App.css';
6 |
7 | import { BrowserRouter } from 'react-router-dom';
8 |
9 | import { Provider } from 'react-redux';
10 | import { ConfigureStore } from './redux/configureStore';
11 | const store = ConfigureStore();
12 |
13 | class App extends Component{
14 |
15 |
16 | render(){
17 |
18 | return(
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | }
29 |
30 | }
31 |
32 | export default App;
33 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/components/AboutComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Breadcrumb, BreadcrumbItem, Card, CardBody, CardHeader, Media } from 'reactstrap';
3 | import { Link } from 'react-router-dom';
4 |
5 | function RenderLeader({ leader }) {
6 | return(
7 |
8 |
9 |
10 |
11 |
12 |
13 | {leader.name}
14 | {leader.description}
15 |
16 |
17 |
18 | );
19 | }
20 |
21 |
22 | function About(props) {
23 |
24 | const leaders = props.leaders.map((leader) => {
25 | return (
26 |
27 | );
28 | });
29 |
30 | return (
31 |
32 |
33 |
34 | Home
35 | About Us
36 |
37 |
38 |
About Us
39 |
40 |
41 |
42 |
43 |
44 |
Our History
45 |
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.
46 |
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.
47 |
48 |
49 |
50 | Facts At a Glance
51 |
52 |
53 | Started
54 | 3 Feb. 2013
55 | Major Stake Holder
56 | HK Fine Foods Inc.
57 | Last Year's Turnover
58 | $1,250,375
59 | Employees
60 | 40
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | You better cut the pizza in four pieces because
70 | I'm not hungry enough to eat six.
71 | Yogi Berra,
72 | The Wit and Wisdom of Yogi Berra,
73 | P. Pepe, Diversion Books, 2014
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
Corporate Leadership
85 |
86 |
87 |
88 |
89 |
90 | {leaders}
91 |
92 |
93 |
94 |
95 |
96 | );
97 | }
98 |
99 | export default About;
--------------------------------------------------------------------------------
/confusion/assignment_3/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 |
11 |
Links
12 |
13 | Home
14 | About
15 | Menu
16 | Contact
17 |
18 |
19 |
20 |
Our Address
21 |
22 | 121, Clear Water Bay Road
23 | Clear Water Bay, Kowloon
24 | HONG KONG
25 | : +852 1234 5678
26 | : +852 8765 4321
27 | :
28 | confusion@food.net
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
© Copyright 2018 Ristorante Con Fusion
45 |
46 |
47 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default Footer;
--------------------------------------------------------------------------------
/confusion/assignment_3/src/components/HomeComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Card, CardImg, CardText, CardBody, CardTitle, CardSubtitle} from 'reactstrap';
3 |
4 | function RenderCard({item}) {
5 | return(
6 |
7 |
8 |
9 |
10 | {item.name}
11 |
12 | {item.designation ? {item.designation} : null }
13 |
14 | {item.description}
15 |
16 |
17 |
18 | );
19 | }
20 |
21 |
22 |
23 | function Home(props) {
24 | return(
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | );
43 | }
44 |
45 | export default Home;
--------------------------------------------------------------------------------
/confusion/assignment_3/src/components/MainComponent.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Home from './HomeComponent';
4 | import Menu from './MenuComponent';
5 | import About from './AboutComponent';
6 | import Contact from './ContactComponent';
7 | import Header from './HeaderComponent';
8 | import Footer from './FooterComponent';
9 | import DishDetail from './DishdetailComponent';
10 |
11 | import { Switch, Route, Redirect, withRouter } from 'react-router-dom';
12 | import {connect} from 'react-redux';
13 |
14 |
15 | const mapStateToProps = state => {
16 |
17 | return{
18 | comments: state.comments,
19 | dishes: state.dishes,
20 | leaders: state.leaders,
21 | promotions: state.promotions,
22 | }
23 | }
24 |
25 |
26 | class Main extends Component {
27 |
28 | constructor(props) {
29 | super(props);
30 | }
31 |
32 | render() {
33 |
34 | const HomePage = () => {
35 | return(
36 | dish.featured )[0] }
38 | promotion={this.props.promotions.filter( (promotion)=>promotion.featured )[0] }
39 | leader={this.props.leaders.filter( (leader)=>leader.featured )[0] }
40 | />
41 | );
42 | };
43 |
44 | const AboutUsPage = () => {
45 | return(
46 |
49 | );
50 | };
51 |
52 |
53 | const DishWithId = ({match}) => {
54 | return(
55 | dish.id === parseInt(match.params.dishId, 10))[0] }
58 | comments={this.props.comments.filter( (comment) => comment.dishId === parseInt(match.params.dishId, 10)) }
59 |
60 |
61 | />
62 | );
63 | };
64 |
65 |
66 |
67 | return (
68 |
69 |
70 |
71 |
72 |
73 | }/>
74 |
75 |
76 |
77 |
78 |
79 |
80 | {/* if url dosesnt match, bydefault redirect to */}
81 |
82 |
83 |
84 |
85 |
86 | );
87 |
88 | }
89 |
90 | }
91 |
92 | export default withRouter(connect(mapStateToProps)(Main));
93 |
94 |
95 | /**
96 | *
97 | * - connect(): generates a wrapper container component that
98 | * subscribe to the store.
99 | */
--------------------------------------------------------------------------------
/confusion/assignment_3/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay, CardTitle, Breadcrumb, BreadcrumbItem } from "reactstrap";
3 | import {Link} from 'react-router-dom';
4 |
5 |
6 | function RenderMenuItem({ dish, onClick }) {
7 | return(
8 |
9 |
10 |
11 |
12 | {dish.name}
13 |
14 |
15 |
16 | );
17 | }
18 |
19 | const Menu = (props) => {
20 |
21 | const menu = props.dishes.map((dish) => {
22 | return (
23 |
24 |
25 |
26 | );
27 | });
28 |
29 | return(
30 |
31 |
32 |
33 |
34 | Home
35 |
36 |
37 | Menu
38 |
39 |
40 |
41 |
42 |
Menu
43 |
44 |
45 |
46 |
47 |
48 | { menu }
49 |
50 |
51 | );
52 |
53 | }
54 |
55 |
56 |
57 |
58 |
59 | export default Menu;
--------------------------------------------------------------------------------
/confusion/assignment_3/src/components/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Title
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | This is a Heading
19 | This is a paragraph.
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 | 001 - Środki trwałe x
31 | 001-001 - Środek trwały 1
32 | 001-002 - Środek trwały 2
33 | 002 - Kasa
34 | 04-33 - test
35 | 05 - dff
36 |
37 |
38 |
39 |
40 |
45 |
46 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/confusion/assignment_3/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.min.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(
13 |
14 |
15 | ,
16 | document.getElementById('root')
17 | );
18 |
19 | // If you want your app to work offline and load faster, you can change
20 | // unregister() to register() below. Note this comes with some pitfalls.
21 | // Learn more about service workers: https://bit.ly/CRA-PWA
22 | // serviceWorker.unregister();
23 | serviceWorker.register();
24 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/redux/configureStore.js:
--------------------------------------------------------------------------------
1 | /** REDUX
2 | *
3 | * # Holds the current state
4 | *
5 | * # Created using createStore()
6 | *
7 | * # Supplies three methods:
8 | * - dispatch(): states state update with the provided action object
9 | *
10 | * Dispatch method is where you will supply the
11 | * action object and then specify what
12 | * changes you want to make to the state.
13 | *
14 | * - getState(): returns the current stored state value
15 | * - subscribe(): accept a callback function that will be run every time
16 | * an action is dispatched
17 | *
18 | */
19 |
20 |
21 | import { createStore } from 'redux';
22 | import { Reducer, initialState } from './reducer';
23 |
24 | // creating store
25 | export const ConfigureStore = () => {
26 | const store = createStore(
27 | Reducer,
28 | initialState
29 | );
30 |
31 | return store;
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/redux/reducer.js:
--------------------------------------------------------------------------------
1 | import { COMMENTS } from '../shared/comments'
2 | import { DISHES } from '../shared/dishes'
3 | import { LEADERS } from '../shared/leaders'
4 | import { PROMOTIONS } from '../shared/promotions'
5 |
6 |
7 | // state
8 | export const initialState = {
9 | comments: COMMENTS,
10 | dishes: DISHES,
11 | leaders: LEADERS,
12 | promotions: PROMOTIONS,
13 | };
14 |
15 |
16 | // action
17 | // plain js obj with a type field that specifies how to
18 | // change something in the state
19 |
20 | /**
21 | *
22 | Pure functions: A function which is called Reducer in Redux,
23 | that take the current state and action and return a
24 | new state
25 | - Update data immutably ( do not modify inputs )
26 | */
27 | export const Reducer = (state = initialState, action) => {
28 | return state;
29 | };
--------------------------------------------------------------------------------
/confusion/assignment_3/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/confusion/assignment_3/src/shared/comments.js:
--------------------------------------------------------------------------------
1 | export const COMMENTS =
2 | [
3 | {
4 | id: 0,
5 | dishId: 0,
6 | rating: 5,
7 | comment: "Imagine all the eatables, living in conFusion!",
8 | author: "John Lemon",
9 | date: "2012-10-16T17:57:28.556094Z"
10 | },
11 | {
12 | id: 1,
13 | dishId: 0,
14 | rating: 4,
15 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
16 | author: "Paul McVites",
17 | date: "2014-09-05T17:57:28.556094Z"
18 | },
19 | {
20 | id: 2,
21 | dishId: 0,
22 | rating: 3,
23 | comment: "Eat it, just eat it!",
24 | author: "Michael Jaikishan",
25 | date: "2015-02-13T17:57:28.556094Z"
26 | },
27 | {
28 | id: 3,
29 | dishId: 0,
30 | rating: 4,
31 | comment: "Ultimate, Reaching for the stars!",
32 | author: "Ringo Starry",
33 | date: "2013-12-02T17:57:28.556094Z"
34 | },
35 | {
36 | id: 4,
37 | dishId: 0,
38 | rating: 2,
39 | comment: "It's your birthday, we're gonna party!",
40 | author: "25 Cent",
41 | date: "2011-12-02T17:57:28.556094Z"
42 | },
43 | {
44 | id: 5,
45 | dishId: 1,
46 | rating: 5,
47 | comment: "Imagine all the eatables, living in conFusion!",
48 | author: "John Lemon",
49 | date: "2012-10-16T17:57:28.556094Z"
50 | },
51 | {
52 | id: 6,
53 | dishId: 1,
54 | rating: 4,
55 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
56 | author: "Paul McVites",
57 | date: "2014-09-05T17:57:28.556094Z"
58 | },
59 | {
60 | id: 7,
61 | dishId: 1,
62 | rating: 3,
63 | comment: "Eat it, just eat it!",
64 | author: "Michael Jaikishan",
65 | date: "2015-02-13T17:57:28.556094Z"
66 | },
67 | {
68 | id: 8,
69 | dishId: 1,
70 | rating: 4,
71 | comment: "Ultimate, Reaching for the stars!",
72 | author: "Ringo Starry",
73 | date: "2013-12-02T17:57:28.556094Z"
74 | },
75 | {
76 | id: 9,
77 | dishId: 1,
78 | rating: 2,
79 | comment: "It's your birthday, we're gonna party!",
80 | author: "25 Cent",
81 | date: "2011-12-02T17:57:28.556094Z"
82 | },
83 | {
84 | id: 10,
85 | dishId: 2,
86 | rating: 5,
87 | comment: "Imagine all the eatables, living in conFusion!",
88 | author: "John Lemon",
89 | date: "2012-10-16T17:57:28.556094Z"
90 | },
91 | {
92 | id: 11,
93 | dishId: 2,
94 | rating: 4,
95 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
96 | author: "Paul McVites",
97 | date: "2014-09-05T17:57:28.556094Z"
98 | },
99 | {
100 | id: 12,
101 | dishId: 2,
102 | rating: 3,
103 | comment: "Eat it, just eat it!",
104 | author: "Michael Jaikishan",
105 | date: "2015-02-13T17:57:28.556094Z"
106 | },
107 | {
108 | id: 13,
109 | dishId: 2,
110 | rating: 4,
111 | comment: "Ultimate, Reaching for the stars!",
112 | author: "Ringo Starry",
113 | date: "2013-12-02T17:57:28.556094Z"
114 | },
115 | {
116 | id: 14,
117 | dishId: 2,
118 | rating: 2,
119 | comment: "It's your birthday, we're gonna party!",
120 | author: "25 Cent",
121 | date: "2011-12-02T17:57:28.556094Z"
122 | },
123 | {
124 | id: 15,
125 | dishId: 3,
126 | rating: 5,
127 | comment: "Imagine all the eatables, living in conFusion!",
128 | author: "John Lemon",
129 | date: "2012-10-16T17:57:28.556094Z"
130 | },
131 | {
132 | id: 16,
133 | dishId: 3,
134 | rating: 4,
135 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
136 | author: "Paul McVites",
137 | date: "2014-09-05T17:57:28.556094Z"
138 | },
139 | {
140 | id: 17,
141 | dishId: 3,
142 | rating: 3,
143 | comment: "Eat it, just eat it!",
144 | author: "Michael Jaikishan",
145 | date: "2015-02-13T17:57:28.556094Z"
146 | },
147 | {
148 | id: 18,
149 | dishId: 3,
150 | rating: 4,
151 | comment: "Ultimate, Reaching for the stars!",
152 | author: "Ringo Starry",
153 | date: "2013-12-02T17:57:28.556094Z"
154 | },
155 | {
156 | id: 19,
157 | dishId: 3,
158 | rating: 2,
159 | comment: "It's your birthday, we're gonna party!",
160 | author: "25 Cent",
161 | date: "2011-12-02T17:57:28.556094Z"
162 | }
163 | ]
--------------------------------------------------------------------------------
/confusion/assignment_3/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_3/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_3/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_4/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/confusion/assignment_4/README.md:
--------------------------------------------------------------------------------
1 | # Front-End-Web-Development-with-React
2 |
3 | Assigment and lectures code of this course in Coursera.
4 |
5 | ## [Visit the Course](https://www.coursera.org/learn/front-end-react)
6 |
7 | ## Don't copy and paste. Use your brain. Believe me you are the best.
8 | ## Please respect the [Coursera Honor Code](https://learner.coursera.help/hc/en-us/articles/209818863)
9 | />
10 | You will also see any lint errors in the console.
11 |
12 | ### `yarn test`
13 |
14 | Launches the test runner in the interactive watch mode.
15 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
16 |
17 | ### `yarn build`
18 |
19 | Builds the app for production to the `build` folder.
20 | It correctly bundles React in production mode and optimizes the build for the best performance.
21 |
22 | The build is minified and the filenames include the hashes.
23 | Your app is ready to be deployed!
24 |
25 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
26 |
27 | ### `yarn eject`
28 |
29 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
30 |
31 | 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.
32 |
33 | 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.
34 |
35 | 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.
36 |
37 | ## Learn More
38 |
39 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
40 |
41 | To learn React, check out the [React documentation](https://reactjs.org/).
42 |
43 | ### Code Splitting
44 |
45 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
46 |
47 | ### Analyzing the Bundle Size
48 |
49 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
50 |
51 | ### Making a Progressive Web App
52 |
53 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
54 |
55 | ### Advanced Configuration
56 |
57 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
58 |
59 | ### Deployment
60 |
61 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
62 |
63 | ### `yarn build` fails to minify
64 |
65 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
66 |
--------------------------------------------------------------------------------
/confusion/assignment_4/assignment2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/assignment2.png
--------------------------------------------------------------------------------
/confusion/assignment_4/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "posts": [
3 | {
4 | "id": 1,
5 | "title": "json-server",
6 | "author": "typicode"
7 | }
8 | ],
9 | "comments": [
10 | {
11 | "id": 1,
12 | "body": "some comment",
13 | "postId": 1
14 | }
15 | ],
16 | "profile": {
17 | "name": "typicode"
18 | }
19 | }
--------------------------------------------------------------------------------
/confusion/assignment_4/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^4.2.4",
7 | "@testing-library/react": "^9.3.2",
8 | "@testing-library/user-event": "^7.1.2",
9 | "bootstrap": "4.0.0",
10 | "bootstrap-social": "5.1.1",
11 | "cross-fetch": "2.1.0",
12 | "font-awesome": "4.7.0",
13 | "prop-types": "15.6.0",
14 | "react": "^16.13.1",
15 | "react-animation-components": "3.0.0",
16 | "react-dom": "^16.13.1",
17 | "react-popper": "0.9.2",
18 | "react-redux": "5.0.7",
19 | "react-redux-form": "1.16.8",
20 | "react-router-dom": "4.2.2",
21 | "react-scripts": "3.4.1",
22 | "reactstrap": "5.0.0",
23 | "redux": "3.7.2",
24 | "redux-logger": "3.0.6",
25 | "redux-thunk": "2.2.0"
26 | },
27 | "scripts": {
28 | "start": "react-scripts start",
29 | "build": "react-scripts build",
30 | "test": "react-scripts test",
31 | "eject": "react-scripts eject"
32 | },
33 | "eslintConfig": {
34 | "extends": "react-app"
35 | },
36 | "browserslist": {
37 | "production": [
38 | ">0.2%",
39 | "not dead",
40 | "not op_mini all"
41 | ],
42 | "development": [
43 | "last 1 chrome version",
44 | "last 1 firefox version",
45 | "last 1 safari version"
46 | ]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/logo.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/favicon.ico
--------------------------------------------------------------------------------
/confusion/assignment_4/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/confusion/assignment_4/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/logo192.png
--------------------------------------------------------------------------------
/confusion/assignment_4/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/assignment_4/public/logo512.png
--------------------------------------------------------------------------------
/confusion/assignment_4/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 | "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 | }
26 |
--------------------------------------------------------------------------------
/confusion/assignment_4/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/App.css:
--------------------------------------------------------------------------------
1 | .row-header{
2 | margin:0px auto;
3 | padding:0px auto;
4 | }
5 |
6 | .row-content {
7 | margin:0px auto;
8 | padding: 50px 0px 50px 0px;
9 | border-bottom: 1px ridge;
10 | min-height:400px;
11 | }
12 |
13 | .footer{
14 | background-color: #D1C4E9;
15 | margin:0px auto;
16 | padding: 20px 0px 20px 0px;
17 | }
18 | .jumbotron {
19 | padding:70px 30px 70px 30px;
20 | margin:0px auto;
21 | background: #9575CD ;
22 | color:floralwhite;
23 | }
24 |
25 | address{
26 | font-size:80%;
27 | margin:0px;
28 | color:#0f0f0f;
29 | }
30 |
31 | .navbar-dark {
32 | background-color: #512DA8;
33 | }
34 |
35 | .page-enter {
36 | opacity: 0.01;
37 | transform: translateX(-100%);
38 | }
39 |
40 | .page-enter-active {
41 | opacity: 1;
42 | transform: translateX(0%);
43 | transition: all 300ms ease-in;
44 | }
45 |
46 | .page-exit {
47 | opacity: 1;
48 | transform: translateX(0%);
49 | }
50 |
51 | .page-exit-active {
52 | opacity: 0.01;
53 | transform: translateX(100%);
54 | transition: all 300ms ease-out;
55 | }
--------------------------------------------------------------------------------
/confusion/assignment_4/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Main from './components/MainComponent';
4 |
5 | import './App.css';
6 |
7 | import { BrowserRouter } from 'react-router-dom';
8 |
9 | import { Provider } from 'react-redux';
10 | import { ConfigureStore } from './redux/configureStore';
11 | const store = ConfigureStore();
12 |
13 | class App extends Component{
14 |
15 |
16 | render(){
17 |
18 | return(
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | }
29 |
30 | }
31 |
32 | export default App;
33 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/confusion/assignment_4/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 |
11 |
Links
12 |
13 | Home
14 | About
15 | Menu
16 | Contact
17 |
18 |
19 |
20 |
Our Address
21 |
22 | 121, Clear Water Bay Road
23 | Clear Water Bay, Kowloon
24 | HONG KONG
25 | : +852 1234 5678
26 | : +852 8765 4321
27 | :
28 | confusion@food.net
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
© Copyright 2018 Ristorante Con Fusion
45 |
46 |
47 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default Footer;
--------------------------------------------------------------------------------
/confusion/assignment_4/src/components/HomeComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Card,
4 | CardImg,
5 | CardText,
6 | CardBody,
7 | CardTitle,
8 | CardSubtitle
9 | } from "reactstrap";
10 | import { Loading } from "./LoadingComponent";
11 | import { baseUrl } from "../shared/baseUrl";
12 | import { FadeTransform } from 'react-animation-components';
13 |
14 |
15 | function RenderCard({item, isLoading, errMess }) {
16 |
17 | if (isLoading) {
18 |
19 | return (
20 |
21 | );
22 | }
23 | else if ( errMess ) {
24 |
25 | return (
26 | {errMess}
27 | );
28 | }
29 | else{
30 |
31 | return(
32 |
37 |
38 |
39 |
40 | {item.name}
41 |
42 | {item.designation ? {item.designation} : null }
43 |
44 | {item.description}
45 |
46 |
47 |
48 |
49 | );
50 |
51 | }
52 | }
53 |
54 |
55 |
56 | function Home(props) {
57 | return(
58 |
59 |
60 |
61 |
62 |
67 |
68 |
69 |
70 |
75 |
76 |
77 |
78 |
84 |
85 |
86 |
87 |
88 | );
89 | }
90 |
91 | export default Home;
--------------------------------------------------------------------------------
/confusion/assignment_4/src/components/LoadingComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const Loading = () => {
4 | return (
5 |
6 |
7 |
8 |
Loading...
9 |
10 | );
11 | };
--------------------------------------------------------------------------------
/confusion/assignment_4/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay, CardTitle, Breadcrumb, BreadcrumbItem } from "reactstrap";
3 | import {Link} from 'react-router-dom';
4 | import { Loading } from './LoadingComponent';
5 | import { baseUrl } from '../shared/baseUrl';
6 |
7 | function RenderMenuItem({ dish, onClick }) {
8 | return(
9 |
10 |
11 |
12 |
13 | {dish.name}
14 |
15 |
16 |
17 | );
18 | }
19 |
20 | const Menu = (props) => {
21 |
22 | const menu = props.dishes.dishes.map((dish) => {
23 | return (
24 |
25 |
26 |
27 | );
28 | });
29 |
30 | if (props.dishes.isLoading) {
31 | return (
32 |
37 | );
38 | }
39 | else if (props.dishes.errMess) {
40 | return (
41 |
42 |
43 |
{props.dishes.errMess}
44 |
45 |
46 | );
47 | }
48 | else
49 | {
50 | return(
51 |
52 |
53 |
54 |
55 | Home
56 |
57 |
58 | Menu
59 |
60 |
61 |
62 |
63 |
Menu
64 |
65 |
66 |
67 |
68 |
69 | { menu }
70 |
71 |
72 | );
73 |
74 | }
75 |
76 |
77 | }
78 |
79 |
80 |
81 |
82 |
83 | export default Menu;
--------------------------------------------------------------------------------
/confusion/assignment_4/src/components/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Title
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | This is a Heading
19 | This is a paragraph.
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 | 001 - Środki trwałe x
31 | 001-001 - Środek trwały 1
32 | 001-002 - Środek trwały 2
33 | 002 - Kasa
34 | 04-33 - test
35 | 05 - dff
36 |
37 |
38 |
39 |
40 |
45 |
46 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/confusion/assignment_4/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.min.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(
13 |
14 |
15 | ,
16 | document.getElementById('root')
17 | );
18 |
19 | // If you want your app to work offline and load faster, you can change
20 | // unregister() to register() below. Note this comes with some pitfalls.
21 | // Learn more about service workers: https://bit.ly/CRA-PWA
22 | // serviceWorker.unregister();
23 | serviceWorker.register();
24 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/ActionTypes.js:
--------------------------------------------------------------------------------
1 | export const ADD_COMMENT = 'ADD_COMMENT';
2 |
3 | export const ADD_FEEDBACK = 'ADD_FEEDBACK';
4 |
5 | export const DISHES_LOADING = 'DISHES_LOADING';
6 | export const DISHES_FAILED = 'DISHES_FAILED';
7 | export const ADD_DISHES = 'ADD_DISHES';
8 |
9 | export const ADD_COMMENTS = 'ADD_COMMENTS';
10 | export const COMMENTS_FAILED ='COMMENTS_FAILED';
11 |
12 | export const PROMOS_LOADING ='PROMOS_LOADING';
13 | export const ADD_PROMOS = 'ADD_PROMOS';
14 | export const PROMOS_FAILED = 'PROMOS_FAILED';
15 |
16 | export const LEADERS_LOADING ='LEADERS_LOADING';
17 | export const ADD_LEADERS = 'ADD_LEADERS';
18 | export const LEADERS_FAILED = 'LEADERS_FAILED';
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/comments.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 |
3 | export const Comments = (state = { errMess: null, comments: [] }, action) => {
4 | switch (action.type) {
5 | case ActionTypes.ADD_COMMENTS:
6 | return { ...state, errMess: null, comments: action.payload };
7 |
8 | case ActionTypes.COMMENTS_FAILED:
9 | return { ...state, errMess: action.payload };
10 |
11 | case ActionTypes.ADD_COMMENT:
12 | var comment = action.payload;
13 | return { ...state, comments: state.comments.concat(comment) };
14 |
15 | default:
16 | return state;
17 | }
18 | };
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/configureStore.js:
--------------------------------------------------------------------------------
1 | /** REDUX
2 | *
3 | * # Holds the current state
4 | *
5 | * # Created using createStore()
6 | *
7 | * # Supplies three methods:
8 | * - dispatch(): states state update with the provided action object
9 | *
10 | * Dispatch method is where you will supply the
11 | * action object and then specify what
12 | * changes you want to make to the state.
13 | *
14 | * - getState(): returns the current stored state value
15 | * - subscribe(): accept a callback function that will be run every time
16 | * an action is dispatched
17 | *
18 | */
19 |
20 |
21 | import { createStore, combineReducers, applyMiddleware } from 'redux';
22 | import { createForms } from 'react-redux-form';
23 |
24 | import { Dishes } from './dishes';
25 | import { Comments } from './comments';
26 | import { Promotions } from './promotions';
27 | import { Leaders } from './leaders';
28 | import thunk from 'redux-thunk';
29 | import logger from 'redux-logger';
30 | import { InitialFeedback } from './forms';
31 |
32 | //// creating store
33 | export const ConfigureStore = () => {
34 |
35 | const store = createStore(
36 |
37 | combineReducers({
38 | dishes: Dishes,
39 | comments: Comments,
40 | promotions: Promotions,
41 | leaders: Leaders,
42 |
43 | ...createForms({
44 | feedback: InitialFeedback
45 | })
46 | }),
47 | applyMiddleware( thunk, logger )
48 | );
49 |
50 |
51 |
52 | return store;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/dishes.js:
--------------------------------------------------------------------------------
1 |
2 | /*reducer functions
3 |
4 | takes two params
5 | * action
6 | # payloads of information that send data from your application
7 | to the store.
8 |
9 | # type property (indicates type of action to be performed)
10 |
11 | # payload (data necessary for the action)
12 |
13 | * state
14 |
15 | ## action typically handled through a switch statement switching
16 | on the action type.
17 |
18 | ## return the previous state in the default case
19 |
20 | * */
21 |
22 | import * as ActionTypes from "./ActionTypes";
23 |
24 | export const Dishes = (
25 | state = {
26 | isLoading: true,
27 | errMess: null,
28 | dishes: []
29 | },
30 | action
31 | ) => {
32 | switch (action.type) {
33 | case ActionTypes.ADD_DISHES:
34 | return {
35 | ...state,
36 | isLoading: false,
37 | errMess: null,
38 | dishes: action.payload
39 | };
40 |
41 | case ActionTypes.DISHES_LOADING:
42 | return { ...state, isLoading: true, errMess: null, dishes: [] };
43 |
44 | case ActionTypes.DISHES_FAILED:
45 | return { ...state, isLoading: false, errMess: action.payload };
46 |
47 | default:
48 | return state;
49 | }
50 | };
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/forms.js:
--------------------------------------------------------------------------------
1 |
2 | export const InitialFeedback = {
3 | firstname: '',
4 | lastname: '',
5 | telnum: '',
6 | email: '',
7 | agree: false,
8 | ccontactType: 'Tel.',
9 | message: ''
10 | }
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/leaders.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 | // import { LEADERS } from '../shared/leaders';
3 |
4 |
5 | /*reducer functions
6 |
7 | takes two params
8 | * action
9 | # payloads of information that send data from your application
10 | to the store.
11 |
12 | # type property (indicates type of action to be performed)
13 |
14 | # payload (data necessary for the action)
15 |
16 | * state
17 |
18 | ## action typically handled through a switch statement switching
19 | on the action type.
20 |
21 | ## return the previous state in the default case
22 |
23 | * */
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ////reducer function, returns the next immutable state
33 | export const Leaders = (state = {
34 | isLoading: true,
35 | errMess: null,
36 | leaders: []
37 | }, action) => {
38 |
39 | switch (action.type) {
40 | case ActionTypes.ADD_LEADERS:
41 | return { ...state, isLoading: false, errMess: null, leaders: action.payload };
42 |
43 | case ActionTypes.LEADERS_LOADING:
44 | return { ...state, isLoading: true, errMess: null, leaders: [] }
45 |
46 | case ActionTypes.LEADERS_FAILED:
47 | return { ...state, isLoading: false, errMess: action.payload };
48 |
49 | default:
50 | return state;
51 | }
52 | }
--------------------------------------------------------------------------------
/confusion/assignment_4/src/redux/promotions.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 |
3 | /*reducer functions
4 |
5 | takes two params
6 | * action
7 | # payloads of information that send data from your application
8 | to the store.
9 |
10 | # type property (indicates type of action to be performed)
11 |
12 | # payload (data necessary for the action)
13 |
14 | * state
15 |
16 | ## action typically handled through a switch statement switching
17 | on the action type.
18 |
19 | ## return the previous state in the default case
20 |
21 | * */
22 |
23 | ////reducer function
24 | export const Promotions = (state = {
25 | isLoading: true,
26 | errMess: null,
27 | promotions: []
28 | }, action) => {
29 | switch (action.type) {
30 | case ActionTypes.ADD_PROMOS:
31 | return { ...state, isLoading: false, errMess: null, promotions: action.payload };
32 |
33 | case ActionTypes.PROMOS_LOADING:
34 | return { ...state, isLoading: true, errMess: null, promotions: [] }
35 |
36 | case ActionTypes.PROMOS_FAILED:
37 | return { ...state, isLoading: false, errMess: action.payload };
38 |
39 | default:
40 | return state;
41 | }
42 | };
--------------------------------------------------------------------------------
/confusion/assignment_4/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/confusion/assignment_4/src/shared/baseUrl.js:
--------------------------------------------------------------------------------
1 | export const baseUrl = 'http://localhost:3001/';
--------------------------------------------------------------------------------
/confusion/assignment_4/src/shared/comments.js:
--------------------------------------------------------------------------------
1 | export const COMMENTS =
2 | [
3 | {
4 | id: 0,
5 | dishId: 0,
6 | rating: 5,
7 | comment: "Imagine all the eatables, living in conFusion!",
8 | author: "John Lemon",
9 | date: "2012-10-16T17:57:28.556094Z"
10 | },
11 | {
12 | id: 1,
13 | dishId: 0,
14 | rating: 4,
15 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
16 | author: "Paul McVites",
17 | date: "2014-09-05T17:57:28.556094Z"
18 | },
19 | {
20 | id: 2,
21 | dishId: 0,
22 | rating: 3,
23 | comment: "Eat it, just eat it!",
24 | author: "Michael Jaikishan",
25 | date: "2015-02-13T17:57:28.556094Z"
26 | },
27 | {
28 | id: 3,
29 | dishId: 0,
30 | rating: 4,
31 | comment: "Ultimate, Reaching for the stars!",
32 | author: "Ringo Starry",
33 | date: "2013-12-02T17:57:28.556094Z"
34 | },
35 | {
36 | id: 4,
37 | dishId: 0,
38 | rating: 2,
39 | comment: "It's your birthday, we're gonna party!",
40 | author: "25 Cent",
41 | date: "2011-12-02T17:57:28.556094Z"
42 | },
43 | {
44 | id: 5,
45 | dishId: 1,
46 | rating: 5,
47 | comment: "Imagine all the eatables, living in conFusion!",
48 | author: "John Lemon",
49 | date: "2012-10-16T17:57:28.556094Z"
50 | },
51 | {
52 | id: 6,
53 | dishId: 1,
54 | rating: 4,
55 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
56 | author: "Paul McVites",
57 | date: "2014-09-05T17:57:28.556094Z"
58 | },
59 | {
60 | id: 7,
61 | dishId: 1,
62 | rating: 3,
63 | comment: "Eat it, just eat it!",
64 | author: "Michael Jaikishan",
65 | date: "2015-02-13T17:57:28.556094Z"
66 | },
67 | {
68 | id: 8,
69 | dishId: 1,
70 | rating: 4,
71 | comment: "Ultimate, Reaching for the stars!",
72 | author: "Ringo Starry",
73 | date: "2013-12-02T17:57:28.556094Z"
74 | },
75 | {
76 | id: 9,
77 | dishId: 1,
78 | rating: 2,
79 | comment: "It's your birthday, we're gonna party!",
80 | author: "25 Cent",
81 | date: "2011-12-02T17:57:28.556094Z"
82 | },
83 | {
84 | id: 10,
85 | dishId: 2,
86 | rating: 5,
87 | comment: "Imagine all the eatables, living in conFusion!",
88 | author: "John Lemon",
89 | date: "2012-10-16T17:57:28.556094Z"
90 | },
91 | {
92 | id: 11,
93 | dishId: 2,
94 | rating: 4,
95 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
96 | author: "Paul McVites",
97 | date: "2014-09-05T17:57:28.556094Z"
98 | },
99 | {
100 | id: 12,
101 | dishId: 2,
102 | rating: 3,
103 | comment: "Eat it, just eat it!",
104 | author: "Michael Jaikishan",
105 | date: "2015-02-13T17:57:28.556094Z"
106 | },
107 | {
108 | id: 13,
109 | dishId: 2,
110 | rating: 4,
111 | comment: "Ultimate, Reaching for the stars!",
112 | author: "Ringo Starry",
113 | date: "2013-12-02T17:57:28.556094Z"
114 | },
115 | {
116 | id: 14,
117 | dishId: 2,
118 | rating: 2,
119 | comment: "It's your birthday, we're gonna party!",
120 | author: "25 Cent",
121 | date: "2011-12-02T17:57:28.556094Z"
122 | },
123 | {
124 | id: 15,
125 | dishId: 3,
126 | rating: 5,
127 | comment: "Imagine all the eatables, living in conFusion!",
128 | author: "John Lemon",
129 | date: "2012-10-16T17:57:28.556094Z"
130 | },
131 | {
132 | id: 16,
133 | dishId: 3,
134 | rating: 4,
135 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
136 | author: "Paul McVites",
137 | date: "2014-09-05T17:57:28.556094Z"
138 | },
139 | {
140 | id: 17,
141 | dishId: 3,
142 | rating: 3,
143 | comment: "Eat it, just eat it!",
144 | author: "Michael Jaikishan",
145 | date: "2015-02-13T17:57:28.556094Z"
146 | },
147 | {
148 | id: 18,
149 | dishId: 3,
150 | rating: 4,
151 | comment: "Ultimate, Reaching for the stars!",
152 | author: "Ringo Starry",
153 | date: "2013-12-02T17:57:28.556094Z"
154 | },
155 | {
156 | id: 19,
157 | dishId: 3,
158 | rating: 2,
159 | comment: "It's your birthday, we're gonna party!",
160 | author: "25 Cent",
161 | date: "2011-12-02T17:57:28.556094Z"
162 | }
163 | ]
--------------------------------------------------------------------------------
/confusion/assignment_4/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_4/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 | ];
--------------------------------------------------------------------------------
/confusion/assignment_4/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 | ];
--------------------------------------------------------------------------------
/confusion/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "posts": [
3 | {
4 | "id": 1,
5 | "title": "json-server",
6 | "author": "typicode"
7 | }
8 | ],
9 | "comments": [
10 | {
11 | "id": 1,
12 | "body": "some comment",
13 | "postId": 1
14 | }
15 | ],
16 | "profile": {
17 | "name": "typicode"
18 | }
19 | }
--------------------------------------------------------------------------------
/confusion/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "confusion",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^4.2.4",
7 | "@testing-library/react": "^9.3.2",
8 | "@testing-library/user-event": "^7.1.2",
9 | "bootstrap": "4.0.0",
10 | "bootstrap-social": "5.1.1",
11 | "cross-fetch": "2.1.0",
12 | "font-awesome": "4.7.0",
13 | "prop-types": "15.6.0",
14 | "react": "^16.13.1",
15 | "react-animation-components": "3.0.0",
16 | "react-dom": "^16.13.1",
17 | "react-popper": "0.9.2",
18 | "react-redux": "5.0.7",
19 | "react-redux-form": "1.16.8",
20 | "react-router-dom": "4.2.2",
21 | "react-scripts": "3.4.1",
22 | "reactstrap": "5.0.0",
23 | "redux": "3.7.2",
24 | "redux-logger": "3.0.6",
25 | "redux-thunk": "2.2.0"
26 | },
27 | "scripts": {
28 | "start": "react-scripts start",
29 | "build": "react-scripts build",
30 | "test": "react-scripts test",
31 | "eject": "react-scripts eject"
32 | },
33 | "eslintConfig": {
34 | "extends": "react-app"
35 | },
36 | "browserslist": {
37 | "production": [
38 | ">0.2%",
39 | "not dead",
40 | "not op_mini all"
41 | ],
42 | "development": [
43 | "last 1 chrome version",
44 | "last 1 firefox version",
45 | "last 1 safari version"
46 | ]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/confusion/public/assets/images/alberto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/alberto.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/buffet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/buffet.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/elaicheesecake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/elaicheesecake.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/logo.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/uthappizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/uthappizza.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/vadonut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/vadonut.png
--------------------------------------------------------------------------------
/confusion/public/assets/images/zucchipakoda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/assets/images/zucchipakoda.png
--------------------------------------------------------------------------------
/confusion/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/favicon.ico
--------------------------------------------------------------------------------
/confusion/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | React App
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/confusion/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/logo192.png
--------------------------------------------------------------------------------
/confusion/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sunzid02/Front-End-Web-Development-with-React/c66f073df0d4ce74b0bca739d674ff485ea5dad1/confusion/public/logo512.png
--------------------------------------------------------------------------------
/confusion/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 | "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 | }
26 |
--------------------------------------------------------------------------------
/confusion/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/confusion/src/App.css:
--------------------------------------------------------------------------------
1 | .row-header{
2 | margin:0px auto;
3 | padding:0px auto;
4 | }
5 |
6 | .row-content {
7 | margin:0px auto;
8 | padding: 50px 0px 50px 0px;
9 | border-bottom: 1px ridge;
10 | min-height:400px;
11 | }
12 |
13 | .footer{
14 | background-color: #D1C4E9;
15 | margin:0px auto;
16 | padding: 20px 0px 20px 0px;
17 | }
18 | .jumbotron {
19 | padding:70px 30px 70px 30px;
20 | margin:0px auto;
21 | background: #9575CD ;
22 | color:floralwhite;
23 | }
24 |
25 | address{
26 | font-size:80%;
27 | margin:0px;
28 | color:#0f0f0f;
29 | }
30 |
31 | .navbar-dark {
32 | background-color: #512DA8;
33 | }
34 |
35 | .page-enter {
36 | opacity: 0.01;
37 | transform: translateX(-100%);
38 | }
39 |
40 | .page-enter-active {
41 | opacity: 1;
42 | transform: translateX(0%);
43 | transition: all 300ms ease-in;
44 | }
45 |
46 | .page-exit {
47 | opacity: 1;
48 | transform: translateX(0%);
49 | }
50 |
51 | .page-exit-active {
52 | opacity: 0.01;
53 | transform: translateX(100%);
54 | transition: all 300ms ease-out;
55 | }
--------------------------------------------------------------------------------
/confusion/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import Main from './components/MainComponent';
4 |
5 | import './App.css';
6 |
7 | import { BrowserRouter } from 'react-router-dom';
8 |
9 | import { Provider } from 'react-redux';
10 | import { ConfigureStore } from './redux/configureStore';
11 | const store = ConfigureStore();
12 |
13 | class App extends Component{
14 |
15 |
16 | render(){
17 |
18 | return(
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | }
29 |
30 | }
31 |
32 | export default App;
33 |
--------------------------------------------------------------------------------
/confusion/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/confusion/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 |
11 |
Links
12 |
13 | Home
14 | About
15 | Menu
16 | Contact
17 |
18 |
19 |
20 |
Our Address
21 |
22 | 121, Clear Water Bay Road
23 | Clear Water Bay, Kowloon
24 | HONG KONG
25 | : +852 1234 5678
26 | : +852 8765 4321
27 | :
28 | confusion@food.net
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
© Copyright 2018 Ristorante Con Fusion
45 |
46 |
47 |
48 |
49 |
50 | );
51 | }
52 |
53 | export default Footer;
--------------------------------------------------------------------------------
/confusion/src/components/HomeComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import {
3 | Card,
4 | CardImg,
5 | CardText,
6 | CardBody,
7 | CardTitle,
8 | CardSubtitle
9 | } from "reactstrap";
10 | import { Loading } from "./LoadingComponent";
11 | import { baseUrl } from "../shared/baseUrl";
12 | import { FadeTransform } from 'react-animation-components';
13 |
14 |
15 | function RenderCard({item, isLoading, errMess }) {
16 |
17 | if (isLoading) {
18 |
19 | return (
20 |
21 | );
22 | }
23 | else if ( errMess ) {
24 |
25 | return (
26 | {errMess}
27 | );
28 | }
29 | else{
30 |
31 | return(
32 |
37 |
38 |
39 |
40 | {item.name}
41 |
42 | {item.designation ? {item.designation} : null }
43 |
44 | {item.description}
45 |
46 |
47 |
48 |
49 | );
50 |
51 | }
52 | }
53 |
54 |
55 |
56 | function Home(props) {
57 | return(
58 |
59 |
60 |
61 |
62 |
67 |
68 |
69 |
70 |
75 |
76 |
77 |
78 |
84 |
85 |
86 |
87 |
88 | );
89 | }
90 |
91 | export default Home;
--------------------------------------------------------------------------------
/confusion/src/components/LoadingComponent.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const Loading = () => {
4 | return (
5 |
6 |
7 |
8 |
Loading...
9 |
10 | );
11 | };
--------------------------------------------------------------------------------
/confusion/src/components/MenuComponent.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Card, CardImg, CardImgOverlay, CardTitle, Breadcrumb, BreadcrumbItem } from "reactstrap";
3 | import {Link} from 'react-router-dom';
4 | import { Loading } from './LoadingComponent';
5 | import { baseUrl } from '../shared/baseUrl';
6 |
7 | function RenderMenuItem({ dish, onClick }) {
8 | return(
9 |
10 |
11 |
12 |
13 | {dish.name}
14 |
15 |
16 |
17 | );
18 | }
19 |
20 | const Menu = (props) => {
21 |
22 | const menu = props.dishes.dishes.map((dish) => {
23 | return (
24 |
25 |
26 |
27 | );
28 | });
29 |
30 | if (props.dishes.isLoading) {
31 | return (
32 |
37 | );
38 | }
39 | else if (props.dishes.errMess) {
40 | return (
41 |
42 |
43 |
{props.dishes.errMess}
44 |
45 |
46 | );
47 | }
48 | else
49 | {
50 | return(
51 |
52 |
53 |
54 |
55 | Home
56 |
57 |
58 | Menu
59 |
60 |
61 |
62 |
63 |
Menu
64 |
65 |
66 |
67 |
68 |
69 | { menu }
70 |
71 |
72 | );
73 |
74 | }
75 |
76 |
77 | }
78 |
79 |
80 |
81 |
82 |
83 | export default Menu;
--------------------------------------------------------------------------------
/confusion/src/components/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Title
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | This is a Heading
19 | This is a paragraph.
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 | 001 - Środki trwałe x
31 | 001-001 - Środek trwały 1
32 | 001-002 - Środek trwały 2
33 | 002 - Kasa
34 | 04-33 - test
35 | 05 - dff
36 |
37 |
38 |
39 |
40 |
45 |
46 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/confusion/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/confusion/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.min.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(
13 |
14 |
15 | ,
16 | document.getElementById('root')
17 | );
18 |
19 | // If you want your app to work offline and load faster, you can change
20 | // unregister() to register() below. Note this comes with some pitfalls.
21 | // Learn more about service workers: https://bit.ly/CRA-PWA
22 | // serviceWorker.unregister();
23 | serviceWorker.register();
24 |
--------------------------------------------------------------------------------
/confusion/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/confusion/src/redux/ActionTypes.js:
--------------------------------------------------------------------------------
1 | export const ADD_COMMENT = 'ADD_COMMENT';
2 |
3 | export const ADD_FEEDBACK = 'ADD_FEEDBACK';
4 |
5 | export const DISHES_LOADING = 'DISHES_LOADING';
6 | export const DISHES_FAILED = 'DISHES_FAILED';
7 | export const ADD_DISHES = 'ADD_DISHES';
8 |
9 | export const ADD_COMMENTS = 'ADD_COMMENTS';
10 | export const COMMENTS_FAILED ='COMMENTS_FAILED';
11 |
12 | export const PROMOS_LOADING ='PROMOS_LOADING';
13 | export const ADD_PROMOS = 'ADD_PROMOS';
14 | export const PROMOS_FAILED = 'PROMOS_FAILED';
15 |
16 | export const LEADERS_LOADING ='LEADERS_LOADING';
17 | export const ADD_LEADERS = 'ADD_LEADERS';
18 | export const LEADERS_FAILED = 'LEADERS_FAILED';
--------------------------------------------------------------------------------
/confusion/src/redux/comments.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 |
3 | export const Comments = (state = { errMess: null, comments: [] }, action) => {
4 | switch (action.type) {
5 | case ActionTypes.ADD_COMMENTS:
6 | return { ...state, errMess: null, comments: action.payload };
7 |
8 | case ActionTypes.COMMENTS_FAILED:
9 | return { ...state, errMess: action.payload };
10 |
11 | case ActionTypes.ADD_COMMENT:
12 | var comment = action.payload;
13 | return { ...state, comments: state.comments.concat(comment) };
14 |
15 | default:
16 | return state;
17 | }
18 | };
--------------------------------------------------------------------------------
/confusion/src/redux/configureStore.js:
--------------------------------------------------------------------------------
1 | /** REDUX
2 | *
3 | * # Holds the current state
4 | *
5 | * # Created using createStore()
6 | *
7 | * # Supplies three methods:
8 | * - dispatch(): states state update with the provided action object
9 | *
10 | * Dispatch method is where you will supply the
11 | * action object and then specify what
12 | * changes you want to make to the state.
13 | *
14 | * - getState(): returns the current stored state value
15 | * - subscribe(): accept a callback function that will be run every time
16 | * an action is dispatched
17 | *
18 | */
19 |
20 |
21 | import { createStore, combineReducers, applyMiddleware } from 'redux';
22 | import { createForms } from 'react-redux-form';
23 |
24 | import { Dishes } from './dishes';
25 | import { Comments } from './comments';
26 | import { Promotions } from './promotions';
27 | import { Leaders } from './leaders';
28 | import thunk from 'redux-thunk';
29 | import logger from 'redux-logger';
30 | import { InitialFeedback } from './forms';
31 |
32 | //// creating store
33 | export const ConfigureStore = () => {
34 |
35 | const store = createStore(
36 |
37 | combineReducers({
38 | dishes: Dishes,
39 | comments: Comments,
40 | promotions: Promotions,
41 | leaders: Leaders,
42 |
43 | ...createForms({
44 | feedback: InitialFeedback
45 | })
46 | }),
47 | applyMiddleware( thunk, logger )
48 | );
49 |
50 |
51 |
52 | return store;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/confusion/src/redux/dishes.js:
--------------------------------------------------------------------------------
1 |
2 | /*reducer functions
3 |
4 | takes two params
5 | * action
6 | # payloads of information that send data from your application
7 | to the store.
8 |
9 | # type property (indicates type of action to be performed)
10 |
11 | # payload (data necessary for the action)
12 |
13 | * state
14 |
15 | ## action typically handled through a switch statement switching
16 | on the action type.
17 |
18 | ## return the previous state in the default case
19 |
20 | * */
21 |
22 | import * as ActionTypes from "./ActionTypes";
23 |
24 | export const Dishes = (
25 | state = {
26 | isLoading: true,
27 | errMess: null,
28 | dishes: []
29 | },
30 | action
31 | ) => {
32 | switch (action.type) {
33 | case ActionTypes.ADD_DISHES:
34 | return {
35 | ...state,
36 | isLoading: false,
37 | errMess: null,
38 | dishes: action.payload
39 | };
40 |
41 | case ActionTypes.DISHES_LOADING:
42 | return { ...state, isLoading: true, errMess: null, dishes: [] };
43 |
44 | case ActionTypes.DISHES_FAILED:
45 | return { ...state, isLoading: false, errMess: action.payload };
46 |
47 | default:
48 | return state;
49 | }
50 | };
--------------------------------------------------------------------------------
/confusion/src/redux/forms.js:
--------------------------------------------------------------------------------
1 |
2 | export const InitialFeedback = {
3 | firstname: '',
4 | lastname: '',
5 | telnum: '',
6 | email: '',
7 | agree: false,
8 | ccontactType: 'Tel.',
9 | message: ''
10 | }
--------------------------------------------------------------------------------
/confusion/src/redux/leaders.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 | // import { LEADERS } from '../shared/leaders';
3 |
4 |
5 | /*reducer functions
6 |
7 | takes two params
8 | * action
9 | # payloads of information that send data from your application
10 | to the store.
11 |
12 | # type property (indicates type of action to be performed)
13 |
14 | # payload (data necessary for the action)
15 |
16 | * state
17 |
18 | ## action typically handled through a switch statement switching
19 | on the action type.
20 |
21 | ## return the previous state in the default case
22 |
23 | * */
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ////reducer function, returns the next immutable state
33 | export const Leaders = (state = {
34 | isLoading: true,
35 | errMess: null,
36 | leaders: []
37 | }, action) => {
38 |
39 | switch (action.type) {
40 | case ActionTypes.ADD_LEADERS:
41 | return { ...state, isLoading: false, errMess: null, leaders: action.payload };
42 |
43 | case ActionTypes.LEADERS_LOADING:
44 | return { ...state, isLoading: true, errMess: null, leaders: [] }
45 |
46 | case ActionTypes.LEADERS_FAILED:
47 | return { ...state, isLoading: false, errMess: action.payload };
48 |
49 | default:
50 | return state;
51 | }
52 | }
--------------------------------------------------------------------------------
/confusion/src/redux/promotions.js:
--------------------------------------------------------------------------------
1 | import * as ActionTypes from './ActionTypes';
2 |
3 | /*reducer functions
4 |
5 | takes two params
6 | * action
7 | # payloads of information that send data from your application
8 | to the store.
9 |
10 | # type property (indicates type of action to be performed)
11 |
12 | # payload (data necessary for the action)
13 |
14 | * state
15 |
16 | ## action typically handled through a switch statement switching
17 | on the action type.
18 |
19 | ## return the previous state in the default case
20 |
21 | * */
22 |
23 | ////reducer function
24 | export const Promotions = (state = {
25 | isLoading: true,
26 | errMess: null,
27 | promotions: []
28 | }, action) => {
29 | switch (action.type) {
30 | case ActionTypes.ADD_PROMOS:
31 | return { ...state, isLoading: false, errMess: null, promotions: action.payload };
32 |
33 | case ActionTypes.PROMOS_LOADING:
34 | return { ...state, isLoading: true, errMess: null, promotions: [] }
35 |
36 | case ActionTypes.PROMOS_FAILED:
37 | return { ...state, isLoading: false, errMess: action.payload };
38 |
39 | default:
40 | return state;
41 | }
42 | };
--------------------------------------------------------------------------------
/confusion/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 https://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.0/8 are 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 https://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 https://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 | headers: { 'Service-Worker': 'script' },
105 | })
106 | .then(response => {
107 | // Ensure service worker exists, and that we really are getting a JS file.
108 | const contentType = response.headers.get('content-type');
109 | if (
110 | response.status === 404 ||
111 | (contentType != null && contentType.indexOf('javascript') === -1)
112 | ) {
113 | // No service worker found. Probably a different app. Reload the page.
114 | navigator.serviceWorker.ready.then(registration => {
115 | registration.unregister().then(() => {
116 | window.location.reload();
117 | });
118 | });
119 | } else {
120 | // Service worker found. Proceed as normal.
121 | registerValidSW(swUrl, config);
122 | }
123 | })
124 | .catch(() => {
125 | console.log(
126 | 'No internet connection found. App is running in offline mode.'
127 | );
128 | });
129 | }
130 |
131 | export function unregister() {
132 | if ('serviceWorker' in navigator) {
133 | navigator.serviceWorker.ready
134 | .then(registration => {
135 | registration.unregister();
136 | })
137 | .catch(error => {
138 | console.error(error.message);
139 | });
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/confusion/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/confusion/src/shared/baseUrl.js:
--------------------------------------------------------------------------------
1 | export const baseUrl = 'http://localhost:3001/';
--------------------------------------------------------------------------------
/confusion/src/shared/comments.js:
--------------------------------------------------------------------------------
1 | export const COMMENTS =
2 | [
3 | {
4 | id: 0,
5 | dishId: 0,
6 | rating: 5,
7 | comment: "Imagine all the eatables, living in conFusion!",
8 | author: "John Lemon",
9 | date: "2012-10-16T17:57:28.556094Z"
10 | },
11 | {
12 | id: 1,
13 | dishId: 0,
14 | rating: 4,
15 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
16 | author: "Paul McVites",
17 | date: "2014-09-05T17:57:28.556094Z"
18 | },
19 | {
20 | id: 2,
21 | dishId: 0,
22 | rating: 3,
23 | comment: "Eat it, just eat it!",
24 | author: "Michael Jaikishan",
25 | date: "2015-02-13T17:57:28.556094Z"
26 | },
27 | {
28 | id: 3,
29 | dishId: 0,
30 | rating: 4,
31 | comment: "Ultimate, Reaching for the stars!",
32 | author: "Ringo Starry",
33 | date: "2013-12-02T17:57:28.556094Z"
34 | },
35 | {
36 | id: 4,
37 | dishId: 0,
38 | rating: 2,
39 | comment: "It's your birthday, we're gonna party!",
40 | author: "25 Cent",
41 | date: "2011-12-02T17:57:28.556094Z"
42 | },
43 | {
44 | id: 5,
45 | dishId: 1,
46 | rating: 5,
47 | comment: "Imagine all the eatables, living in conFusion!",
48 | author: "John Lemon",
49 | date: "2012-10-16T17:57:28.556094Z"
50 | },
51 | {
52 | id: 6,
53 | dishId: 1,
54 | rating: 4,
55 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
56 | author: "Paul McVites",
57 | date: "2014-09-05T17:57:28.556094Z"
58 | },
59 | {
60 | id: 7,
61 | dishId: 1,
62 | rating: 3,
63 | comment: "Eat it, just eat it!",
64 | author: "Michael Jaikishan",
65 | date: "2015-02-13T17:57:28.556094Z"
66 | },
67 | {
68 | id: 8,
69 | dishId: 1,
70 | rating: 4,
71 | comment: "Ultimate, Reaching for the stars!",
72 | author: "Ringo Starry",
73 | date: "2013-12-02T17:57:28.556094Z"
74 | },
75 | {
76 | id: 9,
77 | dishId: 1,
78 | rating: 2,
79 | comment: "It's your birthday, we're gonna party!",
80 | author: "25 Cent",
81 | date: "2011-12-02T17:57:28.556094Z"
82 | },
83 | {
84 | id: 10,
85 | dishId: 2,
86 | rating: 5,
87 | comment: "Imagine all the eatables, living in conFusion!",
88 | author: "John Lemon",
89 | date: "2012-10-16T17:57:28.556094Z"
90 | },
91 | {
92 | id: 11,
93 | dishId: 2,
94 | rating: 4,
95 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
96 | author: "Paul McVites",
97 | date: "2014-09-05T17:57:28.556094Z"
98 | },
99 | {
100 | id: 12,
101 | dishId: 2,
102 | rating: 3,
103 | comment: "Eat it, just eat it!",
104 | author: "Michael Jaikishan",
105 | date: "2015-02-13T17:57:28.556094Z"
106 | },
107 | {
108 | id: 13,
109 | dishId: 2,
110 | rating: 4,
111 | comment: "Ultimate, Reaching for the stars!",
112 | author: "Ringo Starry",
113 | date: "2013-12-02T17:57:28.556094Z"
114 | },
115 | {
116 | id: 14,
117 | dishId: 2,
118 | rating: 2,
119 | comment: "It's your birthday, we're gonna party!",
120 | author: "25 Cent",
121 | date: "2011-12-02T17:57:28.556094Z"
122 | },
123 | {
124 | id: 15,
125 | dishId: 3,
126 | rating: 5,
127 | comment: "Imagine all the eatables, living in conFusion!",
128 | author: "John Lemon",
129 | date: "2012-10-16T17:57:28.556094Z"
130 | },
131 | {
132 | id: 16,
133 | dishId: 3,
134 | rating: 4,
135 | comment: "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!",
136 | author: "Paul McVites",
137 | date: "2014-09-05T17:57:28.556094Z"
138 | },
139 | {
140 | id: 17,
141 | dishId: 3,
142 | rating: 3,
143 | comment: "Eat it, just eat it!",
144 | author: "Michael Jaikishan",
145 | date: "2015-02-13T17:57:28.556094Z"
146 | },
147 | {
148 | id: 18,
149 | dishId: 3,
150 | rating: 4,
151 | comment: "Ultimate, Reaching for the stars!",
152 | author: "Ringo Starry",
153 | date: "2013-12-02T17:57:28.556094Z"
154 | },
155 | {
156 | id: 19,
157 | dishId: 3,
158 | rating: 2,
159 | comment: "It's your birthday, we're gonna party!",
160 | author: "25 Cent",
161 | date: "2011-12-02T17:57:28.556094Z"
162 | }
163 | ]
--------------------------------------------------------------------------------
/confusion/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 | ];
--------------------------------------------------------------------------------
/confusion/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 | ];
--------------------------------------------------------------------------------
/confusion/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 | ];
--------------------------------------------------------------------------------