Skip to content

Commit

Permalink
Merge pull request #39 from rrigato/dev
Browse files Browse the repository at this point in the history
create array of book objects
  • Loading branch information
rrigato authored Jan 14, 2024
2 parents 104117a + 07fb0d0 commit 992e080
Showing 1 changed file with 112 additions and 84 deletions.
196 changes: 112 additions & 84 deletions static/js/BookRecommendations.jsx
Original file line number Diff line number Diff line change
@@ -1,157 +1,185 @@
import React from 'react';
import '../css/homepageSection.css';

/**
* @type {string[]} bookAuthors Authors of books
*/
const bookAuthors = [
'Nassim Taleb',
'Peter Attia',
'Marie Kondo',
'John Tierney and Roy Baumeister',
'Bob Martin',
'DHH and Jason Fried',
'Ryan Singer',
'Fred Brooks'
]

/**
* @type {string[]} bookDescriptions summary of book
*/
const bookDescriptions = [
'Five book collection centered around the understanding the impacts of randomness.',
'View health span as a downward slope instead of a constant as the years pass by.',
'Evaluate each item in your life for whether it continues to bring you joy.',
'Having 1 friend with a negative personality is asymmetrically harmful to your well being.',
'The goal of software architecture is to minimize the human resources required to build and maintain the desired application.',
'Outlines office culture for working remote',
'Outside of the fact that he objectively has the coolest first name a human can have, this is the definitive guide on how iterations should be structured in any devops oriented team.',
'Scaling software engineering team size leads to increased communication overhead and might cause the project to miss deadlines.'
]

