Skip to content

Commit

Permalink
Merge pull request #2 from riencoertjens/showcase-column-layout-update
Browse files Browse the repository at this point in the history
Showcase column layout update
  • Loading branch information
riencoertjens authored Sep 8, 2018
2 parents 227c8f9 + d6aefa0 commit 64274b1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
9 changes: 4 additions & 5 deletions www/src/views/shared/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ const styles = {
display: `flex`,
flexWrap: `wrap`,
padding: rhythm(3 / 4),
justifyContent: `center`,
[presets.Desktop]: {
justifyContent: `flex-start`,
},
justifyContent: `space-evenly`,
},
showcaseItem: {
display: `flex`,
flexDirection: `column`,
margin: rhythm(3 / 4),
width: 282,
minWidth: 259,//shows 3 items/row on windows > 1200px wide
maxWidth: 350,
flex: `1 0 0`,
position: `relative`,
},
featuredItem: {
Expand Down
10 changes: 5 additions & 5 deletions www/src/views/shared/thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const ThumbnailLink = ({ slug, image, title, children }) => {

// site showcase
if (image.screenshotFile) {
screenshot = image.screenshotFile.childImageSharp.fixed
screenshot = image.screenshotFile.childImageSharp.fluid
} else {
// starter showcase
screenshot = image.childImageSharp.fixed
screenshot = image.childImageSharp.fluid
}

return (
Expand All @@ -37,7 +37,7 @@ const ThumbnailLink = ({ slug, image, title, children }) => {
>
{screenshot ? (
<Img
fixed={screenshot}
fluid={screenshot}
alt={`Screenshot of ${title}`}
css={{ ...styles.screenshot }}
/>
Expand All @@ -60,8 +60,8 @@ export default ThumbnailLink

export const showcaseThumbnailFragment = graphql`
fragment ShowcaseThumbnailFragment_item on ImageSharp {
fixed(width: 282, height: 211) {
...GatsbyImageSharpFixed_noBase64
fluid(maxWidth: 350) {
...GatsbyImageSharpFluid_noBase64
}
}
`
7 changes: 7 additions & 0 deletions www/src/views/showcase/showcase-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ const ShowcaseList = ({ items, count }) => {
</div>
)
)}
{/* makes last row items equal width and aligned left */}
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
</div>
)
}
Expand Down
10 changes: 1 addition & 9 deletions www/src/views/starter-showcase/filtered-showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,7 @@ export default class FilteredShowcase extends Component {
<button
css={{
...styles.button,
display: `block`,
marginBottom: rhythm(options.blockMarginBottom * 5),
marginTop: rhythm(options.blockMarginBottom * 2),
marginLeft: `auto`,
marginRight: `auto`,
[presets.Desktop]: {
marginLeft: rhythm(6 / 4),
marginRight: rhythm(6 / 4),
},
...styles.loadMoreButton
}}
onClick={() => {
this.setState({ sitesToShow: this.state.sitesToShow + 15 })
Expand Down
22 changes: 11 additions & 11 deletions www/src/views/starter-showcase/showcase-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ const ShowcaseList = ({ urlState, items, imgs, count, sortRecent }) => {
<div
css={{
fontFamily: options.headerFontFamily.join(`,`),
display: `flex`,
flexWrap: `wrap`,
padding: rhythm(3 / 4),
justifyContent: `center`,
[presets.Desktop]: {
justifyContent: `flex-start`,
},
...styles.showcaseList
}}
>
{items.map(({ node }) => {
Expand All @@ -82,8 +76,7 @@ const ShowcaseList = ({ urlState, items, imgs, count, sortRecent }) => {
<div
key={node.id}
css={{
margin: rhythm(3 / 4),
width: 280,
...styles.showcaseItem
}}
{...styles.withTitleHover}
>
Expand Down Expand Up @@ -143,9 +136,9 @@ const ShowcaseList = ({ urlState, items, imgs, count, sortRecent }) => {
</span>
</div>
<div>
<span className="title">
<span>
<h5 css={{ margin: 0 }}>
<strong>{repo.name}</strong>
<strong className="title">{repo.name}</strong>
</h5>
</span>
{/* {isGatsbyVersionWarning ?
Expand Down Expand Up @@ -181,6 +174,13 @@ const ShowcaseList = ({ urlState, items, imgs, count, sortRecent }) => {
)
)
})}
{/* makes last row items equal width and aligned left */}
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
<div css={{ ...styles.showcaseItem, marginTop: 0, marginBottom: 0 }} />
</div>
)
}
Expand Down

0 comments on commit 64274b1

Please sign in to comment.