@@ -8,7 +8,6 @@ import Button from '@material-ui/core/Button';
8
8
import Header from '../components/HomeHeader' ;
9
9
import Footer from '../components/HomeFooter' ;
10
10
import TOC from '../components/TOC' ;
11
- import BookReviews from '../components/BookReviews' ;
12
11
13
12
import {
14
13
styleBigAvatar ,
@@ -18,20 +17,22 @@ import {
18
17
} from '../lib/SharedStyles' ;
19
18
import withLayout from '../lib/withLayout' ;
20
19
import withAuth from '../lib/withAuth' ;
21
- import { getTableOfContents , getBookReviews } from '../lib/api/public' ;
20
+ import { getTableOfContents } from '../lib/api/public' ;
22
21
23
22
const styleAuthor = {
24
23
textAlign : 'center' ,
25
24
padding : '10px 10%' ,
26
25
} ;
27
26
28
- const Book = ( { user, toc, reviews } ) => (
27
+ const Book = ( { user, toc } ) => (
29
28
< div >
30
29
< Head >
31
30
< title > Learn how to build a JavaScript web app from scratch</ title >
32
31
< meta
33
32
name = "description"
34
- content = "Learn how to build a complete web app with a modern JavaScript stack. React, Material UI, Next, Express, Mongoose, and MongoDB. Integrated with AWS SES, Github, Google OAuth, Stripe, and MailChimp."
33
+ content = "Learn how to build a complete web app with a modern JavaScript stack.
34
+ React, Material UI, Next, Express, Mongoose, and MongoDB. Integrated with
35
+ AWS SES, Github, Google OAuth, Stripe, and MailChimp."
35
36
/>
36
37
</ Head >
37
38
< Header user = { user } />
@@ -41,7 +42,8 @@ const Book = ({ user, toc, reviews }) => (
41
42
< br />
42
43
< p style = { { margin : '45px auto' , fontSize : '44px' , fontWeight : '400' } } > Our Book</ p >
43
44
< p >
44
- Learn how to build a full-stack JavaScript web application from scratch.< br />
45
+ Learn how to build a full-stack JavaScript web application from scratch.
46
+ < br />
45
47
You'll go from 0 lines of code in Chapter 1 to over 12,000 lines of code by Chapter
46
48
8.
47
49
</ p >
@@ -93,12 +95,6 @@ const Book = ({ user, toc, reviews }) => (
93
95
94
96
< br />
95
97
96
- < div >
97
- < BookReviews reviewsArray = { reviews } numberOfReviews = { 8 } />
98
- </ div >
99
-
100
- < br />
101
-
102
98
< div >
103
99
< TOC toc = { toc } bookSlug = "builder-book" />
104
100
</ div >
@@ -120,11 +116,17 @@ const Book = ({ user, toc, reviews }) => (
120
116
< a href = "https://findharbor.com" target = "_blank" rel = "noopener noreferrer" >
121
117
{ ' ' }
122
118
Harbor
123
- </ a > . Stay tuned for
124
- < a href = "https://github.com/async-labs/async-saas" target = "_blank" rel = "noopener noreferrer" >
119
+ </ a >
120
+ . Stay tuned for
121
+ < a
122
+ href = "https://github.com/async-labs/async-saas"
123
+ target = "_blank"
124
+ rel = "noopener noreferrer"
125
+ >
125
126
{ ' ' }
126
127
Async
127
- </ a > .
128
+ </ a >
129
+ .
128
130
</ div >
129
131
< br />
130
132
< Grid container direction = "row" justify = "space-around" align = "flex-start" >
@@ -176,11 +178,11 @@ Book.propTypes = {
176
178
user : PropTypes . shape ( {
177
179
_id : PropTypes . string . isRequired ,
178
180
} ) ,
179
- toc : PropTypes . arrayOf ( PropTypes . shape ( {
180
- title : PropTypes . string . isRequired ,
181
- } ) ) . isRequired ,
182
- reviews : PropTypes . arrayOf ( PropTypes . object )
183
- . isRequired ,
181
+ toc : PropTypes . arrayOf (
182
+ PropTypes . shape ( {
183
+ title : PropTypes . string . isRequired ,
184
+ } ) ,
185
+ ) . isRequired ,
184
186
} ;
185
187
186
188
Book . defaultProps = {
@@ -189,18 +191,12 @@ Book.defaultProps = {
189
191
190
192
Book . getInitialProps = async function getInitialProps ( ) {
191
193
let toc = [ ] ;
192
- let reviews = [ ] ;
193
194
try {
194
195
toc = await getTableOfContents ( { slug : 'builder-book' } ) ;
195
196
} catch ( error ) {
196
197
console . log ( error ) ; // eslint-disable-line
197
198
}
198
- try {
199
- reviews = await getBookReviews ( { slug : 'builder-book' } ) ;
200
- } catch ( error ) {
201
- console . log ( error ) ; // eslint-disable-line
202
- }
203
- return { toc, reviews } ;
199
+ return { toc } ;
204
200
} ;
205
201
206
202
export default withAuth ( withLayout ( Book , { noHeader : true } ) , { loginRequired : false } ) ;
0 commit comments