/**
* @type {string[]} bookTitles list of book titles
/**Books to recommend and meta data
*
* @type {Array.<{
* bookAuthor: string,
* bookDescription: string,
* bookTitle: string,
* bookUrl: string
* }>} bookData
*/
const bookTitles = [
'Incerto by',
'Outlive by',
'The Life Cleaning Magic Of Tidying Up by',
'The Power Of Bad by',
'Clean Architecture by',
'Rework by',
'Shape Up by',
'The Mythical Man Month by'
const bookData = [
{
bookAuthor: 'Nassim Taleb',
bookDescription: 'Five book collection centered around the understanding the impacts of randomness.',
bookTitle: 'Incerto',
bookUrl: 'https://en.wikipedia.org/wiki/Nassim_Nicholas_Taleb#Writing_career'
},
{
bookAuthor: 'Peter Attia',
bookDescription: 'View health span as a downward slope instead of a constant as the years pass by.',
bookTitle: 'Outlive',
bookUrl: 'https://www.amazon.com/Outlive-Longevity-Peter-Attia-MD/dp/0593236599'
},
{
bookAuthor: 'Marie Kondo',
bookDescription: 'Evaluate each item in your life for whether it continues to bring you joy.',
bookTitle: 'The Life Changing Magic Of Tidying Up',
bookUrl: 'https://www.amazon.com/Life-Changing-Magic-Tidying-Decluttering-Organizing/dp/1607747308'
},
{
bookAuthor: 'John Tierney and Roy Baumeister',
bookDescription: 'Having 1 friend with a negative personality is asymmetrically harmful to your well being.',
bookTitle: 'The Power Of Bad',
bookUrl: 'https://www.amazon.com/Power-Bad-Negativity-Effect-Rules-ebook/dp/B07Q3NHPGZ'
},
{
bookAuthor: 'Bob Martin',
bookDescription: 'The goal of software architecture is to minimize the human resources required to build and maintain the desired application.',
bookTitle: 'Clean Architecture',
bookUrl: 'https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164'
},
{
bookAuthor: 'DHH and Jason Fried',
bookDescription: 'Outlines office culture for working remote',
bookTitle: 'Rework',
bookUrl: 'https://basecamp.com/books/rework'
},
{
bookAuthor: 'Ryan Singer',
bookDescription: 'Outside of the fact that he objectively has the coolest first name a human can have, this is the definitive guide on how iterations should be structured in any devops oriented team.',
bookTitle: 'Shape Up',
bookUrl: 'https://basecamp.com/shapeup'
},

{
bookAuthor: 'Fred Brooks',
bookDescription: 'Scaling software engineering team size leads to increased communication overhead and might cause the project to miss deadlines.',
bookTitle: 'The Mythical Man Month by',
bookUrl: 'https://en.wikipedia.org/wiki/The_Mythical_Man-Month'

},
]

/**
* @type {string[]} bookUrls list of book urls
*/
const bookUrls = [
'https://en.wikipedia.org/wiki/Nassim_Nicholas_Taleb#Writing_career',
'https://www.amazon.com/Outlive-Longevity-Peter-Attia-MD/dp/0593236599',
'https://www.amazon.com/Life-Changing-Magic-Tidying-Decluttering-Organizing/dp/1607747308',
'https://www.amazon.com/Power-Bad-Negativity-Effect-Rules-ebook/dp/B07Q3NHPGZ',
'https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164',
'https://basecamp.com/books/rework',
'https://basecamp.com/shapeup',
'https://en.wikipedia.org/wiki/The_Mythical_Man-Month'

]
/**Book Recommendations
*
* @returns react jsx
*/
export function BookRecommendations(){
/**
* @type {Array.<JSX.Element>} bookJsxListItems list of li from bookData
*/
const bookJsxListItems = [];

//for loop over bookData array
for(let i = 0; i < bookData.length; i++){
bookJsxListItems.push(
<div>
<li>{bookData[i].bookTitle}
<a
href={bookData[i].bookUrl}
target={'_blank'}
>{bookData[i].bookAuthor}</a>
</li>
<li className='book-details'>
{bookData[i].bookDescription}
</li>
</div>
);
}
return(
<div className='homepage-content'>
<div>
<ul>
<h3>Everyday Reads</h3>
<li>{bookTitles[0]}
<li>{bookData[0].bookTitle}
<a
href={bookUrls[0]}
href={bookData[0].bookUrl}
target={'_blank'}
>{bookAuthors[0]}</a>
>{bookData[0].bookAuthor}</a>

</li>
<li className='book-details'>
{bookDescriptions[0]}
{bookData[0].bookDescription}
</li>

<li>{bookTitles[1]}
<li>{bookData[1].bookTitle}
<a
href={bookUrls[1]}
href={bookData[1].bookUrl}
target={'_blank'}
>{bookAuthors[1]}</a>
>{bookData[1].bookAuthor}</a>

</li>
<li className='book-details'>
{bookDescriptions[1]}
{bookData[1].bookDescription}
</li>

<li>{bookTitles[2]}
<li>{bookData[2].bookTitle}
<a
href={bookUrls[2]}
href={bookData[2].bookUrl}
target={'_blank'}
>{bookAuthors[2]}</a>
>{bookData[2].bookAuthor}</a>

</li>
<li className='book-details'>
{bookDescriptions[2]}
{bookData[2].bookDescription}
</li>

<li>{bookTitles[3]}
<li>{bookData[3].bookTitle}
<a
href={bookUrls[3]}
href={bookData[3].bookUrl}
target={'_blank'}
>{bookAuthors[3]}</a>
>{bookData[3].bookAuthor}</a>

</li>
<li className='book-details'>
{bookDescriptions[3]}
{bookData[3].bookDescription}
</li>


<h3>Software Engineering</h3>

<li>{bookTitles[4]}
<li>{bookData[4].bookTitle}
<a
href={bookUrls[4]}
href={bookData[4].bookUrl}
target={'_blank'}
>{bookAuthors[4]}</a>
>{bookData[4].bookAuthor}</a>
</li>
<li className='book-details'>
{bookDescriptions[4]}
{bookData[4].bookDescription}
</li>

<li>{bookTitles[5]}
<li>{bookData[5].bookTitle}
<a
href={bookUrls[5]}
href={bookData[5].bookUrl}
target={'_blank'}
>{bookAuthors[5]}</a>
>{bookData[5].bookAuthor}</a>
</li>
<li className='book-details'>
{bookDescriptions[5]}
{bookData[5].bookDescription}
</li>

<li>{bookTitles[6]}
<li>{bookData[6].bookTitle}
<a
href={bookUrls[6]}
href={bookData[6].bookUrl}
target={'_blank'}
>{bookAuthors[6]}</a>
>{bookData[6].bookAuthor}</a>
</li>
<li className='book-details'>
{bookDescriptions[6]}
{bookData[6].bookDescription}
</li>

<li>{bookTitles[7]}
<li>{bookData[7].bookTitle}
<a
href={bookUrls[7]}
href={bookData[7].bookUrl}
target={'_blank'}
>{bookAuthors[7]}</a>
>{bookData[7].bookAuthor}</a>
</li>
<li className='book-details'>
{bookDescriptions[7]}
{bookData[7].bookDescription}
</li>

</ul>
Expand Down

0 comments on commit 992e080

Please sign in to comment.