├── Course1 ├── Bootstrap4 │ ├── .DS_Store │ └── conFusion │ │ ├── .DS_Store │ │ ├── .gitignore │ │ ├── Gruntfile.js │ │ ├── Week1_Assignment │ │ ├── extralarge.png │ │ └── extrasmall.png │ │ ├── Week2_Assignment │ │ └── screenshot_index.png │ │ ├── Week3_Assignment │ │ ├── index.html │ │ └── screenshot.png │ │ ├── Week4_Assignment │ │ ├── index.html │ │ └── styles.scss │ │ ├── __MACOSX │ │ ├── ._aboutus.html │ │ ├── ._contactus.html │ │ ├── ._img │ │ └── img │ │ │ ├── ._.DS_Store │ │ │ ├── ._alberto.png │ │ │ ├── ._buffet.png │ │ │ ├── ._logo.png │ │ │ └── ._uthappizza.png │ │ ├── aboutus.html │ │ ├── contactus.html │ │ ├── css │ │ ├── styles-old.css │ │ ├── styles.css │ │ ├── styles.less │ │ └── styles.scss │ │ ├── img │ │ ├── .DS_Store │ │ ├── alberto.png │ │ ├── buffet.png │ │ ├── logo.png │ │ └── uthappizza.png │ │ ├── index.html │ │ ├── js │ │ └── scripts.js │ │ ├── package-lock.json │ │ └── package.json ├── __MACOSX │ ├── ._Bootstrap4 │ └── Bootstrap4 │ │ ├── ._.DS_Store │ │ ├── ._conFusion │ │ └── conFusion │ │ ├── ._.DS_Store │ │ ├── ._index.html │ │ └── ._package.json └── git-test │ ├── .gitignore │ ├── index.html │ └── package.json ├── Course2 └── React │ ├── Week1_Assignment │ ├── DishdetailComponent.js │ └── MenuComponent.js │ ├── Week2_Assignment │ ├── AboutusComponent.js │ └── MainComponent.js │ ├── Week3_Assignment │ └── DishdetailComponent.js │ ├── Week4_Assignment │ ├── AboutusComponent.js │ ├── ActionCreators.js │ ├── ActionTypes.js │ ├── ContactComponent.js │ ├── HomeComponent.js │ ├── MainComponent.js │ └── leaders.js │ └── confusion │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── assets │ │ ├── __MACOSX │ │ │ ├── ._images │ │ │ └── images │ │ │ │ ├── ._.DS_Store │ │ │ │ ├── ._alberto.png │ │ │ │ ├── ._buffet.png │ │ │ │ ├── ._elaicheesecake.png │ │ │ │ ├── ._logo.png │ │ │ │ ├── ._uthappizza.png │ │ │ │ ├── ._vadonut.png │ │ │ │ └── ._zucchipakoda.png │ │ └── 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 │ │ ├── AboutusComponent.js │ │ ├── ContactComponent.js │ │ ├── DishdetailComponent.js │ │ ├── FooterComponent.js │ │ ├── HeaderComponent.js │ │ ├── HomeComponent.js │ │ ├── LoadingComponent.js │ │ ├── MainComponent.js │ │ └── MenuComponent.js │ ├── index.css │ ├── index.js │ ├── redux │ │ ├── ActionCreators.js │ │ ├── ActionTypes.js │ │ ├── comments.js │ │ ├── configureStore.js │ │ ├── dishes.js │ │ ├── forms.js │ │ ├── leaders.js │ │ └── promotions.js │ ├── serviceWorker.js │ └── shared │ │ ├── baseUrl.js │ │ ├── comments.js │ │ ├── dishes.js │ │ ├── leaders.js │ │ └── promotions.js │ └── yarn.lock ├── Course3 ├── ReactNative │ ├── Week1_Assignment │ │ ├── AboutComponent.js │ │ ├── ContactComponent.js │ │ └── MainComponent.js │ ├── Week2_Assignment │ │ ├── ActionCreators.js │ │ ├── ActionTypes.js │ │ ├── DishdetailComponent.js │ │ └── comments.js │ ├── Week3_Assignment │ │ ├── DishdetailComponent.js │ │ └── ReservationComponent.js │ └── confusion2 │ │ ├── .expo-shared │ │ └── assets.json │ │ ├── .gitignore │ │ ├── App.js │ │ ├── app.json │ │ ├── assets │ │ ├── icon.png │ │ └── splash.png │ │ ├── babel.config.js │ │ ├── components │ │ ├── AboutComponent.js │ │ ├── ContactComponent.js │ │ ├── DishdetailComponent.js │ │ ├── FavoriteComponent.js │ │ ├── HomeComponent.js │ │ ├── LoadingComponent.js │ │ ├── MainComponent.js │ │ ├── MenuComponent.js │ │ ├── ReservationComponent.js │ │ └── images │ │ │ ├── alberto.png │ │ │ ├── buffet.png │ │ │ ├── elaicheesecake.png │ │ │ ├── logo.png │ │ │ ├── uthappizza.png │ │ │ ├── vadonut.png │ │ │ └── zucchipakoda.png │ │ ├── package.json │ │ ├── redux │ │ ├── ActionCreators.js │ │ ├── ActionTypes.js │ │ ├── comments.js │ │ ├── configureStore.js │ │ ├── dishes.js │ │ ├── favorites.js │ │ ├── leaders.js │ │ └── promotions.js │ │ ├── shared │ │ ├── baseUrl.js │ │ ├── comments.js │ │ ├── dishes.js │ │ ├── leaders.js │ │ └── promotions.js │ │ └── yarn.lock └── json-server │ ├── db.json │ └── public │ └── images │ ├── .DS_Store │ ├── alberto.png │ ├── buffet.png │ ├── elaicheesecake.png │ ├── logo.png │ ├── uthappizza.png │ ├── vadonut.png │ └── zucchipakoda.png ├── README.md └── json-server ├── db.json └── public ├── asset-manifest.json ├── assets ├── __MACOSX │ ├── ._images │ └── images │ │ ├── ._.DS_Store │ │ ├── ._alberto.png │ │ ├── ._buffet.png │ │ ├── ._elaicheesecake.png │ │ ├── ._logo.png │ │ ├── ._uthappizza.png │ │ ├── ._vadonut.png │ │ └── ._zucchipakoda.png └── images │ ├── .DS_Store │ ├── alberto.png │ ├── buffet.png │ ├── elaicheesecake.png │ ├── logo.png │ ├── uthappizza.png │ ├── vadonut.png │ └── zucchipakoda.png ├── favicon.ico ├── images ├── .DS_Store ├── alberto.png ├── buffet.png ├── elaicheesecake.png ├── logo.png ├── uthappizza.png ├── vadonut.png └── zucchipakoda.png ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json ├── precache-manifest.d1eb6378353cd244bd2c324c10e796cc.js ├── robots.txt ├── service-worker.js └── static ├── css ├── 2.55e63a42.chunk.css ├── 2.55e63a42.chunk.css.map ├── main.511ac858.chunk.css └── main.511ac858.chunk.css.map ├── js ├── 2.4b91cb1b.chunk.js ├── 2.4b91cb1b.chunk.js.map ├── main.7bdbf10b.chunk.js ├── main.7bdbf10b.chunk.js.map ├── runtime-main.d107bd09.js └── runtime-main.d107bd09.js.map └── media ├── fontawesome-webfont.674f50d2.eot ├── fontawesome-webfont.912ec66d.svg ├── fontawesome-webfont.af7ae505.woff2 ├── fontawesome-webfont.b06871f2.ttf └── fontawesome-webfont.fee66e71.woff /Course1/Bootstrap4/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/.DS_Store -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/.DS_Store -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Gruntfile.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function(grunt) { 4 | require("time-grunt")(grunt); 5 | require("jit-grunt")(grunt, { 6 | useminPrepare: "grunt-usemin" 7 | }); 8 | grunt.initConfig({ 9 | sass: { 10 | dist: { 11 | files: { 12 | "css/styles.css": "css/styles.scss" 13 | } 14 | } 15 | }, 16 | watch: { 17 | files: "css/*.scss", 18 | tasks: ["sass"] 19 | }, 20 | browserSync: { 21 | dev: { 22 | bsFiles: { 23 | src: ["css/*.css", "*.html", "js/*.js"] 24 | }, 25 | options: { 26 | watchTask: true, 27 | server: { 28 | baseDir: "./" 29 | } 30 | } 31 | } 32 | }, 33 | copy: { 34 | html: { 35 | files: [ 36 | { 37 | expand: true, 38 | dot: true, 39 | cwd: "./", 40 | src: ["*.html"], 41 | dest: "dist" 42 | } 43 | ] 44 | }, 45 | fonts: { 46 | files: [ 47 | { 48 | expand: true, 49 | dot: true, 50 | cwd: "node_modules/font-awesome", 51 | src: ["fonts/*.*"], 52 | dest: "dist" 53 | } 54 | ] 55 | } 56 | }, 57 | clean: { 58 | build: { 59 | src: ["dist/"] 60 | } 61 | }, 62 | imagemin: { 63 | dynamic: { 64 | files: [ 65 | { 66 | expand: true, 67 | dot: true, 68 | cwd: "./", 69 | src: ["img/*{png,jpg,gif}"], 70 | dest: "dist/" 71 | } 72 | ] 73 | } 74 | }, 75 | useminPrepare: { 76 | foo: { 77 | dest: "dist", 78 | src: ["contactus.html", "aboutus.html", "index.html"] 79 | }, 80 | options: { 81 | flow: { 82 | steps: { 83 | css: ["cssmin"], 84 | js: ["uglify"] 85 | }, 86 | post: { 87 | css: [ 88 | { 89 | name: "cssmin", 90 | createConfig: function(context, block) { 91 | var generated = context.options.generated; 92 | generated.options = { 93 | keepSpecialComments: 0, 94 | rebase: false 95 | }; 96 | } 97 | } 98 | ] 99 | } 100 | } 101 | } 102 | }, 103 | concat: { 104 | options: { 105 | separator: ";" 106 | }, 107 | dist: {} 108 | }, 109 | uglify: { 110 | dist: {} 111 | }, 112 | cssmin: { 113 | dist: {} 114 | }, 115 | filerev: { 116 | options: { 117 | encoding: "utf8", 118 | algorithm: "md5", 119 | length: 20 120 | }, 121 | release: { 122 | files: [ 123 | { 124 | src: ["dist/js/*.js", "dist/css/*.css"] 125 | } 126 | ] 127 | } 128 | }, 129 | usemin: { 130 | html: ["dist/contactus.html", "dist/aboutus.html", "dist/index.html"], 131 | options: { 132 | assetsFirs: ["dist", "dist/css", "dist/js"] 133 | } 134 | }, 135 | htmlmin: { 136 | dist: { 137 | options: { 138 | collapseWhitespace: true 139 | }, 140 | files: { 141 | "dist/index.html": "dist/index.html", 142 | "dist/contactus.html": "dist/contactus.html", 143 | "dist/aboutus.html": "dist/aboutus.html" 144 | } 145 | } 146 | } 147 | }); 148 | grunt.registerTask("css", ["sass"]); 149 | grunt.registerTask("default", ["browserSync", "watch"]); 150 | grunt.registerTask("build", [ 151 | "clean", 152 | "copy", 153 | "imagemin", 154 | "useminPrepare", 155 | "concat", 156 | "cssmin", 157 | "uglify", 158 | "filerev", 159 | "usemin", 160 | "htmlmin" 161 | ]); 162 | }; 163 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Week1_Assignment/extralarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/Week1_Assignment/extralarge.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Week1_Assignment/extrasmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/Week1_Assignment/extrasmall.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Week2_Assignment/screenshot_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/Week2_Assignment/screenshot_index.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Week3_Assignment/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/Week3_Assignment/screenshot.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/Week4_Assignment/styles.scss: -------------------------------------------------------------------------------- 1 | $lt-gray: #ddd; 2 | $background-dark: #512da8; 3 | $background-light: #9575cd; 4 | $background-pale: #d1c4e9; 5 | 6 | //Height variables 7 | $carousel-item-height: 300px; 8 | 9 | @mixin zero-margin($pad-up-dn, $pad-left-right) { 10 | margin: 0px auto; 11 | padding: $pad-up-dn $pad-left-right; 12 | } 13 | 14 | .row-header { 15 | @include zero-margin(0px, 0px); 16 | } 17 | 18 | .row-content { 19 | @include zero-margin(50px, 0px); 20 | border-bottom: 1px ridge; 21 | min-height: 400px; 22 | } 23 | 24 | .footer { 25 | background-color: $background-pale; 26 | @include zero-margin(20px, 0px); 27 | } 28 | 29 | .jumbotron { 30 | @include zero-margin(70px, 30px); 31 | background: $background-light; 32 | color: floralwhite; 33 | } 34 | 35 | address { 36 | font-size: 80%; 37 | margin: 0px; 38 | color: #0f0f0f; 39 | } 40 | 41 | body { 42 | padding: 50px 0px 0px 0px; 43 | z-index: 0; 44 | } 45 | 46 | .navbar-dark { 47 | background-color: $background-dark; 48 | } 49 | 50 | .tab-content { 51 | border-left: 1px solid $lt-gray; 52 | border-right: 1px solid $lt-gray; 53 | border-bottom: 1px solid $lt-gray; 54 | padding: 10px; 55 | } 56 | 57 | .carousel { 58 | background: $background-dark; 59 | 60 | .carousel-item { 61 | height: $carousel-item-height; 62 | 63 | img { 64 | position: absolute; 65 | top: 0px; 66 | left: 0px; 67 | min-height: 300px; 68 | } 69 | } 70 | } 71 | 72 | #carouselButton { 73 | right: 0px; 74 | position: absolute; 75 | bottom: 0px; 76 | } 77 | 78 | .modal-header { 79 | background-color: $background-dark; 80 | 81 | h4 { 82 | color: floralwhite; 83 | } 84 | 85 | button { 86 | color: floralwhite; 87 | } 88 | } 89 | 90 | .modal-body { 91 | background-color: $background-pale; 92 | } 93 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/._aboutus.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/._aboutus.html -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/._contactus.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/._contactus.html -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/._img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/._img -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/img/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx ATTRxx -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/img/._alberto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/img/._alberto.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/img/._buffet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/img/._buffet.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/img/._logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/img/._logo.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/__MACOSX/img/._uthappizza.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/__MACOSX/img/._uthappizza.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/css/styles-old.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: #d1c4e9; 15 | margin: 0px auto; 16 | padding: 20px 0px 20px 0px; 17 | } 18 | 19 | .jumbotron { 20 | padding: 70px 30px 70px 30px; 21 | margin: 0px auto; 22 | background: #9575cd; 23 | color: floralwhite; 24 | } 25 | 26 | .address { 27 | font-size: 80%; 28 | margin: 0px; 29 | color: #0f0f0f; 30 | } 31 | 32 | body { 33 | padding: 50px 0px 0px 0px; 34 | z-index: 0; 35 | } 36 | 37 | .navbar-dark { 38 | background-color: #512da8; 39 | } 40 | 41 | .tab-content { 42 | border-left: 1px solid #ddd; 43 | border-right: 1px solid #ddd; 44 | border-bottom: 1px solid #ddd; 45 | padding: 10px; 46 | } 47 | 48 | .carousel { 49 | background: #512da8; 50 | } 51 | 52 | .carousel-item { 53 | height: 300px; 54 | } 55 | 56 | .carousel-item img { 57 | position: absolute; 58 | top: 0; 59 | left: 0; 60 | min-height: 300px; 61 | } 62 | 63 | #carouselButton { 64 | right: 0px; 65 | position: absolute; 66 | bottom: 0px; 67 | z-index: 1; 68 | } 69 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/css/styles.css: -------------------------------------------------------------------------------- 1 | .row-header { 2 | margin: 0px auto; 3 | padding: 0px 0px; } 4 | 5 | .row-content { 6 | margin: 0px auto; 7 | padding: 50px 0px; 8 | border-bottom: 1px ridge; 9 | min-height: 400px; } 10 | 11 | .footer { 12 | background-color: #d1c4e9; 13 | margin: 0px auto; 14 | padding: 20px 0px; } 15 | 16 | .jumbotron { 17 | margin: 0px auto; 18 | padding: 70px 30px; 19 | background: #9575cd; 20 | color: floralwhite; } 21 | 22 | address { 23 | font-size: 80%; 24 | margin: 0px; 25 | color: #0f0f0f; } 26 | 27 | body { 28 | padding: 50px 0px 0px 0px; 29 | z-index: 0; } 30 | 31 | .navbar-dark { 32 | background-color: #512da8; } 33 | 34 | .tab-content { 35 | border-left: 1px solid #ddd; 36 | border-right: 1px solid #ddd; 37 | border-bottom: 1px solid #ddd; 38 | padding: 10px; } 39 | 40 | .carousel { 41 | background: #512da8; } 42 | .carousel .carousel-item { 43 | height: 300px; } 44 | .carousel .carousel-item img { 45 | position: absolute; 46 | top: 0px; 47 | left: 0px; 48 | min-height: 300px; } 49 | 50 | #carouselButton { 51 | right: 0px; 52 | position: absolute; 53 | bottom: 0px; } 54 | 55 | .modal-header { 56 | background-color: #512da8; } 57 | .modal-header h4 { 58 | color: floralwhite; } 59 | .modal-header button { 60 | color: floralwhite; } 61 | 62 | .modal-body { 63 | background-color: #d1c4e9; } 64 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/css/styles.less: -------------------------------------------------------------------------------- 1 | @lt-gray: #ddd; 2 | @background-dark: #512da8; 3 | @background-light: #9575cd; 4 | @background-pale: #d1c4e9; 5 | 6 | //Height variables 7 | @carousel-item-height: 300px; 8 | 9 | .zero-margin(@pad-up-dn:0px,@pad-left-right:0px) { 10 | margin: 0px auto; 11 | padding: @pad-up-dn @pad-left-right; 12 | } 13 | 14 | .row-header { 15 | .zero-margin(); 16 | } 17 | 18 | .row-content { 19 | .zero-margin(50px, 0px); 20 | border-bottom: 1px ridge; 21 | min-height: 400px; 22 | } 23 | 24 | .footer { 25 | background-color: @background-pale; 26 | .zero-margin(20px, 0px); 27 | } 28 | 29 | .jumbotron { 30 | .zero-margin(70px, 30px); 31 | background: @background-light; 32 | color: floralwhite; 33 | } 34 | 35 | address { 36 | font-size: 80%; 37 | margin: 0px; 38 | color: #0f0f0f; 39 | } 40 | 41 | body { 42 | padding: 50px 0px 0px 0px; 43 | z-index: 0; 44 | } 45 | 46 | .navbar-dark { 47 | background-color: @background-dark; 48 | } 49 | 50 | .tab-content { 51 | border-left: 1px solid @lt-gray; 52 | border-right: 1px solid @lt-gray; 53 | border-bottom: 1px solid @lt-gray; 54 | padding: 10px; 55 | } 56 | 57 | .carousel { 58 | background: @background-dark; 59 | 60 | .carousel-item { 61 | height: @carousel-item-height; 62 | 63 | img { 64 | position: absolute; 65 | top: 0px; 66 | left: 0px; 67 | min-height: 300px; 68 | } 69 | } 70 | } 71 | 72 | #carouselButton { 73 | right: 0px; 74 | position: absolute; 75 | bottom: 0px; 76 | } 77 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/css/styles.scss: -------------------------------------------------------------------------------- 1 | $lt-gray: #ddd; 2 | $background-dark: #512da8; 3 | $background-light: #9575cd; 4 | $background-pale: #d1c4e9; 5 | 6 | //Height variables 7 | $carousel-item-height: 300px; 8 | 9 | @mixin zero-margin($pad-up-dn, $pad-left-right) { 10 | margin: 0px auto; 11 | padding: $pad-up-dn $pad-left-right; 12 | } 13 | 14 | .row-header { 15 | @include zero-margin(0px, 0px); 16 | } 17 | 18 | .row-content { 19 | @include zero-margin(50px, 0px); 20 | border-bottom: 1px ridge; 21 | min-height: 400px; 22 | } 23 | 24 | .footer { 25 | background-color: $background-pale; 26 | @include zero-margin(20px, 0px); 27 | } 28 | 29 | .jumbotron { 30 | @include zero-margin(70px, 30px); 31 | background: $background-light; 32 | color: floralwhite; 33 | } 34 | 35 | address { 36 | font-size: 80%; 37 | margin: 0px; 38 | color: #0f0f0f; 39 | } 40 | 41 | body { 42 | padding: 50px 0px 0px 0px; 43 | z-index: 0; 44 | } 45 | 46 | .navbar-dark { 47 | background-color: $background-dark; 48 | } 49 | 50 | .tab-content { 51 | border-left: 1px solid $lt-gray; 52 | border-right: 1px solid $lt-gray; 53 | border-bottom: 1px solid $lt-gray; 54 | padding: 10px; 55 | } 56 | 57 | .carousel { 58 | background: $background-dark; 59 | 60 | .carousel-item { 61 | height: $carousel-item-height; 62 | 63 | img { 64 | position: absolute; 65 | top: 0px; 66 | left: 0px; 67 | min-height: 300px; 68 | } 69 | } 70 | } 71 | 72 | #carouselButton { 73 | right: 0px; 74 | position: absolute; 75 | bottom: 0px; 76 | } 77 | 78 | .modal-header { 79 | background-color: $background-dark; 80 | 81 | h4 { 82 | color: floralwhite; 83 | } 84 | 85 | button { 86 | color: floralwhite; 87 | } 88 | } 89 | 90 | .modal-body { 91 | background-color: $background-pale; 92 | } 93 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/img/.DS_Store -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/img/alberto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/img/alberto.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/img/buffet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/img/buffet.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/img/logo.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/img/uthappizza.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/Bootstrap4/conFusion/img/uthappizza.png -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/js/scripts.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#mycarousel").carousel({ interval: 2000 }); 3 | $("#carouselButton").click(function() { 4 | if ( 5 | $("#carouselButton") 6 | .children("span") 7 | .hasClass("fa-pause") 8 | ) { 9 | $("#mycarousel").carousel("pause"); 10 | $("#carouselButton") 11 | .children("span") 12 | .removeClass("fa-pause"); 13 | $("#carouselButton") 14 | .children("span") 15 | .addClass("fa-play"); 16 | } else { 17 | $("#mycarousel").carousel("cycle"); 18 | $("#carouselButton") 19 | .children("span") 20 | .removeClass("fa-play"); 21 | $("#carouselButton") 22 | .children("span") 23 | .addClass("fa-pause"); 24 | } 25 | }); 26 | $("#reserveButton").click(function() { 27 | $("#reserveModal").modal("show"); 28 | }); 29 | $("#loginButton").click(function() { 30 | $("#loginModal").modal("show"); 31 | }); 32 | }); 33 | //JavaScript File 34 | -------------------------------------------------------------------------------- /Course1/Bootstrap4/conFusion/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "confusion", 3 | "version": "1.0.0", 4 | "description": "This is a website for Ristorante Con Fusion", 5 | "main": "index.html", 6 | "scripts": { 7 | "start": "npm run watch:all", 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "lite": "lite-server", 10 | "scss": "node-sass -o css/ css/", 11 | "watch:scss": "onchange \"css/*.scss\" -- npm run scss", 12 | "watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\"", 13 | "clean": "rimraf dist", 14 | "copyfonts": "copyfiles -f node_modules/font-awesome/fonts/* dist/fonts", 15 | "imagemin": "imagemin img/* --out-dir=dist/img", 16 | "usemin": "usemin contactus.html -d dist --htmlmin -o dist/contactus.html & usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin index.html -d dist --htmlmin -o dist/index.html", 17 | "build": "npm run clean && npm run copyfonts && npm run imagemin && npm run usemin" 18 | }, 19 | "author": "", 20 | "license": "ISC", 21 | "devDependencies": { 22 | "cssmin": "^0.4.3", 23 | "grunt": "^1.0.2", 24 | "grunt-browser-sync": "^2.2.0", 25 | "grunt-contrib-clean": "^1.1.0", 26 | "grunt-contrib-copy": "^1.0.0", 27 | "grunt-contrib-imagemin": "^2.0.1", 28 | "grunt-contrib-watch": "^1.0.0", 29 | "grunt-sass": "^2.1.0", 30 | "gulp": "^3.9.1", 31 | "htmlmin": "0.0.7", 32 | "jit-grunt": "^0.10.0", 33 | "lite-server": "^2.5.4", 34 | "node-sass": "^4.12.0", 35 | "onchange": "^6.1.0", 36 | "parallelshell": "^3.0.1", 37 | "time-grunt": "^1.4.0", 38 | "uglifyjs": "^2.4.11", 39 | "usemin-cli": "^0.5.1" 40 | }, 41 | "dependencies": { 42 | "bootstrap": "^4.0.0", 43 | "bootstrap-social": "^5.1.1", 44 | "font-awesome": "^4.7.0", 45 | "grunt-contrib-concat": "^1.0.1", 46 | "grunt-contrib-cssmin": "^2.2.1", 47 | "grunt-contrib-htmlmin": "^2.4.0", 48 | "grunt-contrib-uglify": "^3.3.0", 49 | "grunt-filerev": "^2.3.1", 50 | "grunt-usemin": "^3.1.1", 51 | "jquery": "^3.3.1", 52 | "popper.js": "^1.12.9", 53 | "rimraf": "^3.0.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Course1/__MACOSX/._Bootstrap4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/__MACOSX/._Bootstrap4 -------------------------------------------------------------------------------- /Course1/__MACOSX/Bootstrap4/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx ATTRxx -------------------------------------------------------------------------------- /Course1/__MACOSX/Bootstrap4/._conFusion: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/__MACOSX/Bootstrap4/._conFusion -------------------------------------------------------------------------------- /Course1/__MACOSX/Bootstrap4/conFusion/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx ATTRxx -------------------------------------------------------------------------------- /Course1/__MACOSX/Bootstrap4/conFusion/._index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/__MACOSX/Bootstrap4/conFusion/._index.html -------------------------------------------------------------------------------- /Course1/__MACOSX/Bootstrap4/conFusion/._package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course1/__MACOSX/Bootstrap4/conFusion/._package.json -------------------------------------------------------------------------------- /Course1/git-test/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Course1/git-test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

