@@ -4,7 +4,6 @@ import StarRatings from "react-star-ratings"
|
|||||||
import { Card, Row, Col } from "react-bootstrap"
|
import { Card, Row, Col } from "react-bootstrap"
|
||||||
|
|
||||||
import AmazonURL from "../components/amazonurl"
|
import AmazonURL from "../components/amazonurl"
|
||||||
import GoodReadsImage from "../components/goodreadsimage"
|
|
||||||
|
|
||||||
const truncateContent = (content) => {
|
const truncateContent = (content) => {
|
||||||
if (!content) {
|
if (!content) {
|
||||||
@@ -38,10 +37,6 @@ const BookCard = ({ book }) => (
|
|||||||
{book.author} <b>{book.year ? book.year: null}</b>
|
{book.author} <b>{book.year ? book.year: null}</b>
|
||||||
<br />
|
<br />
|
||||||
{book.amazon_url ? <AmazonURL book={book} />: null}
|
{book.amazon_url ? <AmazonURL book={book} />: null}
|
||||||
<br />
|
|
||||||
<a href={book.url} >
|
|
||||||
<GoodReadsImage />
|
|
||||||
</a>
|
|
||||||
</Card.Subtitle>
|
</Card.Subtitle>
|
||||||
<p>
|
<p>
|
||||||
{truncateContent(book.description)}
|
{truncateContent(book.description)}
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import { useStaticQuery, graphql } from "gatsby"
|
|
||||||
import Img from "gatsby-image"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This component is built using `gatsby-image` to automatically serve optimized
|
|
||||||
* images with lazy loading and reduced file sizes. The image is loaded using a
|
|
||||||
* `useStaticQuery`, which allows us to load the image from directly within this
|
|
||||||
* component, rather than having to pass the image data down from pages.
|
|
||||||
*
|
|
||||||
* For more information, see the docs:
|
|
||||||
* - `gatsby-image`: https://gatsby.dev/gatsby-image
|
|
||||||
* - `useStaticQuery`: https://www.gatsbyjs.org/docs/use-static-query/
|
|
||||||
*/
|
|
||||||
|
|
||||||
const Image = () => {
|
|
||||||
const data = useStaticQuery(graphql`
|
|
||||||
query {
|
|
||||||
placeholderImage: file(relativePath: { eq: "gatsby-astronaut.png" }) {
|
|
||||||
childImageSharp {
|
|
||||||
fluid(maxWidth: 300) {
|
|
||||||
...GatsbyImageSharpFluid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
|
|
||||||
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Image
|
|
||||||
Reference in New Issue
Block a user