@@ -8,7 +8,6 @@ import Button from '@material-ui/core/Button';
88import Header from '../components/HomeHeader' ;
99import Footer from '../components/HomeFooter' ;
1010import TOC from '../components/TOC' ;
11- import BookReviews from '../components/BookReviews' ;
1211
1312import {
1413 styleBigAvatar ,
@@ -18,20 +17,22 @@ import {
1817} from '../lib/SharedStyles' ;
1918import withLayout from '../lib/withLayout' ;
2019import withAuth from '../lib/withAuth' ;
21- import { getTableOfContents , getBookReviews } from '../lib/api/public' ;
20+ import { getTableOfContents } from '../lib/api/public' ;
2221
2322const styleAuthor = {
2423 textAlign : 'center' ,
2524 padding : '10px 10%' ,
2625} ;
2726
28- const Book = ( { user, toc, reviews } ) => (
27+ const Book = ( { user, toc } ) => (
2928 < div >
3029 < Head >
3130 < title > Learn how to build a JavaScript web app from scratch</ title >
3231 < meta
3332 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."
3536 />
3637 </ Head >
3738 < Header user = { user } />
@@ -41,7 +42,8 @@ const Book = ({ user, toc, reviews }) => (
4142 < br />
4243 < p style = { { margin : '45px auto' , fontSize : '44px' , fontWeight : '400' } } > Our Book</ p >
4344 < 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 />
4547 You'll go from 0 lines of code in Chapter 1 to over 12,000 lines of code by Chapter
4648 8.
4749 </ p >
@@ -93,12 +95,6 @@ const Book = ({ user, toc, reviews }) => (
9395
9496 < br />
9597
96- < div >
97- < BookReviews reviewsArray = { reviews } numberOfReviews = { 8 } />
98- </ div >
99-
100- < br />
101-
10298 < div >
10399 < TOC toc = { toc } bookSlug = "builder-book" />
104100 </ div >
@@ -120,11 +116,17 @@ const Book = ({ user, toc, reviews }) => (
120116 < a href = "https://findharbor.com" target = "_blank" rel = "noopener noreferrer" >
121117 { ' ' }
122118 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+ >
125126 { ' ' }
126127 Async
127- </ a > .
128+ </ a >
129+ .
128130 </ div >
129131 < br />
130132 < Grid container direction = "row" justify = "space-around" align = "flex-start" >
@@ -176,11 +178,11 @@ Book.propTypes = {
176178 user : PropTypes . shape ( {
177179 _id : PropTypes . string . isRequired ,
178180 } ) ,
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 ,
184186} ;
185187
186188Book . defaultProps = {
@@ -189,18 +191,12 @@ Book.defaultProps = {
189191
190192Book . getInitialProps = async function getInitialProps ( ) {
191193 let toc = [ ] ;
192- let reviews = [ ] ;
193194 try {
194195 toc = await getTableOfContents ( { slug : 'builder-book' } ) ;
195196 } catch ( error ) {
196197 console . log ( error ) ; // eslint-disable-line
197198 }
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 } ;
204200} ;
205201
206202export default withAuth ( withLayout ( Book , { noHeader : true } ) , { loginRequired : false } ) ;
0 commit comments