This is a Header

7 |

This is paragraph

8 |

This is second paragraph

9 |

This is third paragraph

10 | 11 | 12 | -------------------------------------------------------------------------------- /Course1/git-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "git-test", 3 | "version": "1.0.0", 4 | "description": "The test project to learn first course", 5 | "main": "index.html", 6 | "scripts": { 7 | "start": "npm run lite", 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "lite": "lite-server" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/ashutosh1919/Full_Stack_Web_Development_Course.git" 14 | }, 15 | "author": "Ashutosh Hathidara", 16 | "license": "ISC", 17 | "bugs": { 18 | "url": "https://github.com/ashutosh1919/Full_Stack_Web_Development_Course/issues" 19 | }, 20 | "homepage": "https://github.com/ashutosh1919/Full_Stack_Web_Development_Course#readme" 21 | } 22 | -------------------------------------------------------------------------------- /Course2/React/Week1_Assignment/DishdetailComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { 3 | Card, 4 | CardImg, 5 | CardImgOverlay, 6 | CardText, 7 | CardBody, 8 | CardTitle 9 | } from "reactstrap"; 10 | 11 | class DishdetailComponent extends Component { 12 | constructor(props) { 13 | super(props); 14 | } 15 | 16 | render() { 17 | if (this.props.selectedDish != null) { 18 | var dish = this.props.selectedDish; 19 | return ( 20 |
21 | 22 | 23 | 24 | {dish.name} 25 | {dish.description} 26 | 27 | 28 |
29 | ); 30 | } else { 31 | return
; 32 | } 33 | } 34 | } 35 | 36 | export default DishdetailComponent; 37 | -------------------------------------------------------------------------------- /Course2/React/Week1_Assignment/MenuComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { 3 | Card, 4 | CardImg, 5 | CardImgOverlay, 6 | CardText, 7 | CardBody, 8 | CardTitle 9 | } from "reactstrap"; 10 | 11 | import DishdetailComponent from "./DishdetailComponent"; 12 | 13 | class Menu extends Component { 14 | constructor(props) { 15 | super(props); 16 | 17 | this.state = { 18 | selectedDish: null 19 | }; 20 | } 21 | 22 | onDishSelect(dish) { 23 | this.setState({ selectedDish: dish }); 24 | } 25 | 26 | renderDish(dish) { 27 | if (dish != null) { 28 | return ( 29 | 30 | 31 | 32 | {dish.name} 33 | {dish.description} 34 | 35 | 36 | ); 37 | } else { 38 | return
; 39 | } 40 | } 41 | 42 | renderComments(dish) { 43 | var comments; 44 | if (dish != null) { 45 | comments = dish.comments; 46 | } else { 47 | comments = null; 48 | } 49 | if (comments != null) { 50 | const coms = comments.map(com => { 51 | return ( 52 |
53 |
54 |

{com.comment}

55 |
56 |
57 |

-- {com.author}

58 |
59 |
60 | ); 61 | }); 62 | return ( 63 |
64 |

Comments

65 |
{coms}
66 |
67 | ); 68 | } else { 69 | return
; 70 | } 71 | } 72 | 73 | render() { 74 | const menu = this.props.dishes.map(dish => { 75 | return ( 76 |
77 | this.onDishSelect(dish)}> 78 | 79 | 80 | {dish.name} 81 | 82 | 83 |
84 | ); 85 | }); 86 | return ( 87 |
88 |
{menu}
89 |
90 |
91 | 94 |
95 |
96 | {this.renderComments(this.state.selectedDish)} 97 |
98 |
99 |
100 | ); 101 | } 102 | } 103 | 104 | export default Menu; 105 | -------------------------------------------------------------------------------- /Course2/React/Week2_Assignment/AboutusComponent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Breadcrumb, 4 | BreadcrumbItem, 5 | Card, 6 | CardBody, 7 | CardHeader, 8 | Media 9 | } from "reactstrap"; 10 | import { Link } from "react-router-dom"; 11 | 12 | function RenderLeader({ leader }) { 13 | if (leader != null) { 14 | return ( 15 | 16 | 17 | 18 | 19 | 20 | {leader.name} 21 |

{leader.designation}

22 |

{leader.description}

23 |
24 |
25 | ); 26 | } else { 27 | return
; 28 | } 29 | } 30 | 31 | function About(props) { 32 | const leaders = props.leaders.map(leader => { 33 | return ( 34 |
35 | 36 |
37 | ); 38 | }); 39 | 40 | return ( 41 |
42 |
43 | 44 | 45 | Home 46 | 47 | About Us 48 | 49 |
50 |

About Us

51 |
52 |
53 |
54 |
55 |
56 |

Our History

57 |

58 | Started in 2010, Ristorante con Fusion quickly established itself as 59 | a culinary icon par excellence in Hong Kong. With its unique brand 60 | of world fusion cuisine that can be found nowhere else, it enjoys 61 | patronage from the A-list clientele in Hong Kong. Featuring four of 62 | the best three-star Michelin chefs in the world, you never know what 63 | will arrive on your plate the next time you visit us. 64 |

65 |

66 | The restaurant traces its humble beginnings to{" "} 67 | The Frying Pan, a successful chain started by our CEO, Mr. 68 | Peter Pan, that featured for the first time the world's best 69 | cuisines in a pan. 70 |

71 |
72 |
73 | 74 | 75 | Facts At a Glance 76 | 77 | 78 |
79 |
Started
80 |
3 Feb. 2013
81 |
Major Stake Holder
82 |
HK Fine Foods Inc.
83 |
Last Year's Turnover
84 |
$1,250,375
85 |
Employees
86 |
40
87 |
88 |
89 |
90 |
91 |
92 | 93 | 94 |
95 |

96 | You better cut the pizza in four pieces because I'm not hungry 97 | enough to eat six. 98 |

99 |
100 | Yogi Berra, 101 | 102 | The Wit and Wisdom of Yogi Berra, P. Pepe, Diversion Books, 103 | 2014 104 | 105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |

Corporate Leadership

114 |
115 |
116 |
117 | {leaders} 118 |
119 |
120 |
121 |
122 | ); 123 | } 124 | 125 | export default About; 126 | -------------------------------------------------------------------------------- /Course2/React/Week2_Assignment/MainComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Menu from "./MenuComponent"; 3 | import { DISHES } from "../shared/dishes"; 4 | import { COMMENTS } from "../shared/comments"; 5 | import { LEADERS } from "../shared/leaders"; 6 | import { PROMOTIONS } from "../shared/promotions"; 7 | import DishdetailComponent from "./DishdetailComponent"; 8 | import Header from "./HeaderComponent"; 9 | import Footer from "./FooterComponent"; 10 | import Home from "./HomeComponent"; 11 | import { Switch, Route, Redirect } from "react-router-dom"; 12 | import Contact from "./ContactComponent"; 13 | import About from "./AboutusComponent"; 14 | 15 | class Main extends Component { 16 | constructor(props) { 17 | super(props); 18 | 19 | this.state = { 20 | dishes: DISHES, 21 | comments: COMMENTS, 22 | promotions: PROMOTIONS, 23 | leaders: LEADERS 24 | }; 25 | } 26 | 27 | render() { 28 | const HomePage = () => { 29 | return ( 30 | dish.featured)[0]} 32 | promotion={this.state.promotions.filter(promo => promo.featured)[0]} 33 | leader={this.state.leaders.filter(leader => leader.featured)[0]} 34 | /> 35 | ); 36 | }; 37 | 38 | const DishWithId = ({ match }) => { 39 | return ( 40 | dish.id === parseInt(match.params.dishId, 10) 44 | )[0] 45 | } 46 | comments={this.state.comments.filter( 47 | comment => comment.dishId === parseInt(match.params.dishId, 10) 48 | )} 49 | /> 50 | ); 51 | }; 52 | 53 | return ( 54 |
55 |
56 | 57 | 58 | } 62 | /> 63 | 64 | } 68 | /> 69 | 70 | 71 | 72 | {/* this.onDishSelect(dishId)} 75 | /> 76 | dish.id === this.state.selectedDish 80 | )[0] 81 | } 82 | /> */} 83 |
84 |
85 | ); 86 | } 87 | } 88 | 89 | export default Main; 90 | -------------------------------------------------------------------------------- /Course2/React/Week3_Assignment/DishdetailComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { 3 | Card, 4 | CardImg, 5 | CardImgOverlay, 6 | CardText, 7 | CardBody, 8 | CardTitle, 9 | Breadcrumb, 10 | BreadcrumbItem, 11 | Button, 12 | Modal, 13 | ModalHeader, 14 | ModalBody, 15 | Col, 16 | Label, 17 | Row 18 | } from "reactstrap"; 19 | import { Link } from "react-router-dom"; 20 | import { LocalForm, Control, Errors } from "react-redux-form"; 21 | 22 | const required = val => val && val.length; 23 | const maxLength = len => val => !val || val.length <= len; 24 | const minLength = len => val => !val || val.length >= len; 25 | 26 | class CommentForm extends Component { 27 | constructor(props) { 28 | super(props); 29 | this.state = { 30 | isModalOpen: false 31 | }; 32 | this.toggleModal = this.toggleModal.bind(this); 33 | this.handleSubmit = this.handleSubmit.bind(this); 34 | } 35 | toggleModal() { 36 | this.setState({ 37 | isModalOpen: !this.state.isModalOpen 38 | }); 39 | } 40 | handleSubmit(values) { 41 | this.toggleModal(); 42 | alert(JSON.stringify(values)); 43 | // event.preventDefault(); 44 | } 45 | render() { 46 | return ( 47 |
48 | 51 | 52 | Submit Comment 53 | 54 | this.handleSubmit(values)}> 55 | 56 | 59 | 60 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 77 | 78 | 90 | 100 | 101 | 102 | 103 | 106 | 107 | 114 | 115 | 116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | ); 128 | } 129 | } 130 | 131 | // THIS IS START OF DISH DETAIL 132 | 133 | function RenderDish({ dish }) { 134 | return ( 135 | 136 | 137 | 138 | {dish.name} 139 | {dish.description} 140 | 141 | 142 | ); 143 | } 144 | 145 | function RenderComments({ comments }) { 146 | if (comments != null) { 147 | const coms = comments.map(com => { 148 | return ( 149 |
150 |
151 |

