Style book card
This commit is contained in:
@@ -8,7 +8,7 @@ const getTargetURL = (book) => {
|
||||
export default ({ book }) => {
|
||||
return (
|
||||
<OutboundLink href={getTargetURL(book)} target="_blank">
|
||||
<img alt="Amazon link" style={{ "width": "30px" }} src="https://img.icons8.com/color/48/000000/amazon.png"/>
|
||||
<img alt="Amazon link" style={{ marginBottom: "-8px" }} src="https://img.icons8.com/color/48/000000/amazon.png"/>
|
||||
</OutboundLink>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -14,36 +14,39 @@ const truncateContent = (content) => {
|
||||
};
|
||||
|
||||
const BookCard = ({ book }) => (
|
||||
<Card style={{ width: "44rem", height: "21rem", marginBottom: "15px" }}>
|
||||
<Card style={{ width: "44rem", height: "18rem", marginBottom: "15px" }}>
|
||||
<Row aria-label={book.title}>
|
||||
<Col xs={3}>
|
||||
<Card.Img
|
||||
style={{ height: "12rem", width: "8rem", paddingLeft: "25px", paddingRight: "-15px", paddingTop: "30px" }}
|
||||
style={{ width: "9rem", paddingLeft: "25px", paddingRight: "-15px", paddingTop: "30px" }}
|
||||
src={book.image_url}
|
||||
alt={book.title}
|
||||
/>
|
||||
</Col>
|
||||
<Col>
|
||||
<Card.Body>
|
||||
<Card.Body style={{ marginLeft: "-30px"}}>
|
||||
<Card.Title>{book.title}</Card.Title>
|
||||
<Card.Subtitle className="mb-2 text-muted">
|
||||
<StarRatings
|
||||
rating={parseFloat(book.rating)}
|
||||
numberOfStars={5}
|
||||
starDimension="18px"
|
||||
starSpacing="1px"
|
||||
starRatedColor="#fa604a"
|
||||
/>
|
||||
<br />
|
||||
{book.author} <b>{book.year ? book.year: null}</b>
|
||||
<br />
|
||||
{book.amazon_url ? <AmazonURL book={book} />: null}
|
||||
<br />
|
||||
<a href={book.url} >
|
||||
<GoodReadsImage />
|
||||
</a>
|
||||
<div>{book.author} <b>{book.year ? book.year: null}</b></div>
|
||||
<div>
|
||||
<StarRatings
|
||||
rating={parseFloat(book.rating)}
|
||||
numberOfStars={5}
|
||||
starDimension="18px"
|
||||
starSpacing="1px"
|
||||
starRatedColor="#fa604a"
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "flex", alignItems: "center", paddingTop: ".75rem" }}>
|
||||
<div style= {{ width: "30px", height: "30px", marginRight: "5px" }}>
|
||||
{book.amazon_url ? <AmazonURL book={book} />: null}
|
||||
</div>
|
||||
<div style= {{ width: "30px", height: "30px" }}>
|
||||
<a href={book.url} ><GoodReadsImage /></a>
|
||||
</div>
|
||||
</div>
|
||||
</Card.Subtitle>
|
||||
<p>
|
||||
<p style={{ color: "gray", fontSize: "0.8rem", paddingTop: "1rem" }}>
|
||||
{truncateContent(book.description)}
|
||||
</p>
|
||||
</Card.Body>
|
||||
|
||||
Reference in New Issue
Block a user