🧮 Using Masonry to grid out the issue covers in VolumeDetails
This commit is contained in:
@@ -323,7 +323,7 @@ $size-8: 0.9rem;
|
|||||||
|
|
||||||
.comic-vine-match-drawer {
|
.comic-vine-match-drawer {
|
||||||
// comic detail drawer
|
// comic detail drawer
|
||||||
|
|
||||||
.search-criteria-card {
|
.search-criteria-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.card-content {
|
.card-content {
|
||||||
@@ -339,6 +339,25 @@ $size-8: 0.9rem;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Volume detail
|
||||||
|
.volume-details {
|
||||||
|
.issues-container {
|
||||||
|
display: -webkit-box; /* Not needed if autoprefixing */
|
||||||
|
display: -ms-flexbox; /* Not needed if autoprefixing */
|
||||||
|
display: flex;
|
||||||
|
width: auto;
|
||||||
|
.issues-column {
|
||||||
|
padding: 10px;
|
||||||
|
background-clip: padding-box;
|
||||||
|
& > div {
|
||||||
|
/* change div to reference your elements you put in <Masonry> */
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// comicvine search results
|
// comicvine search results
|
||||||
.search-results-container {
|
.search-results-container {
|
||||||
margin: 15px 0 0 0;
|
margin: 15px 0 0 0;
|
||||||
@@ -348,13 +367,11 @@ $size-8: 0.9rem;
|
|||||||
margin: 0 0 10px 0;
|
margin: 0 0 10px 0;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: #F2F1F9;
|
background: #f2f1f9;
|
||||||
.cover-image {
|
.cover-image {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
.search-result-details {
|
.search-result-details {
|
||||||
|
|
||||||
|
|
||||||
.score {
|
.score {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
@@ -362,21 +379,20 @@ $size-8: 0.9rem;
|
|||||||
.volume-information {
|
.volume-information {
|
||||||
margin-top: -2.5em;
|
margin-top: -2.5em;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
background: #FDECD1;
|
background: #fdecd1;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
.vertical-line {
|
.vertical-line {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -25px;
|
top: -25px;
|
||||||
left: 1.5rem;
|
left: 1.5rem;
|
||||||
border: 2px dotted #CCC;
|
border: 2px dotted #ccc;
|
||||||
width:20px;
|
width: 20px;
|
||||||
min-height:35px;
|
min-height: 35px;
|
||||||
|
|
||||||
border-color: transparent transparent #F3A22D #F3A22D;
|
border-color: transparent transparent #f3a22d #f3a22d;
|
||||||
border-bottom-left-radius: 10px;
|
border-bottom-left-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import React, { ReactElement } from "react";
|
|||||||
import Card from "./Carda";
|
import Card from "./Carda";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import ellipsize from "ellipsize";
|
import ellipsize from "ellipsize";
|
||||||
import {
|
import { escapePoundSymbol } from "../shared/utils/formatting.utils";
|
||||||
removeLeadingPeriod,
|
|
||||||
escapePoundSymbol,
|
|
||||||
} from "../shared/utils/formatting.utils";
|
|
||||||
import { isNil, isUndefined, map } from "lodash";
|
import { isNil, isUndefined, map } from "lodash";
|
||||||
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
|
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
|
||||||
import Masonry from "react-masonry-css";
|
import Masonry from "react-masonry-css";
|
||||||
@@ -22,7 +19,7 @@ export const RecentlyImported = ({
|
|||||||
default: 5,
|
default: 5,
|
||||||
1100: 4,
|
1100: 4,
|
||||||
700: 2,
|
700: 2,
|
||||||
500: 1,
|
600: 1,
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -6,9 +6,16 @@ import {
|
|||||||
getComicBookDetailById,
|
getComicBookDetailById,
|
||||||
getIssuesForSeries,
|
getIssuesForSeries,
|
||||||
} from "../../actions/comicinfo.actions";
|
} from "../../actions/comicinfo.actions";
|
||||||
|
import Masonry from "react-masonry-css";
|
||||||
import { Card } from "../Carda";
|
import { Card } from "../Carda";
|
||||||
|
|
||||||
const VolumeDetails = (props): ReactElement => {
|
const VolumeDetails = (props): ReactElement => {
|
||||||
|
const breakpointColumnsObj = {
|
||||||
|
default: 5,
|
||||||
|
1100: 4,
|
||||||
|
700: 2,
|
||||||
|
600: 1,
|
||||||
|
};
|
||||||
const comicBookDetails = useSelector(
|
const comicBookDetails = useSelector(
|
||||||
(state: RootState) => state.comicInfo.comicBookDetail,
|
(state: RootState) => state.comicInfo.comicBookDetail,
|
||||||
);
|
);
|
||||||
@@ -28,13 +35,13 @@ const VolumeDetails = (props): ReactElement => {
|
|||||||
!isUndefined(comicBookDetails.sourcedMetadata.comicvine)
|
!isUndefined(comicBookDetails.sourcedMetadata.comicvine)
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container volume-details">
|
||||||
<div className="section">
|
<div className="section">
|
||||||
<h1 className="title">
|
<h1 className="title">
|
||||||
{comicBookDetails.sourcedMetadata.comicvine.volumeInformation.name}
|
{comicBookDetails.sourcedMetadata.comicvine.volumeInformation.name}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="columns is-multiline">
|
<div className="columns is-multiline">
|
||||||
<div className="column is-narrow">
|
<div className="column is-narrow is-full">
|
||||||
<Card
|
<Card
|
||||||
imageUrl={
|
imageUrl={
|
||||||
comicBookDetails.sourcedMetadata.comicvine.volumeInformation
|
comicBookDetails.sourcedMetadata.comicvine.volumeInformation
|
||||||
@@ -44,11 +51,22 @@ const VolumeDetails = (props): ReactElement => {
|
|||||||
hasDetails={false}
|
hasDetails={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<Masonry
|
||||||
{issues.map((issue, idx) => {
|
breakpointCols={breakpointColumnsObj}
|
||||||
return <img key={idx} src={issue.image.thumb_url} />;
|
className="issues-container"
|
||||||
|
columnClassName="issues-column"
|
||||||
|
>
|
||||||
|
{issues.map((issue) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
key={issue.id}
|
||||||
|
imageUrl={issue.image.thumb_url}
|
||||||
|
orientation={"vertical"}
|
||||||
|
hasDetails={false}
|
||||||
|
/>
|
||||||
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</Masonry>
|
||||||
{/* <pre>{JSON.stringify(comicBookDetails, undefined, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(comicBookDetails, undefined, 2)}</pre> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ export const VolumeGroups = (): ReactElement => {
|
|||||||
volumeGroups &&
|
volumeGroups &&
|
||||||
map(volumeGroups.data, (group) => {
|
map(volumeGroups.data, (group) => {
|
||||||
if (!isNil(group)) {
|
if (!isNil(group)) {
|
||||||
console.log(group);
|
|
||||||
return (
|
return (
|
||||||
<div className="stack" key={group.results.id}>
|
<div className="stack" key={group.results.id}>
|
||||||
<img src={group.results.image.small_url} />
|
<img src={group.results.image.small_url} />
|
||||||
|
|||||||
Reference in New Issue
Block a user