{com.comment}

152 |
153 |
154 |

155 | -- {com.author}, 156 | {new Intl.DateTimeFormat("en-US", { 157 | year: "numeric", 158 | month: "short", 159 | day: "2-digit" 160 | }).format(new Date(Date.parse(com.date)))} 161 |

162 |
163 |
164 | ); 165 | }); 166 | return ( 167 |
168 |

Comments

169 |
{coms}
170 | 171 |
172 | ); 173 | } else { 174 | return
; 175 | } 176 | } 177 | 178 | const DishdetailComponent = props => { 179 | if (props.dish != null) { 180 | var dish = props.selectedDish; 181 | return ( 182 |
183 |
184 | 185 | 186 | Menu 187 | 188 | {props.dish.name} 189 | 190 |
191 |

{props.dish.name}

192 |
193 |
194 |
195 |
196 |
197 | 198 |
199 |
200 | 201 |
202 |
203 |
204 | ); 205 | } else { 206 | return
; 207 | } 208 | }; 209 | 210 | export default DishdetailComponent; 211 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/AboutusComponent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Breadcrumb, 4 | BreadcrumbItem, 5 | Card, 6 | CardBody, 7 | CardHeader, 8 | Media 9 | } from "reactstrap"; 10 | import { Link } from "react-router-dom"; 11 | import { baseUrl } from "../shared/baseUrl"; 12 | import { Loading } from "./LoadingComponent"; 13 | import { Fade, Stagger } from "react-animation-components"; 14 | 15 | function RenderLeader({ leader }) { 16 | if (leader != null) { 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | {leader.name} 24 |

{leader.designation}

25 |

{leader.description}

26 |
27 |
28 | ); 29 | } else { 30 | return
; 31 | } 32 | } 33 | 34 | function About(props) { 35 | function RenderContent({ leaders, isLoading, errMess }) { 36 | if (isLoading) { 37 | return ; 38 | } else if (errMess) { 39 | return

{errMess}

; 40 | } else 41 | return ( 42 | 43 | {props.leaders.map(leader => ( 44 | 45 | 46 | 47 | ))} 48 | 49 | ); 50 | } 51 | 52 | const leaders = props.leaders.map(leader => { 53 | return ( 54 |
55 | 56 |
57 | ); 58 | }); 59 | 60 | return ( 61 |
62 |
63 | 64 | 65 | Home 66 | 67 | About Us 68 | 69 |
70 |

About Us

71 |
72 |
73 |
74 |
75 |
76 |

Our History

77 |

78 | Started in 2010, Ristorante con Fusion quickly established itself as 79 | a culinary icon par excellence in Hong Kong. With its unique brand 80 | of world fusion cuisine that can be found nowhere else, it enjoys 81 | patronage from the A-list clientele in Hong Kong. Featuring four of 82 | the best three-star Michelin chefs in the world, you never know what 83 | will arrive on your plate the next time you visit us. 84 |

85 |

86 | The restaurant traces its humble beginnings to{" "} 87 | The Frying Pan, a successful chain started by our CEO, Mr. 88 | Peter Pan, that featured for the first time the world's best 89 | cuisines in a pan. 90 |

91 |
92 |
93 | 94 | 95 | Facts At a Glance 96 | 97 | 98 |
99 |
Started
100 |
3 Feb. 2013
101 |
Major Stake Holder
102 |
HK Fine Foods Inc.
103 |
Last Year's Turnover
104 |
$1,250,375
105 |
Employees
106 |
40
107 |
108 |
109 |
110 |
111 |
112 | 113 | 114 |
115 |

116 | You better cut the pizza in four pieces because I'm not hungry 117 | enough to eat six. 118 |

119 |
120 | Yogi Berra, 121 | 122 | The Wit and Wisdom of Yogi Berra, P. Pepe, Diversion Books, 123 | 2014 124 | 125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |

Corporate Leadership

134 |
135 |
136 |
137 | 138 | 143 | 144 |
145 |
146 |
147 |
148 | ); 149 | } 150 | 151 | export default About; 152 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/ActionCreators.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | import { baseUrl } from "../shared/baseUrl"; 3 | 4 | export const addComment = comment => ({ 5 | type: ActionTypes.ADD_COMMENT, 6 | payload: comment 7 | }); 8 | 9 | export const postComment = (dishId, rating, author, comment) => dispatch => { 10 | const newComment = { 11 | dishId: dishId, 12 | rating: rating, 13 | author: author, 14 | comment: comment 15 | }; 16 | newComment.date = new Date().toISOString(); 17 | return fetch(baseUrl + "comments", { 18 | method: "POST", 19 | body: JSON.stringify(newComment), 20 | headers: { 21 | "Content-Type": "application/json" 22 | }, 23 | credentials: "same-origin" 24 | }) 25 | .then( 26 | response => { 27 | if (response.ok) { 28 | return response; 29 | } else { 30 | var error = new Error( 31 | "Error " + response.status + ": " + response.statusText 32 | ); 33 | error.response = response; 34 | throw error; 35 | } 36 | }, 37 | error => { 38 | var errmess = new Error(error.message); 39 | throw errmess; 40 | } 41 | ) 42 | .then(response => response.json()) 43 | .then(response => dispatch(addComment(response))) 44 | .catch(error => { 45 | console.log("Post Comments ", error.message); 46 | alert("Your comment could not be posted\nError: " + error.message); 47 | }); 48 | }; 49 | 50 | export const fetchDishes = () => dispatch => { 51 | dispatch(dishesLoading(true)); 52 | return fetch(baseUrl + "dishes") 53 | .then( 54 | response => { 55 | if (response.ok) { 56 | return response; 57 | } else { 58 | var error = new Error( 59 | "Error " + response.status + ": " + response.statusText 60 | ); 61 | error.response = response; 62 | throw error; 63 | } 64 | }, 65 | error => { 66 | var errmess = new Error(error.message); 67 | throw errmess; 68 | } 69 | ) 70 | .then(response => response.json()) 71 | .then(dishes => dispatch(addDishes(dishes))) 72 | .catch(error => dispatch(dishesFailed(error.message))); 73 | }; 74 | 75 | export const dishesLoading = () => ({ 76 | type: ActionTypes.DISHES_LOADING 77 | }); 78 | 79 | export const dishesFailed = errmess => ({ 80 | type: ActionTypes.DISHES_FAILED, 81 | payload: errmess 82 | }); 83 | 84 | export const addDishes = dishes => ({ 85 | type: ActionTypes.ADD_DISHES, 86 | payload: dishes 87 | }); 88 | 89 | export const fetchComments = () => dispatch => { 90 | return fetch(baseUrl + "comments") 91 | .then( 92 | response => { 93 | if (response.ok) { 94 | return response; 95 | } else { 96 | var error = new Error( 97 | "Error " + response.status + ": " + response.statusText 98 | ); 99 | error.response = response; 100 | throw error; 101 | } 102 | }, 103 | error => { 104 | var errmess = new Error(error.message); 105 | throw errmess; 106 | } 107 | ) 108 | .then(response => response.json()) 109 | .then(comments => dispatch(addComments(comments))) 110 | .catch(error => dispatch(commentsFailed(error.message))); 111 | }; 112 | 113 | export const commentsFailed = errmess => ({ 114 | type: ActionTypes.COMMENTS_FAILED, 115 | payload: errmess 116 | }); 117 | 118 | export const addComments = comments => ({ 119 | type: ActionTypes.ADD_COMMENTS, 120 | payload: comments 121 | }); 122 | 123 | export const fetchPromos = () => dispatch => { 124 | dispatch(promosLoading()); 125 | 126 | return fetch(baseUrl + "promotions") 127 | .then( 128 | response => { 129 | if (response.ok) { 130 | return response; 131 | } else { 132 | var error = new Error( 133 | "Error " + response.status + ": " + response.statusText 134 | ); 135 | error.response = response; 136 | throw error; 137 | } 138 | }, 139 | error => { 140 | var errmess = new Error(error.message); 141 | throw errmess; 142 | } 143 | ) 144 | .then(response => response.json()) 145 | .then(promos => dispatch(addPromos(promos))) 146 | .catch(error => dispatch(promosFailed(error.message))); 147 | }; 148 | 149 | export const promosLoading = () => ({ 150 | type: ActionTypes.PROMOS_LOADING 151 | }); 152 | 153 | export const promosFailed = errmess => ({ 154 | type: ActionTypes.PROMOS_FAILED, 155 | payload: errmess 156 | }); 157 | 158 | export const addPromos = promos => ({ 159 | type: ActionTypes.ADD_PROMOS, 160 | payload: promos 161 | }); 162 | 163 | export const fetchLeaders = () => dispatch => { 164 | dispatch(leadersLoading()); 165 | 166 | return fetch(baseUrl + "leaders") 167 | .then( 168 | response => { 169 | if (response.ok) { 170 | return response; 171 | } else { 172 | var error = new Error( 173 | "Error " + response.status + ": " + response.statusText 174 | ); 175 | error.response = response; 176 | throw error; 177 | } 178 | }, 179 | error => { 180 | var errmess = new Error(error.message); 181 | throw errmess; 182 | } 183 | ) 184 | .then(response => response.json()) 185 | .then(leaders => dispatch(addLeaders(leaders))) 186 | .catch(error => dispatch(leadersFailed(error.message))); 187 | }; 188 | export const leadersLoading = () => ({ 189 | type: ActionTypes.LEADERS_LOADING 190 | }); 191 | 192 | export const leadersFailed = errmess => ({ 193 | type: ActionTypes.LEADERS_FAILED, 194 | payload: errmess 195 | }); 196 | 197 | export const addLeaders = leaders => ({ 198 | type: ActionTypes.ADD_LEADERS, 199 | payload: leaders 200 | }); 201 | 202 | export const postFeedback = ( 203 | firstname, 204 | lastname, 205 | telnum, 206 | email, 207 | agree, 208 | contactType, 209 | message 210 | ) => dispatch => { 211 | const newFeedback = { 212 | firstname: firstname, 213 | lastname: lastname, 214 | telnum: telnum, 215 | email: email, 216 | agree: agree, 217 | contactType: contactType, 218 | message: message 219 | }; 220 | 221 | return fetch(baseUrl + "feedback", { 222 | method: "POST", 223 | body: JSON.stringify(newFeedback), 224 | headers: { 225 | "Content-Type": "application/json" 226 | }, 227 | credentials: "same-origin" 228 | }) 229 | .then( 230 | response => { 231 | if (response.ok) { 232 | return response; 233 | } else { 234 | var error = new Error( 235 | "Error " + response.status + ": " + response.statusText 236 | ); 237 | error.response = response; 238 | throw error; 239 | } 240 | }, 241 | error => { 242 | throw error; 243 | } 244 | ) 245 | .then(response => response.json()) 246 | .then(response => 247 | alert("Thank you for your feedback!" + JSON.stringify(response)) 248 | ) 249 | .catch(error => { 250 | console.log("post feedbacks", error.message); 251 | alert("Your feedback could not be posted\nError: " + error.message); 252 | }); 253 | }; 254 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/ActionTypes.js: -------------------------------------------------------------------------------- 1 | export const ADD_COMMENT = "ADD_COMMENT"; 2 | export const DISHES_LOADING = "DISHES_LOADING"; 3 | export const DISHES_FAILED = "DISHES_FAILED"; 4 | export const ADD_DISHES = "ADD_DISHES"; 5 | export const ADD_COMMENTS = "ADD_COMMENTS"; 6 | export const COMMENTS_FAILED = "COMMENTS_FAILED"; 7 | export const PROMOS_LOADING = "PROMOS_LOADING"; 8 | export const ADD_PROMOS = "ADD_PROMOS"; 9 | export const PROMOS_FAILED = "PROMOS_FAILED"; 10 | export const LEADERS_LOADING = "LEADERS_LOADING"; 11 | export const ADD_LEADERS = "ADD_LEADERS"; 12 | export const LEADERS_FAILED = "LEADERS_FAILED"; 13 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/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 | function RenderCard({ item, isLoading, errMess }) { 15 | if (isLoading) { 16 | return ; 17 | } else if (errMess) { 18 | return

{errMess}

; 19 | } else { 20 | return ( 21 | 27 | 28 | 29 | 30 | {item.name} 31 | {item.designation ? ( 32 | {item.designation} 33 | ) : null} 34 | {item.description} 35 | 36 | 37 | 38 | ); 39 | } 40 | } 41 | 42 | function Home(props) { 43 | return ( 44 |
45 |
46 |
47 | 52 |
53 |
54 | 59 |
60 |
61 | 66 |
67 |
68 |
69 | ); 70 | } 71 | 72 | export default Home; 73 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/MainComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Menu from "./MenuComponent"; 3 | import DishdetailComponent from "./DishdetailComponent"; 4 | import Header from "./HeaderComponent"; 5 | import Footer from "./FooterComponent"; 6 | import Home from "./HomeComponent"; 7 | import { Switch, Route, Redirect, withRouter } from "react-router-dom"; 8 | import { connect } from "react-redux"; 9 | import Contact from "./ContactComponent"; 10 | import About from "./AboutusComponent"; 11 | import { 12 | postComment, 13 | fetchDishes, 14 | fetchComments, 15 | fetchPromos, 16 | fetchLeaders, 17 | postFeedback 18 | } from "../redux/ActionCreators"; 19 | import { actions } from "react-redux-form"; 20 | import { TransitionGroup, CSSTransition } from "react-transition-group"; 21 | 22 | const mapStateToProps = state => { 23 | return { 24 | dishes: state.dishes, 25 | comments: state.comments, 26 | promotions: state.promotions, 27 | leaders: state.leaders 28 | }; 29 | }; 30 | 31 | const mapDispatchToProps = dispatch => ({ 32 | postComment: (dishId, rating, author, comment) => 33 | dispatch(postComment(dishId, rating, author, comment)), 34 | fetchDishes: () => { 35 | dispatch(fetchDishes()); 36 | }, 37 | resetFeedbackForm: () => { 38 | dispatch(actions.reset("feedback")); 39 | }, 40 | fetchComments: () => { 41 | dispatch(fetchComments()); 42 | }, 43 | fetchPromos: () => { 44 | dispatch(fetchPromos()); 45 | }, 46 | fetchLeaders: () => { 47 | dispatch(fetchLeaders()); 48 | }, 49 | postFeedback: ( 50 | firstname, 51 | lastname, 52 | telnum, 53 | email, 54 | agree, 55 | contactType, 56 | message 57 | ) => 58 | dispatch( 59 | postFeedback( 60 | firstname, 61 | lastname, 62 | telnum, 63 | email, 64 | agree, 65 | contactType, 66 | message 67 | ) 68 | ) 69 | }); 70 | 71 | class Main extends Component { 72 | constructor(props) { 73 | super(props); 74 | } 75 | 76 | componentDidMount() { 77 | this.props.fetchDishes(); 78 | this.props.fetchComments(); 79 | this.props.fetchPromos(); 80 | this.props.fetchLeaders(); 81 | } 82 | 83 | render() { 84 | const HomePage = () => { 85 | return ( 86 | dish.featured)[0]} 88 | dishesLoading={this.props.dishes.isLoading} 89 | dishesErrMess={this.props.dishes.errMess} 90 | promotion={ 91 | this.props.promotions.promotions.filter(promo => promo.featured)[0] 92 | } 93 | promosLoading={this.props.promotions.isLoading} 94 | promosErrMess={this.props.promotions.errMess} 95 | leader={ 96 | this.props.leaders.leaders.filter(leader => leader.featured)[0] 97 | } 98 | leaderLoading={this.props.leaders.isLoading} 99 | leaderErrMess={this.props.leaders.errMess} 100 | /> 101 | ); 102 | }; 103 | 104 | const DishWithId = ({ match }) => { 105 | return ( 106 | dish.id === parseInt(match.params.dishId, 10) 110 | )[0] 111 | } 112 | isLoading={this.props.dishes.isLoading} 113 | errMess={this.props.dishes.errMess} 114 | comments={this.props.comments.comments.filter( 115 | comment => comment.dishId === parseInt(match.params.dishId, 10) 116 | )} 117 | errMess={this.props.comments.errMess} 118 | postComment={this.props.postComment} 119 | /> 120 | ); 121 | }; 122 | 123 | return ( 124 |
125 |
126 | 127 | 132 | 133 | 134 | } 138 | /> 139 | 140 | ( 144 | 149 | )} 150 | /> 151 | ( 155 | 159 | )} 160 | /> 161 | 162 | 163 | {/* this.onDishSelect(dishId)} 166 | /> 167 | dish.id === this.state.selectedDish 171 | )[0] 172 | } 173 | /> */} 174 | 175 | 176 |
177 |
178 | ); 179 | } 180 | } 181 | 182 | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Main)); 183 | -------------------------------------------------------------------------------- /Course2/React/Week4_Assignment/leaders.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | 3 | export const Leaders = ( 4 | state = { 5 | isLoading: true, 6 | errMess: null, 7 | leaders: [] 8 | }, 9 | action 10 | ) => { 11 | switch (action.type) { 12 | case ActionTypes.ADD_LEADERS: 13 | return { 14 | ...state, 15 | isLoading: false, 16 | errMess: null, 17 | leaders: action.payload 18 | }; 19 | 20 | case ActionTypes.LEADERS_LOADING: 21 | return { ...state, isLoading: true, errMess: null, leaders: [] }; 22 | 23 | case ActionTypes.LEADERS_FAILED: 24 | return { ...state, isLoading: false, errMess: action.payload }; 25 | 26 | default: 27 | return state; 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /Course2/React/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 | -------------------------------------------------------------------------------- /Course2/React/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 | -------------------------------------------------------------------------------- /Course2/React/confusion/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "confusion", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "bootstrap": "4.0.0", 7 | "bootstrap-social": "5.1.1", 8 | "cross-fetch": "2.1.0", 9 | "font-awesome": "4.7.0", 10 | "prop-types": "15.6.0", 11 | "react": "^16.10.2", 12 | "react-animation-components": "3.0.0", 13 | "react-dom": "^16.10.2", 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.2.0", 19 | "react-transition-group": "2.3.0", 20 | "reactstrap": "5.0.0", 21 | "redux": "3.7.2", 22 | "redux-logger": "3.0.6", 23 | "redux-thunk": "2.2.0" 24 | }, 25 | "scripts": { 26 | "start": "react-scripts start", 27 | "build": "react-scripts build", 28 | "test": "react-scripts test", 29 | "eject": "react-scripts eject" 30 | }, 31 | "eslintConfig": { 32 | "extends": "react-app" 33 | }, 34 | "browserslist": { 35 | "production": [ 36 | ">0.2%", 37 | "not dead", 38 | "not op_mini all" 39 | ], 40 | "development": [ 41 | "last 1 chrome version", 42 | "last 1 firefox version", 43 | "last 1 safari version" 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/._images: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/._images -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx ATTRxx -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._alberto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._alberto.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._buffet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._buffet.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._elaicheesecake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._elaicheesecake.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._logo.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._uthappizza.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._uthappizza.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._vadonut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._vadonut.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/__MACOSX/images/._zucchipakoda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/__MACOSX/images/._zucchipakoda.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/alberto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/alberto.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/buffet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/buffet.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/elaicheesecake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/elaicheesecake.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/logo.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/uthappizza.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/uthappizza.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/vadonut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/vadonut.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/assets/images/zucchipakoda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/assets/images/zucchipakoda.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/favicon.ico -------------------------------------------------------------------------------- /Course2/React/confusion/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Course2/React/confusion/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/logo192.png -------------------------------------------------------------------------------- /Course2/React/confusion/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashutosh1919/Full_Stack_Web_Development_Course/3a8aeff235f37ddd4785ef1d7cfee0d63ae11e9f/Course2/React/confusion/public/logo512.png -------------------------------------------------------------------------------- /Course2/React/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 | -------------------------------------------------------------------------------- /Course2/React/confusion/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /Course2/React/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 | } -------------------------------------------------------------------------------- /Course2/React/confusion/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import "./App.css"; 3 | import Main from "./components/MainComponent"; 4 | import { BrowserRouter } from "react-router-dom"; 5 | import { Provider } from "react-redux"; 6 | import { ConfigureStore } from "./redux/configureStore"; 7 | 8 | const store = ConfigureStore(); 9 | 10 | class App extends Component { 11 | render() { 12 | return ( 13 | 14 | 15 |
16 |
17 |
18 |
19 |
20 | ); 21 | } 22 | } 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/components/AboutusComponent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Breadcrumb, 4 | BreadcrumbItem, 5 | Card, 6 | CardBody, 7 | CardHeader, 8 | Media 9 | } from "reactstrap"; 10 | import { Link } from "react-router-dom"; 11 | import { baseUrl } from "../shared/baseUrl"; 12 | import { Loading } from "./LoadingComponent"; 13 | import { Fade, Stagger } from "react-animation-components"; 14 | 15 | function RenderLeader({ leader }) { 16 | if (leader != null) { 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | {leader.name} 24 |

{leader.designation}

25 |

{leader.description}

26 |
27 |
28 | ); 29 | } else { 30 | return
; 31 | } 32 | } 33 | 34 | function About(props) { 35 | function RenderContent({ leaders, isLoading, errMess }) { 36 | if (isLoading) { 37 | return ; 38 | } else if (errMess) { 39 | return

{errMess}

; 40 | } else 41 | return ( 42 | 43 | {props.leaders.map(leader => ( 44 | 45 | 46 | 47 | ))} 48 | 49 | ); 50 | } 51 | 52 | return ( 53 |
54 |
55 | 56 | 57 | Home 58 | 59 | About Us 60 | 61 |
62 |

About Us

63 |
64 |
65 |
66 |
67 |
68 |

Our History

69 |

70 | Started in 2010, Ristorante con Fusion quickly established itself as 71 | a culinary icon par excellence in Hong Kong. With its unique brand 72 | of world fusion cuisine that can be found nowhere else, it enjoys 73 | patronage from the A-list clientele in Hong Kong. Featuring four of 74 | the best three-star Michelin chefs in the world, you never know what 75 | will arrive on your plate the next time you visit us. 76 |

77 |

78 | The restaurant traces its humble beginnings to{" "} 79 | The Frying Pan, a successful chain started by our CEO, Mr. 80 | Peter Pan, that featured for the first time the world's best 81 | cuisines in a pan. 82 |

83 |
84 |
85 | 86 | 87 | Facts At a Glance 88 | 89 | 90 |
91 |
Started
92 |
3 Feb. 2013
93 |
Major Stake Holder
94 |
HK Fine Foods Inc.
95 |
Last Year's Turnover
96 |
$1,250,375
97 |
Employees
98 |
40
99 |
100 |
101 |
102 |
103 |
104 | 105 | 106 |
107 |

108 | You better cut the pizza in four pieces because I'm not hungry 109 | enough to eat six. 110 |

111 |
112 | Yogi Berra, 113 | 114 | The Wit and Wisdom of Yogi Berra, P. Pepe, Diversion Books, 115 | 2014 116 | 117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |

Corporate Leadership

126 |
127 |
128 |
129 | 130 | 135 | 136 |
137 |
138 |
139 |
140 | ); 141 | } 142 | 143 | export default About; 144 | -------------------------------------------------------------------------------- /Course2/React/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 |
Links
11 |
    12 |
  • 13 | Home 14 |
  • 15 |
  • 16 | About Us 17 |
  • 18 |
  • 19 | Menu 20 |
  • 21 |
  • 22 | Contact Us 23 |
  • 24 |
