Commit b21f2411 authored by Seth A Johnson's avatar Seth A Johnson
Browse files

HELIO-2079, HELIO-3142

Order books on front page by orderOnPage
Create a "just the cover" view for books that are not 1 or 2
parent 3b96ed54
......@@ -18,7 +18,7 @@ const Book = ({book}) => {
<Img fluid={cover.childImageSharp.fluid}
alt={`cover of ${title}`}
className="card-img"
/>
/>
</div>
<div class="col-md-8">
<div className="card-body">
......
import React from "react"
import Img from "gatsby-image"
const BookCover = ({book}) => {
return (
<div>
<Img fluid={book.cover.childImageSharp.fluid}
alt={`cover of ${book.title}`}
className="card-img"
/>
</div>
)
}
export default BookCover
import React from "react"
import BookCard from "./bookCard"
import BookCover from "./bookCover"
const BookList = ({books}) => {
......@@ -7,9 +8,17 @@ const BookList = ({books}) => {
<div className="row lever-card-list">
{
books.map(({node}) => {
return (
console.log(node);
if (node.frontmatter.orderOnPage === 1 || node.frontmatter.orderOnPage === 2) {
console.log(node);
return (
<BookCard key={node.id} book={node.frontmatter} />
)
)
} else {
return (
<BookCover key={node.id} book={node.frontmatter} />
)
}
})
}
</div>
......
......@@ -11,7 +11,7 @@ const EventCard = ({event, cardStyle}) => {
<Link to={slug}>
<li className="media my-4">
<Img fluid={image.childImageSharp.fluid} />
<div class="media-body">
<div className="media-body">
<h5 className="mt-0 mb-1">{title}</h5>
Summary of the event goes here.
</div>
......
......@@ -11,15 +11,15 @@ const NewsCard = ({singleNews, cardStyle}) => {
<div className="blog-card-container">
<Link to={slug}>
<div className="card mb-3">
<div class="row no-gutters">
<div className="row no-gutters">
<div className="col-md-4">
<Img fluid={image.childImageSharp.fluid} />
</div>
<div class="col-md-8">
<div className="col-md-8">
<div className="card-body">
<h5 className="card-title">{title}</h5>
<p className="card-text">Summary of the blog post goes here.</p>
<p className="published"><small class="text-muted">Published {date}</small></p>
<p className="published"><small className="text-muted">Published {date}</small></p>
</div>
</div>
</div>
......
......@@ -46,6 +46,10 @@ query {
books: allMarkdownRemark (
filter: {
frontmatter: { templateKey: { eq: "book" } }
},
sort: {
fields: frontmatter___orderOnPage,
order: ASC
}
) {
edges {
......@@ -57,6 +61,7 @@ query {
description
readLink
buyLink
orderOnPage
cover {
childImageSharp {
fluid {
......@@ -155,9 +160,9 @@ const IndexPage = ({data}) => {
</div>
</div>
</section>
<section class="tagline-newsletter-container">
<div class="container">
<div class="row">
<section className="tagline-newsletter-container">
<div className="container">
<div className="row">
<div className="tagline-container col-md-9">
<Tagline text={tagline.text} />
</div>
......@@ -178,8 +183,8 @@ const IndexPage = ({data}) => {
</div>
</section>
<section className="author-library-container">
<div class="container">
<div class="row">
<div className="container">
<div className="row">
<div className="author-container col">
<div className="row">
<div className="col-md-8">
......@@ -204,7 +209,7 @@ const IndexPage = ({data}) => {
</div>
</section>
<section className="video-impact-container container">
<div class="row">
<div className="row">
<div className="video-container col">
<Video video={video} />
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment