From 158a108a4253de41160421ffdc1858391bc73a47 Mon Sep 17 00:00:00 2001 From: MoonTahoe Date: Wed, 11 Oct 2017 11:31:26 -0700 Subject: [PATCH 1/8] Fixes Time of day AM PM bug with clock --- chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js | 8 ++++---- chapter-07/mounting-lifecycle-clock/src/clock.js | 6 +++--- chapter-07/mounting-lifecycle-clock/src/lib.js | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js b/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js index 31709cca..9ce57d82 100644 --- a/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js +++ b/chapter-07/mounting-lifecycle-clock/dist/assets/bundle.js @@ -21236,7 +21236,7 @@ var Clock = function (_Component) { hours = _state.hours, minutes = _state.minutes, seconds = _state.seconds, - timeOfDay = _state.timeOfDay; + ampm = _state.ampm; return React.createElement( 'div', @@ -21269,7 +21269,7 @@ var Clock = function (_Component) { React.createElement( 'span', null, - timeOfDay + ampm ), React.createElement( 'button', @@ -21323,7 +21323,7 @@ var civilianHours = exports.civilianHours = function civilianHours(clockTime) { var appendAMPM = exports.appendAMPM = function appendAMPM(clockTime) { return _extends({}, clockTime, { - ampm: clockTime.hours >= 12 ? "PM" : "AM" + ampm: clockTime.hours >= 12 ? "pm" : "am" }); }; @@ -21353,7 +21353,7 @@ var doubleDigits = exports.doubleDigits = function doubleDigits(civilianTime) { return compose(prependZero("hours"), prependZero("minutes"), prependZero("seconds"))(civilianTime); }; -var getClockTime = exports.getClockTime = compose(getCurrentTime, abstractClockTime, convertToCivilianTime, doubleDigits); +var getClockTime = exports.getClockTime = compose(getCurrentTime, abstractClockTime, convertToCivilianTime, appendAMPM, doubleDigits); /***/ }) /******/ ]); \ No newline at end of file diff --git a/chapter-07/mounting-lifecycle-clock/src/clock.js b/chapter-07/mounting-lifecycle-clock/src/clock.js index 706ac234..cadbc08c 100644 --- a/chapter-07/mounting-lifecycle-clock/src/clock.js +++ b/chapter-07/mounting-lifecycle-clock/src/clock.js @@ -21,7 +21,7 @@ export default class Clock extends Component { } render() { - const { hours, minutes, seconds, timeOfDay } = this.state + const { hours, minutes, seconds, ampm } = this.state return (
{hours} @@ -29,10 +29,10 @@ export default class Clock extends Component { {minutes} : {seconds} - {timeOfDay} + {ampm}
) } -} \ No newline at end of file +} diff --git a/chapter-07/mounting-lifecycle-clock/src/lib.js b/chapter-07/mounting-lifecycle-clock/src/lib.js index f1b5ff7c..d51d27a5 100644 --- a/chapter-07/mounting-lifecycle-clock/src/lib.js +++ b/chapter-07/mounting-lifecycle-clock/src/lib.js @@ -19,7 +19,7 @@ export const civilianHours = clockTime => export const appendAMPM = clockTime => ({ ...clockTime, - ampm: (clockTime.hours >= 12) ? "PM" : "AM" + ampm: (clockTime.hours >= 12) ? "pm" : "am" }) export const prependZero = key => clockTime => @@ -54,5 +54,6 @@ export const getClockTime = compose( getCurrentTime, abstractClockTime, convertToCivilianTime, + appendAMPM, doubleDigits -) \ No newline at end of file +) From 868fb59adb968cae1bc996e5ae3c171ee03afac7 Mon Sep 17 00:00:00 2001 From: Eve Porcello Date: Thu, 12 Oct 2017 11:05:00 -0700 Subject: [PATCH 2/8] Adds a local version of the Flux sample (#19) * Adds local flux sample and fixes a typo * typo fix --- chapter-02/readme.md | 2 +- .../02-flux.html | 159 ++++++++++++++++++ chapter-07/readme.md | 2 +- 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 chapter-07/06-managing-state-outside-react/02-flux.html diff --git a/chapter-02/readme.md b/chapter-02/readme.md index 050ee90a..7d7c6cef 100644 --- a/chapter-02/readme.md +++ b/chapter-02/readme.md @@ -18,7 +18,7 @@ Samples 3. Without let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/03-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/03-let.html), [bin](http://jsbin.com/gapoxa/3/edit?js,output)) 4. With let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/04-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/04-let.html), [bin](http://jsbin.com/gapoxa/4/edit?js,output)) 5. Loops with var ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/05-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/05-let.html), [bin](http://jsbin.com/gapoxa/5/edit?js,output)) - 6. Loops with const ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/06-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/06-let.html), [bin](http://jsbin.com/gapoxa/6/edit?js,output)) + 6. Loops with let ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/06-let.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/06-let.html), [bin](http://jsbin.com/gapoxa/6/edit?js,output)) #### template strings 7. Without Template Strings - Simple Concatenation ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-02/01-declaring-variables/07-template-strings.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-02/01-declaring-variables/07-template-strings.html), [bin](http://jsbin.com/gapoxa/7/edit?js,output)) diff --git a/chapter-07/06-managing-state-outside-react/02-flux.html b/chapter-07/06-managing-state-outside-react/02-flux.html new file mode 100644 index 00000000..b5971082 --- /dev/null +++ b/chapter-07/06-managing-state-outside-react/02-flux.html @@ -0,0 +1,159 @@ + + + + + + + + + + + + Flux + + +
+ + + diff --git a/chapter-07/readme.md b/chapter-07/readme.md index a490778e..173a4b06 100644 --- a/chapter-07/readme.md +++ b/chapter-07/readme.md @@ -48,4 +48,4 @@ Samples ### Managing State Outside of React 1. Clock without React State ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-07/06-managing-state-outside-react/01-state.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-07/06-managing-state-outside-react/01-state.html), [bin](http://jsbin.com/juxewiw/1/edit?js,output)) - 2. Flux ([bin only](http://jsbin.com/juxewiw/2/edit?js,console,output)) + 2. Flux ([demo](https://rawgit.com/MoonHighway/learning-react/master/chapter-07/06-managing-state-outside-react/02-flux.html), [code](http://github.com/MoonHighway/learning-react/blob/master/chapter-07/06-managing-state-outside-react/02-flux.html), [bin](http://jsbin.com/juxewiw/2/edit?js,console,output)) From 6e4a3c715f31ca283bad8d7428104115830650ee Mon Sep 17 00:00:00 2001 From: Alex Banks Date: Sun, 31 Dec 2017 11:07:25 -0800 Subject: [PATCH 3/8] Update 10-template-strings.html from incorrect `.getYear()` to correct `.getFullYear()`... --- chapter-02/01-declaring-variables/10-template-strings.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter-02/01-declaring-variables/10-template-strings.html b/chapter-02/01-declaring-variables/10-template-strings.html index f3e668fd..d5d8e999 100644 --- a/chapter-02/01-declaring-variables/10-template-strings.html +++ b/chapter-02/01-declaring-variables/10-template-strings.html @@ -31,7 +31,7 @@

${article.title}

${article.body}
-

copyright ${new Date().getYear()} | The HTML5 Blog

+

copyright ${new Date().getFullYear()} | The HTML5 Blog

` From a686f50a5a515f75fca1a69e9d1d2244baf67009 Mon Sep 17 00:00:00 2001 From: Alex Banks Date: Sun, 31 Dec 2017 11:09:35 -0800 Subject: [PATCH 4/8] Update 04-imperative-clock.js Removes `var time=""` --- chapter-03/09-composition/04-imperative-clock.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chapter-03/09-composition/04-imperative-clock.js b/chapter-03/09-composition/04-imperative-clock.js index 3ec1bc2d..3ea52914 100644 --- a/chapter-03/09-composition/04-imperative-clock.js +++ b/chapter-03/09-composition/04-imperative-clock.js @@ -15,7 +15,6 @@ function getClockTime() { // Get the Current Time var date = new Date(); - var time = ""; // Serialize clock time var time = { @@ -54,4 +53,4 @@ function getClockTime() { + time.seconds + " " + time.ampm; -} \ No newline at end of file +} From ca31c5367d7576a68d376c26aa6d589a3ae20bfe Mon Sep 17 00:00:00 2001 From: Jack Liu Date: Wed, 7 Feb 2018 19:33:39 -0500 Subject: [PATCH 5/8] Fix a typo (#25) --- chapter-02/05-promises/01-promises.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter-02/05-promises/01-promises.html b/chapter-02/05-promises/01-promises.html index b7b686d8..e6d987e8 100644 --- a/chapter-02/05-promises/01-promises.html +++ b/chapter-02/05-promises/01-promises.html @@ -18,7 +18,7 @@

Promises

request.onload = () => (request.status === 200) ? resolves(JSON.parse(request.response).results) : - reject(Error(request.statusText)) + rejects(Error(request.statusText)) request.onerror = (err) => rejects(err) request.send() }) From e0346c72d5c5d643bb671b46f19b6ee189d26a1c Mon Sep 17 00:00:00 2001 From: Alex Banks Date: Sun, 11 Feb 2018 15:45:01 -0800 Subject: [PATCH 6/8] Update 02-mounting.html Prints the error message instead of the word error... --- chapter-07/01-mounting-lifecycle/02-mounting.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter-07/01-mounting-lifecycle/02-mounting.html b/chapter-07/01-mounting-lifecycle/02-mounting.html index 4268d65c..fb366bd2 100644 --- a/chapter-07/01-mounting-lifecycle/02-mounting.html +++ b/chapter-07/01-mounting-lifecycle/02-mounting.html @@ -74,7 +74,7 @@

{name.first} {name.last}

) : 0 members loaded... } - {(error) ?

Error Loading Members: error

: ""} + {(error) ?

Error Loading Members: {error.message}

: ""} ) } From 796ebc37ceaac4a391dd3c20d16ce37f1e199338 Mon Sep 17 00:00:00 2001 From: Seongbin Kim Date: Tue, 1 May 2018 02:32:00 +0900 Subject: [PATCH 7/8] Fix typo error (#29) FROM: ##### Version 1 of te sample in the editor: TO: ##### Version 1 of the sample in the editor: --- chapter-01/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter-01/readme.md b/chapter-01/readme.md index 81c82956..3d22eb2a 100644 --- a/chapter-01/readme.md +++ b/chapter-01/readme.md @@ -91,7 +91,7 @@ To [http://output.jsbin.com/gosabo/quite](http://output.jsbin.com/gosabo/quiet) ##### Version 1 of the sample as output: [http://output.jsbin.com/gosabo/1](http://output.jsbin.com/gosabo/1) -##### Version 1 of te sample in the editor: +##### Version 1 of the sample in the editor: [http://output.jsbin.com/gosabo/1/edit](http://output.jsbin.com/gosabo/1/edit) ##### Version 2 of the sample as output: [http://output.jsbin.com/gosabo/2](http://output.jsbin.com/gosabo/2) From e020939943a523d55a8780c308ac0d7cdb4f11a3 Mon Sep 17 00:00:00 2001 From: Aarif Khamdi Date: Wed, 8 May 2019 02:41:41 +0500 Subject: [PATCH 8/8] redirecting fix (#38) --- chapter-11/company-website/package.json | 3 ++- chapter-11/company-website/src/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter-11/company-website/package.json b/chapter-11/company-website/package.json index 96f78424..e9af5685 100644 --- a/chapter-11/company-website/package.json +++ b/chapter-11/company-website/package.json @@ -4,7 +4,8 @@ "description": "A React Router tutorial.", "main": "index.js", "scripts": { - "start": "opener http://localhost:3000 & webpack-dev-server" + "start": "opener http://localhost:3000 & webpack-dev-server", + "build": "webpack --progress" }, "author": "Eve Porcello (http://www.moonhighway.com)", "license": "MIT", diff --git a/chapter-11/company-website/src/index.js b/chapter-11/company-website/src/index.js index cf29e6e7..3d98a0bb 100644 --- a/chapter-11/company-website/src/index.js +++ b/chapter-11/company-website/src/index.js @@ -24,10 +24,10 @@ render(
- +