25 |
26 |
27 |
Our Address
28 |
29 | 121, Clear Water Bay Road 30 |
31 | Clear Water Bay, Kowloon 32 |
33 | HONG KONG 34 |
35 | : +852 1234 5678 36 |
37 | : +852 8765 4321 38 |
39 | :{" "} 40 | confusion@food.net 41 |
42 |
43 | 80 |
81 |
82 |
83 |

© Copyright 2018 Ristorante Con Fusion

84 |
85 |
86 |
87 |
88 | ); 89 | } 90 | 91 | export default Footer; 92 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/components/HeaderComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { 3 | Navbar, 4 | NavbarBrand, 5 | Nav, 6 | NavbarToggler, 7 | Collapse, 8 | NavItem, 9 | Jumbotron, 10 | Button, 11 | Modal, 12 | ModalHeader, 13 | ModalBody, 14 | Form, 15 | FormGroup, 16 | Label, 17 | Input 18 | } from "reactstrap"; 19 | import { NavLink } from "react-router-dom"; 20 | 21 | class Header extends Component { 22 | constructor(props) { 23 | super(props); 24 | this.state = { 25 | isNavOpen: false, 26 | isModalOpen: false 27 | }; 28 | this.toggleNav = this.toggleNav.bind(this); 29 | this.toggleModal = this.toggleModal.bind(this); 30 | this.handleLogin = this.handleLogin.bind(this); 31 | } 32 | 33 | toggleModal() { 34 | this.setState({ 35 | isModalOpen: !this.state.isModalOpen 36 | }); 37 | } 38 | 39 | toggleNav() { 40 | this.setState({ 41 | isNavOpen: !this.state.isNavOpen 42 | }); 43 | } 44 | 45 | handleLogin(event) { 46 | this.toggleModal(); 47 | alert( 48 | "Username: " + 49 | this.username.value + 50 | " Password: " + 51 | this.password.value + 52 | " Remember: " + 53 | this.remember.checked 54 | ); 55 | event.preventDefault(); 56 | } 57 | 58 | render() { 59 | return ( 60 | 61 | 62 |
63 | 64 | 65 | Ristorante Con Fusion 71 | 72 | 73 | 96 | 103 | 104 |
105 |
106 | 107 |
108 |
109 |
110 |

Ristorante Con Fusion

111 |

112 | We take inspiration from World's best cuisines, and create a 113 | unique fusion experience. Our lipsmaking creations will tickle 114 | your culinary senses! 115 |

116 |
117 |
118 |
119 |
120 | 121 | Login 122 | 123 |
124 | 125 | 126 | (this.username = input)} 131 | /> 132 | 133 | 134 | 135 | (this.password = input)} 140 | /> 141 | 142 | 143 | 151 | 152 | 155 |
156 |
157 |
158 |
159 | ); 160 | } 161 | } 162 | 163 | export default Header; 164 | -------------------------------------------------------------------------------- /Course2/React/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 | function RenderCard({ item, isLoading, errMess }) { 15 | if (isLoading) { 16 | return ; 17 | } else if (errMess) { 18 | return

{errMess}

; 19 | } else { 20 | return ( 21 | 27 | 28 | 29 | 30 | {item.name} 31 | {item.designation ? ( 32 | {item.designation} 33 | ) : null} 34 | {item.description} 35 | 36 | 37 | 38 | ); 39 | } 40 | } 41 | 42 | function Home(props) { 43 | return ( 44 |
45 |
46 |
47 | 52 |
53 |
54 | 59 |
60 |
61 | 66 |
67 |
68 |
69 | ); 70 | } 71 | 72 | export default Home; 73 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/components/LoadingComponent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const Loading = () => { 4 | return ( 5 |
6 | 7 |

Loading...

8 |
9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/components/MainComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Menu from "./MenuComponent"; 3 | import DishdetailComponent from "./DishdetailComponent"; 4 | import Header from "./HeaderComponent"; 5 | import Footer from "./FooterComponent"; 6 | import Home from "./HomeComponent"; 7 | import { Switch, Route, Redirect, withRouter } from "react-router-dom"; 8 | import { connect } from "react-redux"; 9 | import Contact from "./ContactComponent"; 10 | import About from "./AboutusComponent"; 11 | import { 12 | postComment, 13 | fetchDishes, 14 | fetchComments, 15 | fetchPromos, 16 | fetchLeaders, 17 | postFeedback 18 | } from "../redux/ActionCreators"; 19 | import { actions } from "react-redux-form"; 20 | import { TransitionGroup, CSSTransition } from "react-transition-group"; 21 | 22 | const mapStateToProps = state => { 23 | return { 24 | dishes: state.dishes, 25 | comments: state.comments, 26 | promotions: state.promotions, 27 | leaders: state.leaders 28 | }; 29 | }; 30 | 31 | const mapDispatchToProps = dispatch => ({ 32 | postComment: (dishId, rating, author, comment) => 33 | dispatch(postComment(dishId, rating, author, comment)), 34 | fetchDishes: () => { 35 | dispatch(fetchDishes()); 36 | }, 37 | resetFeedbackForm: () => { 38 | dispatch(actions.reset("feedback")); 39 | }, 40 | fetchComments: () => { 41 | dispatch(fetchComments()); 42 | }, 43 | fetchPromos: () => { 44 | dispatch(fetchPromos()); 45 | }, 46 | fetchLeaders: () => { 47 | dispatch(fetchLeaders()); 48 | }, 49 | postFeedback: ( 50 | firstname, 51 | lastname, 52 | telnum, 53 | email, 54 | agree, 55 | contactType, 56 | message 57 | ) => 58 | dispatch( 59 | postFeedback( 60 | firstname, 61 | lastname, 62 | telnum, 63 | email, 64 | agree, 65 | contactType, 66 | message 67 | ) 68 | ) 69 | }); 70 | 71 | class Main extends Component { 72 | 73 | componentDidMount() { 74 | this.props.fetchDishes(); 75 | this.props.fetchComments(); 76 | this.props.fetchPromos(); 77 | this.props.fetchLeaders(); 78 | } 79 | 80 | render() { 81 | const HomePage = () => { 82 | return ( 83 | dish.featured)[0]} 85 | dishesLoading={this.props.dishes.isLoading} 86 | dishesErrMess={this.props.dishes.errMess} 87 | promotion={ 88 | this.props.promotions.promotions.filter(promo => promo.featured)[0] 89 | } 90 | promosLoading={this.props.promotions.isLoading} 91 | promosErrMess={this.props.promotions.errMess} 92 | leader={ 93 | this.props.leaders.leaders.filter(leader => leader.featured)[0] 94 | } 95 | leaderLoading={this.props.leaders.isLoading} 96 | leaderErrMess={this.props.leaders.errMess} 97 | /> 98 | ); 99 | }; 100 | 101 | const DishWithId = ({ match }) => { 102 | return ( 103 | dish.id === parseInt(match.params.dishId, 10) 107 | )[0] 108 | } 109 | isLoading={this.props.dishes.isLoading} 110 | errMess={this.props.dishes.errMess} 111 | comments={this.props.comments.comments.filter( 112 | comment => comment.dishId === parseInt(match.params.dishId, 10) 113 | )} 114 | errMess={this.props.comments.errMess} 115 | postComment={this.props.postComment} 116 | /> 117 | ); 118 | }; 119 | 120 | return ( 121 |
122 |
123 | 124 | 129 | 130 | 131 | } 135 | /> 136 | 137 | ( 141 | 146 | )} 147 | /> 148 | ( 152 | 156 | )} 157 | /> 158 | 159 | 160 | {/* this.onDishSelect(dishId)} 163 | /> 164 | dish.id === this.state.selectedDish 168 | )[0] 169 | } 170 | /> */} 171 | 172 | 173 |
174 |
175 | ); 176 | } 177 | } 178 | 179 | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Main)); 180 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/components/MenuComponent.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Card, 4 | CardImg, 5 | CardImgOverlay, 6 | CardTitle, 7 | Breadcrumb, 8 | BreadcrumbItem 9 | } from "reactstrap"; 10 | import { Link } from "react-router-dom"; 11 | import { Loading } from "./LoadingComponent"; 12 | import { baseUrl } from "../shared/baseUrl"; 13 | 14 | function RenderMenuItem({ dish, onClick }) { 15 | return ( 16 | 17 | 18 | 24 | 25 | {dish.name} 26 | 27 | 28 | 29 | ); 30 | } 31 | 32 | const Menu = props => { 33 | const menu = props.dishes.dishes.map(dish => { 34 | return ( 35 |
36 | 37 |
38 | ); 39 | }); 40 | 41 | if (props.dishes.isLoading) { 42 | return ( 43 |
44 |
45 | 46 |
47 |
48 | ); 49 | } else if (props.dishes.errMess) { 50 | return ( 51 |
52 |
53 |

{props.dishes.errMess}

54 |
55 |
56 | ); 57 | } else { 58 | return ( 59 |
60 |
61 | 62 | 63 | Home 64 | 65 | Menu 66 | 67 |
68 |

Menu

69 |
70 |
71 |
72 |
{menu}
73 | {/*
74 |
75 | 78 |
79 |
80 | {this.renderComments(this.state.selectedDish)} 81 |
82 |
*/} 83 |
84 | ); 85 | } 86 | }; 87 | 88 | export default Menu; 89 | -------------------------------------------------------------------------------- /Course2/React/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 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import "bootstrap/dist/css/bootstrap.min.css"; 5 | import App from "./App"; 6 | import * as serviceWorker from "./serviceWorker"; 7 | import "font-awesome/css/font-awesome.css"; 8 | import "bootstrap-social/bootstrap-social.css"; 9 | 10 | ReactDOM.render(, document.getElementById("root")); 11 | 12 | // If you want your app to work offline and load faster, you can change 13 | // unregister() to register() below. Note this comes with some pitfalls. 14 | // Learn more about service workers: https://bit.ly/CRA-PWA 15 | serviceWorker.unregister(); 16 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/ActionTypes.js: -------------------------------------------------------------------------------- 1 | export const ADD_COMMENT = "ADD_COMMENT"; 2 | export const DISHES_LOADING = "DISHES_LOADING"; 3 | export const DISHES_FAILED = "DISHES_FAILED"; 4 | export const ADD_DISHES = "ADD_DISHES"; 5 | export const ADD_COMMENTS = "ADD_COMMENTS"; 6 | export const COMMENTS_FAILED = "COMMENTS_FAILED"; 7 | export const PROMOS_LOADING = "PROMOS_LOADING"; 8 | export const ADD_PROMOS = "ADD_PROMOS"; 9 | export const PROMOS_FAILED = "PROMOS_FAILED"; 10 | export const LEADERS_LOADING = "LEADERS_LOADING"; 11 | export const ADD_LEADERS = "ADD_LEADERS"; 12 | export const LEADERS_FAILED = "LEADERS_FAILED"; 13 | -------------------------------------------------------------------------------- /Course2/React/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 | }; 19 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/configureStore.js: -------------------------------------------------------------------------------- 1 | import { createStore, combineReducers, applyMiddleware } from "redux"; 2 | import { createForms } from "react-redux-form"; 3 | import { Dishes } from "./dishes"; 4 | import { Comments } from "./comments"; 5 | import { Leaders } from "./leaders"; 6 | import { Promotions } from "./promotions"; 7 | import thunk from "redux-thunk"; 8 | import logger from "redux-logger"; 9 | import { InitialFeedback } from "./forms"; 10 | 11 | export const ConfigureStore = () => { 12 | const store = createStore( 13 | combineReducers({ 14 | dishes: Dishes, 15 | comments: Comments, 16 | promotions: Promotions, 17 | leaders: Leaders, 18 | ...createForms({ 19 | feedback: InitialFeedback 20 | }) 21 | }), 22 | applyMiddleware(thunk, logger) 23 | ); 24 | 25 | return store; 26 | }; 27 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/dishes.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | 3 | export const Dishes = ( 4 | state = { 5 | isLoading: true, 6 | errMess: null, 7 | dishes: [] 8 | }, 9 | action 10 | ) => { 11 | switch (action.type) { 12 | case ActionTypes.ADD_DISHES: 13 | return { 14 | ...state, 15 | isLoading: false, 16 | errMess: null, 17 | dishes: action.payload 18 | }; 19 | 20 | case ActionTypes.DISHES_LOADING: 21 | return { ...state, isLoading: true, errMess: null, dishes: [] }; 22 | 23 | case ActionTypes.DISHES_FAILED: 24 | return { 25 | ...state, 26 | isLoading: false, 27 | errMess: action.payload, 28 | dishes: [] 29 | }; 30 | 31 | default: 32 | return state; 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/forms.js: -------------------------------------------------------------------------------- 1 | export const InitialFeedback = { 2 | firstname: "", 3 | lastname: "", 4 | telnum: "", 5 | email: "", 6 | agree: false, 7 | contactType: "Tel.", 8 | message: "" 9 | }; 10 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/leaders.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | 3 | export const Leaders = ( 4 | state = { 5 | isLoading: true, 6 | errMess: null, 7 | leaders: [] 8 | }, 9 | action 10 | ) => { 11 | switch (action.type) { 12 | case ActionTypes.ADD_LEADERS: 13 | return { 14 | ...state, 15 | isLoading: false, 16 | errMess: null, 17 | leaders: action.payload 18 | }; 19 | 20 | case ActionTypes.LEADERS_LOADING: 21 | return { ...state, isLoading: true, errMess: null, leaders: [] }; 22 | 23 | case ActionTypes.LEADERS_FAILED: 24 | return { ...state, isLoading: false, errMess: action.payload }; 25 | 26 | default: 27 | return state; 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/redux/promotions.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | 3 | export const Promotions = ( 4 | state = { 5 | isLoading: true, 6 | errMess: null, 7 | promotions: [] 8 | }, 9 | action 10 | ) => { 11 | switch (action.type) { 12 | case ActionTypes.ADD_PROMOS: 13 | return { 14 | ...state, 15 | isLoading: false, 16 | errMess: null, 17 | promotions: action.payload 18 | }; 19 | 20 | case ActionTypes.PROMOS_LOADING: 21 | return { ...state, isLoading: true, errMess: null, promotions: [] }; 22 | 23 | case ActionTypes.PROMOS_FAILED: 24 | return { 25 | ...state, 26 | isLoading: false, 27 | errMess: action.payload, 28 | promotions: [] 29 | }; 30 | 31 | default: 32 | return state; 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /Course2/React/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.1/8 is considered localhost for IPv4. 18 | window.location.hostname.match( 19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 20 | ) 21 | ); 22 | 23 | export function register(config) { 24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 25 | // The URL constructor is available in all browsers that support SW. 26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); 27 | if (publicUrl.origin !== window.location.origin) { 28 | // Our service worker won't work if PUBLIC_URL is on a different origin 29 | // from what our page is served on. This might happen if a CDN is used to 30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374 31 | return; 32 | } 33 | 34 | window.addEventListener('load', () => { 35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 36 | 37 | if (isLocalhost) { 38 | // This is running on localhost. Let's check if a service worker still exists or not. 39 | checkValidServiceWorker(swUrl, config); 40 | 41 | // Add some additional logging to localhost, pointing developers to the 42 | // service worker/PWA documentation. 43 | navigator.serviceWorker.ready.then(() => { 44 | console.log( 45 | 'This web app is being served cache-first by a service ' + 46 | 'worker. To learn more, visit 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 | .then(response => { 105 | // Ensure service worker exists, and that we really are getting a JS file. 106 | const contentType = response.headers.get('content-type'); 107 | if ( 108 | response.status === 404 || 109 | (contentType != null && contentType.indexOf('javascript') === -1) 110 | ) { 111 | // No service worker found. Probably a different app. Reload the page. 112 | navigator.serviceWorker.ready.then(registration => { 113 | registration.unregister().then(() => { 114 | window.location.reload(); 115 | }); 116 | }); 117 | } else { 118 | // Service worker found. Proceed as normal. 119 | registerValidSW(swUrl, config); 120 | } 121 | }) 122 | .catch(() => { 123 | console.log( 124 | 'No internet connection found. App is running in offline mode.' 125 | ); 126 | }); 127 | } 128 | 129 | export function unregister() { 130 | if ('serviceWorker' in navigator) { 131 | navigator.serviceWorker.ready.then(registration => { 132 | registration.unregister(); 133 | }); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/shared/baseUrl.js: -------------------------------------------------------------------------------- 1 | export const baseUrl = "http://localhost:3001/"; 2 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/shared/comments.js: -------------------------------------------------------------------------------- 1 | export const COMMENTS = [ 2 | { 3 | id: 0, 4 | dishId: 0, 5 | rating: 5, 6 | comment: "Imagine all the eatables, living in conFusion!", 7 | author: "John Lemon", 8 | date: "2012-10-16T17:57:28.556094Z" 9 | }, 10 | { 11 | id: 1, 12 | dishId: 0, 13 | rating: 4, 14 | comment: 15 | "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: 56 | "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!", 57 | author: "Paul McVites", 58 | date: "2014-09-05T17:57:28.556094Z" 59 | }, 60 | { 61 | id: 7, 62 | dishId: 1, 63 | rating: 3, 64 | comment: "Eat it, just eat it!", 65 | author: "Michael Jaikishan", 66 | date: "2015-02-13T17:57:28.556094Z" 67 | }, 68 | { 69 | id: 8, 70 | dishId: 1, 71 | rating: 4, 72 | comment: "Ultimate, Reaching for the stars!", 73 | author: "Ringo Starry", 74 | date: "2013-12-02T17:57:28.556094Z" 75 | }, 76 | { 77 | id: 9, 78 | dishId: 1, 79 | rating: 2, 80 | comment: "It's your birthday, we're gonna party!", 81 | author: "25 Cent", 82 | date: "2011-12-02T17:57:28.556094Z" 83 | }, 84 | { 85 | id: 10, 86 | dishId: 2, 87 | rating: 5, 88 | comment: "Imagine all the eatables, living in conFusion!", 89 | author: "John Lemon", 90 | date: "2012-10-16T17:57:28.556094Z" 91 | }, 92 | { 93 | id: 11, 94 | dishId: 2, 95 | rating: 4, 96 | comment: 97 | "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!", 98 | author: "Paul McVites", 99 | date: "2014-09-05T17:57:28.556094Z" 100 | }, 101 | { 102 | id: 12, 103 | dishId: 2, 104 | rating: 3, 105 | comment: "Eat it, just eat it!", 106 | author: "Michael Jaikishan", 107 | date: "2015-02-13T17:57:28.556094Z" 108 | }, 109 | { 110 | id: 13, 111 | dishId: 2, 112 | rating: 4, 113 | comment: "Ultimate, Reaching for the stars!", 114 | author: "Ringo Starry", 115 | date: "2013-12-02T17:57:28.556094Z" 116 | }, 117 | { 118 | id: 14, 119 | dishId: 2, 120 | rating: 2, 121 | comment: "It's your birthday, we're gonna party!", 122 | author: "25 Cent", 123 | date: "2011-12-02T17:57:28.556094Z" 124 | }, 125 | { 126 | id: 15, 127 | dishId: 3, 128 | rating: 5, 129 | comment: "Imagine all the eatables, living in conFusion!", 130 | author: "John Lemon", 131 | date: "2012-10-16T17:57:28.556094Z" 132 | }, 133 | { 134 | id: 16, 135 | dishId: 3, 136 | rating: 4, 137 | comment: 138 | "Sends anyone to heaven, I wish I could get my mother-in-law to eat it!", 139 | author: "Paul McVites", 140 | date: "2014-09-05T17:57:28.556094Z" 141 | }, 142 | { 143 | id: 17, 144 | dishId: 3, 145 | rating: 3, 146 | comment: "Eat it, just eat it!", 147 | author: "Michael Jaikishan", 148 | date: "2015-02-13T17:57:28.556094Z" 149 | }, 150 | { 151 | id: 18, 152 | dishId: 3, 153 | rating: 4, 154 | comment: "Ultimate, Reaching for the stars!", 155 | author: "Ringo Starry", 156 | date: "2013-12-02T17:57:28.556094Z" 157 | }, 158 | { 159 | id: 19, 160 | dishId: 3, 161 | rating: 2, 162 | comment: "It's your birthday, we're gonna party!", 163 | author: "25 Cent", 164 | date: "2011-12-02T17:57:28.556094Z" 165 | } 166 | ]; 167 | -------------------------------------------------------------------------------- /Course2/React/confusion/src/shared/dishes.js: -------------------------------------------------------------------------------- 1 | export const DISHES = [ 2 | { 3 | id: 0, 4 | name: "Uthappizza", 5 | image: "/assets/images/uthappizza.png", 6 | category: "mains", 7 | label: "Hot", 8 | price: "4.99", 9 | featured: true, 10 | description: 11 | "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: 22 | "Deep fried Zucchini coated with mildly spiced Chickpea flour batter accompanied with a sweet-tangy tamarind sauce" 23 | }, 24 | { 25 | id: 2, 26 | name: "Vadonut", 27 | image: "/assets/images/vadonut.png", 28 | category: "appetizer", 29 | label: "New", 30 | price: "1.99", 31 | featured: false, 32 | description: 33 | "A quintessential ConFusion experience, is it a vada or is it a donut?" 34 | }, 35 | { 36 | id: 3, 37 | name: "ElaiCheese Cake", 38 | image: "/assets/images/elaicheesecake.png", 39 | category: "dessert", 40 | label: "", 41 | price: "2.99", 42 | featured: false, 43 | description: 44 | "A delectable, semi-sweet New York Style Cheese Cake, with Graham cracker crust and spiced with Indian cardamoms" 45 | } 46 | ]; 47 | -------------------------------------------------------------------------------- /Course2/React/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: 10 | "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." 11 | }, 12 | { 13 | id: 1, 14 | name: "Dhanasekaran Witherspoon", 15 | image: "/assets/images/alberto.png", 16 | designation: "Chief Food Officer", 17 | abbr: "CFO", 18 | featured: false, 19 | description: 20 | "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!" 21 | }, 22 | { 23 | id: 2, 24 | name: "Agumbe Tang", 25 | image: "/assets/images/alberto.png", 26 | designation: "Chief Taste Officer", 27 | abbr: "CTO", 28 | featured: false, 29 | description: 30 | "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." 31 | }, 32 | { 33 | id: 3, 34 | name: "Alberto Somayya", 35 | image: "/assets/images/alberto.png", 36 | designation: "Executive Chef", 37 | abbr: "EC", 38 | featured: true, 39 | description: 40 | "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!" 41 | } 42 | ]; 43 | -------------------------------------------------------------------------------- /Course2/React/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: 10 | "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" 11 | } 12 | ]; 13 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week1_Assignment/AboutComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { ScrollView, Text, FlatList } from "react-native"; 3 | import { Card, ListItem } from "react-native-elements"; 4 | import { LEADERS } from "../shared/leaders"; 5 | 6 | class AboutUs extends Component { 7 | constructor(props) { 8 | super(props); 9 | this.state = { 10 | leaders: LEADERS 11 | }; 12 | } 13 | 14 | static navigationOptions = { 15 | title: "About Us" 16 | }; 17 | 18 | render() { 19 | const renderLeader = ({ item, index }) => { 20 | return ( 21 | 28 | ); 29 | }; 30 | 31 | return ( 32 | 33 | 34 | 35 | Started in 2010, Ristorante con Fusion quickly established itself as 36 | a culinary icon par excellence in Hong Kong. With its unique brand 37 | of world fusion cuisine that can be found nowhere else, it enjoys 38 | patronage from the A-list clientele in Hong Kong. Featuring four of 39 | the best three-star Michelin chefs in the world, you never know what 40 | will arrive on your plate the next time you visit us. 41 | 42 | 43 | The restaurant traces its humble beginnings to The Frying Pan, a 44 | successful chain started by our CEO, Mr. Peter Pan, that featured 45 | for the first time the world's best cuisines in a pan. 46 | 47 | 48 | 49 | item.id.toString()} 53 | /> 54 | 55 | 56 | ); 57 | } 58 | } 59 | 60 | export default AboutUs; 61 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week1_Assignment/ContactComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { Text } from "react-native"; 3 | import { Card } from "react-native-elements"; 4 | 5 | class ContactUs extends Component { 6 | static navigationOptions = { 7 | title: "Contact Us" 8 | }; 9 | 10 | render() { 11 | return ( 12 | 13 | 121, Clear Water Bay Road 14 | Clear Water Bay, Kowloon 15 | HONG KONG 16 | Tel: +852 1234 5678 17 | Fax: +852 8765 4321 18 | Email:confusion@food.net 19 | 20 | ); 21 | } 22 | } 23 | 24 | export default ContactUs; 25 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week1_Assignment/MainComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Menu from "./MenuComponent"; 3 | import Home from "./HomeComponent"; 4 | import Dishdetail from "./DishdetailComponent"; 5 | import ContactUs from "./ContactComponent"; 6 | import AboutUs from "./AboutComponent"; 7 | import { View, Platform } from "react-native"; 8 | import { createStackNavigator, createDrawerNavigator } from "react-navigation"; 9 | 10 | const MenuNavigator = createStackNavigator( 11 | { 12 | Menu: { screen: Menu }, 13 | Dishdetail: { screen: Dishdetail } 14 | }, 15 | { 16 | initialRouteName: "Menu", 17 | navigationOptions: { 18 | headerStyle: { 19 | backgroundColor: "#512DA8" 20 | }, 21 | headerTintColor: "#fff", 22 | headerTitleStyle: { 23 | color: "#fff" 24 | } 25 | } 26 | } 27 | ); 28 | 29 | const HomeNavigator = createStackNavigator( 30 | { 31 | Home: { screen: Home } 32 | }, 33 | { 34 | navigationOptions: { 35 | headerStyle: { 36 | backgroundColor: "#512DA8" 37 | }, 38 | headerTintColor: "#fff", 39 | headerTitleStyle: { 40 | color: "#fff" 41 | } 42 | } 43 | } 44 | ); 45 | 46 | const ContactNavigator = createStackNavigator( 47 | { 48 | ContactUs: { screen: ContactUs } 49 | }, 50 | { 51 | navigationOptions: { 52 | headerStyle: { 53 | backgroundColor: "#512DA8" 54 | }, 55 | headerTintColor: "#fff", 56 | headerTitleStyle: { 57 | color: "#fff" 58 | } 59 | } 60 | } 61 | ); 62 | 63 | const AboutNavigator = createStackNavigator( 64 | { 65 | AboutUs: { screen: AboutUs } 66 | }, 67 | { 68 | navigationOptions: { 69 | headerStyle: { 70 | backgroundColor: "#512DA8" 71 | }, 72 | headerTintColor: "#fff", 73 | headerTitleStyle: { 74 | color: "#fff" 75 | } 76 | } 77 | } 78 | ); 79 | 80 | const MainNavigator = createDrawerNavigator( 81 | { 82 | Home: { 83 | screen: HomeNavigator, 84 | navigationOptions: { 85 | title: "Home", 86 | drawerLabel: "Home" 87 | } 88 | }, 89 | AboutUs: { 90 | screen: AboutNavigator, 91 | navigationOptions: { 92 | title: "About Us", 93 | drawerLabel: "AboutUs" 94 | } 95 | }, 96 | Menu: { 97 | screen: MenuNavigator, 98 | navigationOptions: { 99 | title: "Menu", 100 | drawerLabel: "Menu" 101 | } 102 | }, 103 | ContactUs: { 104 | screen: ContactNavigator, 105 | navigationOptions: { 106 | title: "Contact Us", 107 | drawerLabel: "ContactUs" 108 | } 109 | } 110 | }, 111 | { 112 | drawerBackgroundColor: "#D1C4E9" 113 | } 114 | ); 115 | 116 | class Main extends Component { 117 | render() { 118 | return ( 119 | 125 | 126 | 127 | ); 128 | } 129 | } 130 | 131 | export default Main; 132 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week2_Assignment/ActionCreators.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | import { baseUrl } from "../shared/baseUrl"; 3 | 4 | export const fetchComments = () => dispatch => { 5 | return fetch(baseUrl + "comments") 6 | .then( 7 | response => { 8 | if (response.ok) { 9 | return response; 10 | } else { 11 | var error = new Error( 12 | "Error " + response.status + ": " + response.statusText 13 | ); 14 | error.response = response; 15 | throw error; 16 | } 17 | }, 18 | error => { 19 | var error = new Error(error.message); 20 | throw error; 21 | } 22 | ) 23 | .then(response => response.json()) 24 | .then(comments => dispatch(addComments(comments))) 25 | .catch(error => dispatch(commentsFailed(error.message))); 26 | }; 27 | 28 | export const commentsFailed = errMess => ({ 29 | type: ActionTypes.COMMENTS_FAILED, 30 | payload: errMess 31 | }); 32 | 33 | export const addComments = comments => ({ 34 | type: ActionTypes.ADD_COMMENTS, 35 | payload: comments 36 | }); 37 | 38 | export const fetchDishes = () => dispatch => { 39 | dispatch(dishesLoading()); 40 | return fetch(baseUrl + "dishes") 41 | .then( 42 | response => { 43 | if (response.ok) { 44 | return response; 45 | } else { 46 | var error = new Error( 47 | "Error " + response.status + ": " + response.statusText 48 | ); 49 | error.response = response; 50 | throw error; 51 | } 52 | }, 53 | error => { 54 | var error = new Error(error.message); 55 | throw error; 56 | } 57 | ) 58 | .then(response => response.json()) 59 | .then(dishes => dispatch(addDishes(dishes))) 60 | .catch(error => dispatch(dishesFailed(error.message))); 61 | }; 62 | 63 | export const dishesLoading = () => ({ 64 | type: ActionTypes.DISHES_LOADING 65 | }); 66 | 67 | export const dishesFailed = errMess => ({ 68 | type: ActionTypes.DISHES_FAILED, 69 | payload: errMess 70 | }); 71 | 72 | export const addDishes = dishes => ({ 73 | type: ActionTypes.ADD_DISHES, 74 | payload: dishes 75 | }); 76 | 77 | export const fetchPromos = () => dispatch => { 78 | dispatch(promosLoading()); 79 | return fetch(baseUrl + "promotions") 80 | .then( 81 | response => { 82 | if (response.ok) { 83 | return response; 84 | } else { 85 | var error = new Error( 86 | "Error " + response.status + ": " + response.statusText 87 | ); 88 | error.response = response; 89 | throw error; 90 | } 91 | }, 92 | error => { 93 | var error = new Error(error.message); 94 | throw error; 95 | } 96 | ) 97 | .then(response => response.json()) 98 | .then(promos => dispatch(addPromos(promos))) 99 | .catch(error => dispatch(promosFailed(error.message))); 100 | }; 101 | 102 | export const promosLoading = () => ({ 103 | type: ActionTypes.PROMOS_LOADING 104 | }); 105 | 106 | export const promosFailed = errMess => ({ 107 | type: ActionTypes.PROMOS_FAILED, 108 | payload: errMess 109 | }); 110 | 111 | export const addPromos = promos => ({ 112 | type: ActionTypes.ADD_PROMOS, 113 | payload: promos 114 | }); 115 | 116 | export const fetchLeaders = () => dispatch => { 117 | dispatch(leadersLoading()); 118 | return fetch(baseUrl + "leaders") 119 | .then( 120 | response => { 121 | if (response.ok) { 122 | return response; 123 | } else { 124 | var error = new Error( 125 | "Error " + response.status + ": " + response.statusText 126 | ); 127 | error.response = response; 128 | throw error; 129 | } 130 | }, 131 | error => { 132 | var error = new Error(error.message); 133 | throw error; 134 | } 135 | ) 136 | .then(response => response.json()) 137 | .then(leaders => dispatch(addLeaders(leaders))) 138 | .catch(error => dispatch(leadersFailed(error.message))); 139 | }; 140 | 141 | export const leadersLoading = () => ({ 142 | type: ActionTypes.LEADERS_LOADING 143 | }); 144 | 145 | export const leadersFailed = errMess => ({ 146 | type: ActionTypes.LEADERS_FAILED, 147 | payload: errMess 148 | }); 149 | 150 | export const addLeaders = leaders => ({ 151 | type: ActionTypes.ADD_LEADERS, 152 | payload: leaders 153 | }); 154 | 155 | export const postFavorite = dishId => dispatch => { 156 | setTimeout(() => { 157 | dispatch(addFavorite(dishId)); 158 | }, 2000); 159 | }; 160 | 161 | export const addFavorite = dishId => ({ 162 | type: ActionTypes.ADD_FAVORITE, 163 | payload: dishId 164 | }); 165 | 166 | export const postComment = (dishId, rating, author, comment) => dispatch => { 167 | const newComment = { 168 | dishId: dishId, 169 | rating: rating, 170 | author: author, 171 | comment: comment 172 | }; 173 | newComment.date = new Date().toISOString(); 174 | 175 | setTimeout(() => { 176 | dispatch(addComment(newComment)); 177 | }, 2000); 178 | }; 179 | 180 | export const addComment = comment => ({ 181 | type: ActionTypes.ADD_COMMENT, 182 | payload: comment 183 | }); -------------------------------------------------------------------------------- /Course3/ReactNative/Week2_Assignment/ActionTypes.js: -------------------------------------------------------------------------------- 1 | export const DISHES_LOADING = "DISHES_LOADING"; 2 | export const ADD_DISHES = "ADD_DISHES"; 3 | export const DISHES_FAILED = "DISHES_FAILED"; 4 | export const ADD_COMMENTS = "ADD_COMMENTS"; 5 | export const COMMENTS_FAILED = "COMMENTS_FAILED"; 6 | export const PROMOS_LOADING = "PROMOS_LOADING"; 7 | export const ADD_PROMOS = "ADD_PROMOS"; 8 | export const PROMOS_FAILED = "PROMOS_FAILED"; 9 | export const LEADERS_LOADING = "LEADERS_LOADING"; 10 | export const ADD_LEADERS = "ADD_LEADERS"; 11 | export const LEADERS_FAILED = "LEADERS_FAILED"; 12 | export const POST_FAVORITE = "POST_FAVORITE"; 13 | export const ADD_FAVORITE = "ADD_FAVORITE"; 14 | export const ADD_COMMENT = "ADD_COMMENT"; 15 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week2_Assignment/comments.js: -------------------------------------------------------------------------------- 1 | import * as ActionTypes from "./ActionTypes"; 2 | 3 | export const comments = ( 4 | state = { 5 | errMess: null, 6 | comments: [] 7 | }, 8 | action 9 | ) => { 10 | switch (action.type) { 11 | case ActionTypes.ADD_COMMENTS: 12 | return { 13 | ...state, 14 | errMess: null, 15 | comments: action.payload 16 | }; 17 | 18 | case ActionTypes.COMMENTS_FAILED: 19 | return { 20 | ...state, 21 | errMess: action.payload, 22 | comments: [] 23 | }; 24 | 25 | case ActionTypes.ADD_COMMENT: 26 | const { comments } = state; 27 | const comment = { id: comments.length, ...action.payload }; 28 | return { ...state, comments: comments.concat(comment) }; 29 | 30 | default: 31 | return state; 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /Course3/ReactNative/Week3_Assignment/ReservationComponent.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { 3 | Text, 4 | View, 5 | ScrollView, 6 | StyleSheet, 7 | Picker, 8 | Switch, 9 | Button, 10 | Modal, 11 | Alert 12 | } from "react-native"; 13 | import { Card } from "react-native-elements"; 14 | import DatePicker from "react-native-datepicker"; 15 | import * as Animatable from "react-native-animatable"; 16 | 17 | class Reservation extends Component { 18 | constructor(props) { 19 | super(props); 20 | 21 | this.state = { 22 | guests: 1, 23 | smoking: false, 24 | date: "", 25 | showModal: false 26 | }; 27 | } 28 | 29 | static navigationOptions = { 30 | title: "Reserve Table" 31 | }; 32 | 33 | toggleModal() { 34 | this.setState({ showModal: !this.state.showModal }); 35 | } 36 | 37 | handleReservation() { 38 | console.log(JSON.stringify(this.state)); 39 | // this.toggleModal(); 40 | const { date, guests, smoking } = this.state; 41 | 42 | Alert.alert( 43 | "Your Reservation OK?", 44 | `Number of guests: ${guests}\nSmoking? ${ 45 | smoking ? "Yes" : "No" 46 | }\nDate and Time:${date}`, 47 | [ 48 | { 49 | text: "Cancel", 50 | style: "cancel", 51 | onPress: () => this.resetForm() 52 | }, 53 | { 54 | text: "OK", 55 | // eslint-disable-next-line no-confusing-arrow, no-console 56 | onPress: () => this.resetForm() 57 | } 58 | ], 59 | { cancelable: false } 60 | ); 61 | } 62 | 63 | resetForm() { 64 | this.setState({ 65 | guests: 1, 66 | smoking: false, 67 | date: "", 68 | showModal: false 69 | }); 70 | } 71 | 72 | render() { 73 | return ( 74 | 75 | 76 | 77 | Number of Guests 78 | 82 | this.setState({ guests: itemValue }) 83 | } 84 | > 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | Smoking/Non-Smoking? 95 | this.setState({ smoking: value })} 100 | > 101 | 102 | 103 | Date and Time 104 | { 126 | this.setState({ date: date }); 127 | }} 128 | /> 129 | 130 | 131 |